Skip to content

Instantly share code, notes, and snippets.

@JySzE
JySzE / mpv.conf
Last active May 22, 2025 12:03
JySzE MacOS MPV Config [ No longer maintained ]
# MacOS Version 1.1
# 03/09/2025
# Requires MPV v0.38.0 or newer
###############################################################################################################################################
# Player GUI Options
###############################################################################################################################################
@tekknolagi
tekknolagi / lines.py
Last active September 10, 2024 20:03
#!/usr/bin/env python
import multiprocessing
import random
import time
class Logger:
def __init__(self, num_lines, last_output_per_process, terminal_lock):
self.num_lines = num_lines
@monosoul
monosoul / TracingUtils.kt
Created March 27, 2023 11:18
DataDog Tracing utils for Kotlin coroutines
import datadog.trace.api.DDTags
import io.opentracing.Span
import io.opentracing.Tracer
import io.opentracing.log.Fields
import io.opentracing.tag.Tags
import io.opentracing.util.GlobalTracer
suspend fun <T : Any, O> T.coRunTraced(
methodName: String,
block: suspend T.(Span) -> O,
@lemmy
lemmy / Qsort.tla
Created June 12, 2021 03:06
A toy program to sort characters with QuickSort (implemented" in TLA+)
$ ./pluspy -s modules/other/Qsort.tla
Enter input: poiuylkjhmnbvcdsxzafgtrewq
abcdefghijklmnopqrstuvwxyz
----------------------------- MODULE Qsort -----------------------------
EXTENDS Naturals, Sequences, FiniteSets, TLC, Input
\* Specification (works reasonably well for sets of cardinality <= 6
\* Takes a set as argument, produces a sorted tuple
Sort(S) == CHOOSE s \in [ 1..Cardinality(S) -> S]:
@slaiyer
slaiyer / hilbert.py
Created May 6, 2021 17:21
Hilbert curve
#!/usr/bin/env python3
import argparse
from turtle import *
def hilbert_curve(step, parity, n):
if n < 1:
return
@mjf
mjf / Postgres.md
Last active May 23, 2025 11:02
Postgres

⚠️ WARNING
The ordering of listed projects or documents is random and has no connection to relevance or maturity levels!

Postgres

Extensions

Extension Description
pgaudit Postgres auditing extension
@xandout
xandout / README.md
Last active October 17, 2024 07:54
Kubernetes DaemonSet that enables a direct shell on each Node using SSH to localhost

Getting a shell on each node

I run several K8S cluster on EKS and by default do not setup inbound SSH to the nodes. Sometimes I need to get into each node to check things or run a one-off tool.

Rather than update my terraform, rebuild the launch templates and redeploy brand new nodes, I decided to use kubernetes to access each node directly.

Alternative option

https://github.com/alexei-led/nsenter

@wudi
wudi / dynamic_router.go
Last active February 8, 2023 16:53
Dynamic Router for Gin
package main
import (
"net/http"
"sync"
"time"
"github.com/gin-gonic/gin"
)