Skip to content

Instantly share code, notes, and snippets.

View ar1ja's full-sized avatar
🏳️‍⚧️

Arija A. (Ari Archer) (migrated to https://git.ari.lt/ari) ar1ja

🏳️‍⚧️
View GitHub Profile
@qexat
qexat / list.py
Last active December 25, 2025 16:11
functional programmers when they are forced to use python (they are crying and seething)
# ruff: noqa: D100, D103, A001, A002
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from collections.abc import Callable
type List[T] = tuple[()] | tuple[T, List[T]]
@branneman
branneman / http-easy.rkt
Last active June 29, 2024 18:58
Racket: How to do HTTP requests
#lang racket/base
(require
net/http-easy)
(define (base-url path)
(string-append "https://httpbin.org" path))
; request: GET
; response: plain string body
@ttys3
ttys3 / gruvbox-material-alacritty.yml
Created January 16, 2021 03:33 — forked from sainnhe/gruvbox-material-alacritty.yml
Gruvbox Material for Alacritty
# The definition of color schemes.
schemes:
gruvbox_material_hard_dark: &gruvbox_material_hard_dark
primary:
background: '0x1d2021'
foreground: '0xd4be98'
normal:
black: '0x32302f'
red: '0xea6962'
green: '0xa9b665'
```cpp
// Sorry, I don't know which.
#define WIN32_MEAN_AND_LEAN
#define WIN32_LEAN_AND_MEAN
enum class FizzBuzzState : uint32_t
{
Fizz = 0b01,
Buzz = 0b10,
FizzBuzz = Fizz | Buzz
template <class _Ty>
_NODISCARD /* constexpr */ _Ty _Common_lerp(const _Ty _ArgA, const _Ty _ArgB, const _Ty _ArgT) noexcept {
// on a line intersecting {(0.0, _ArgA), (1.0, _ArgB)}, return the Y value for X == _ArgT
const int _Finite_mask = (int{isfinite(_ArgA)} << 2) | (int{isfinite(_ArgB)} << 1) | int{isfinite(_ArgT)};
if (_Finite_mask == 0b111) {
// 99% case, put it first; this block comes from P0811R3
if ((_ArgA <= 0 && _ArgB >= 0) || (_ArgA >= 0 && _ArgB <= 0)) {
// exact, monotonic, bounded, determinate, and (for _ArgA == _ArgB == 0) consistent:
return _ArgT * _ArgB + (1 - _ArgT) * _ArgA;
@GioBonvi
GioBonvi / fsct.py
Created September 6, 2019 09:44
A simple tool to decode, verify or generate a signed Flask session cookie. Useful during CTFs.
#!/usr/bin/env python3
# encoding: utf-8
"""
Flask session cookie toolkit.
Decode, verify or generate a signed Flask session cookie.
Credits to Terry Vogelsang for the original script (https://terryvogelsang.tech/MITRECTF2018-my-flask-app/)
which I just slightly modified for my personal use.
@severak
severak / sotds.go
Last active January 29, 2026 20:02
generates songs of the day
package main
import (
"database/sql"
"fmt"
"flag"
"os"
"log"
"runtime"
"html/template"
@gombru
gombru / FocalLoss.py
Last active August 5, 2024 20:28
Caffe Python layer Focal Loss implementation (From Focal Loss for Dense Object Detection, Facebook paper)
import caffe
import numpy as np
import json
class FocalLoss(caffe.Layer):
"""
Compute Focal Loss
Inspired by https://arxiv.org/abs/1708.02002
Raul Gomez Bruballa
https://gombru.github.io/
Basic
=====
[Shift]+[Mod]+[Enter] - launch terminal.
[Mod]+[b] - show/hide bar.
[Mod]+[p] - dmenu for running programs like the x-www-browser.
[Mod]+[Enter] - push acive window from stack to master, or pulls last used window from stack onto master.
[Mod] + [j / k] - focus on next/previous window in current tag.