Skip to content

Instantly share code, notes, and snippets.

View tripplyons's full-sized avatar

Tripp Lyons tripplyons

View GitHub Profile
# https://www.gavalas.dev/blog/spigot-algorithms-for-pi-in-python/
def gospers_pi_unproven():
q,r,t,i = 1, 180, 60, 2
while True:
u,y = 3*(3*i+1)*(3*i+2), (q*(27*i-12)+5*r)//(5*t)
yield y
q,r,t,i = 10*q*i*(2*i-1),10*u*(q*(5*i-2)+r-y*t),t*u,i+1
@tripplyons
tripplyons / run-searx.sh
Last active September 26, 2025 14:32
Free web search MCP using a local SearXNG instance
mkdir -p config data
cat > config/settings.yml << 'EOF'
server:
bind_address: "0.0.0.0"
secret_key: "secret"
search:
formats:
- html
- json
EOF
@tripplyons
tripplyons / rwkv-7.py
Created January 16, 2025 16:27
Parallel and serial JAX implementations of the RWKV-7 recurrence
import jax
import jax.numpy as jnp
def associative_op(left, right):
left_wab, left_vk = left
right_wab, right_vk = right
new_wab = jnp.matmul(left_wab, right_wab)
new_vk = jnp.matmul(left_vk, right_wab) + right_vk
return new_wab, new_vk

Keybase proof

I hereby claim:

  • I am tripplyons on github.
  • I am tripplyons (https://keybase.io/tripplyons) on keybase.
  • I have a public key ASA5KtyJ1Fc2DNtvxpgYx3KDt-BNycFwToVVYted1zBm0Ao

To claim this, I am signing this object:

@tripplyons
tripplyons / handy.py
Created May 16, 2017 21:01 — forked from rainyear/handy.py
Hand posture detection with OpenCV.
#!/usr/bin/env python
import cv2
import numpy as np
def main():
cap = cv2.VideoCapture(0)
while(cap.isOpened()):
ret, img = cap.read()
skinMask = HSVBin(img)
@tripplyons
tripplyons / index.html
Created May 1, 2017 20:38
Stupid Timer
<div id="card"></div>
start = exps:(expr+) {
return exps.join('')
}
call = first:((func:function) / (identifier:id)) "(" exp:expr? ")" {
return first + "(" + exp + ")"
}
id = chars:([a-zA-Z]+) {
return chars.join('')
}
def = "#" identifier:id {
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
function hex (c) {
var s = "0123456789abcdef";
var i = parseInt (c);
if (i == 0 || isNaN (c))
return "00";
i = Math.round (Math.min (Math.max (0, i), 255));
return s.charAt ((i - i % 16) / 16) + s.charAt (i % 16);
}
/* Convert an RGB triplet to a hex string */
@tripplyons
tripplyons / config.json
Created March 25, 2016 18:13
Bootstrap Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#ffc107",
"@brand-success": "#8bc34a",