Skip to content

Instantly share code, notes, and snippets.

View sabey's full-sized avatar
🐧

Jackson Sabey sabey

🐧
  • Vancouver
View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active May 6, 2025 16:18
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
@henrik242
henrik242 / airtag-to-gpx-sync.sh
Last active April 19, 2025 20:26
Read AirTag data from the FindMy.app cache and convert to GPX
#!/usr/bin/env bash
#
# Reads AirTag data from the FindMy.app cache and converts it to a daily GPX file
#
# Rsyncs the data to a web accessible folder that can be displayed with e.g.
# https://gist.github.com/henrik242/84ad80dd2170385fe819df1d40224cc4
#
# This should typically be run as a cron job
#
@IanColdwater
IanColdwater / twittermute.txt
Last active April 14, 2025 16:31
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@andrewkdinh
andrewkdinh / motion-photos.sh
Last active February 21, 2021 17:39
Extract and/or remove videos from MVIMG
#!/bin/bash
# https://stackoverflow.com/questions/53104989/how-to-extract-the-photo-video-component-of-a-mvimg
# extract videos
for i in MVIMG*.jpg; do \
ofs=$(grep -F --byte-offset --only-matching --text ftypmp4 "$i"); \
ofs=${ofs%:*}; \
[[ $ofs ]] && dd "if=$i" "of=${i%.jpg}.mp4" bs=$((ofs-4)) skip=1; \
echo "Extracted video from $i"
done
@smithclay
smithclay / index.js
Created June 16, 2017 18:30
"Hello World" AWS Lambda + Terraform Example
// 'Hello World' nodejs6.10 runtime AWS Lambda function
exports.handler = (event, context, callback) => {
console.log('Hello, logs!');
callback(null, 'great success');
}
@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@guregu
guregu / tiled.go
Last active October 14, 2015 22:42
engi + tiled
package tiled
import (
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"github.com/guregu/eng"
@terrorbyte
terrorbyte / rot.py
Created December 15, 2013 00:41
Classic ROT substitution cipher in python, with a twist. Supports ROT13, ROT47, ROT 0x8000 (UTF-8 version), ROT 0x80000 (UTF-16), and Frobnicate (XOR with 42 used in Linux memfrob).
#!/bin/env python
import argparse
#bin(ord(u'联'))
#chr(0b1000000001010100)
#bin(ord(u'联') ^ 0x8000)
#bin(ord(u'T') ^ 0x8000)
#Frobnicate a string
def frobnicate(s):
@bgentry
bgentry / lock.go
Last active December 13, 2022 08:51
Redis locking in Go with redigo #golang
package main
import (
"github.com/garyburd/redigo/redis"
)
var ErrLockMismatch = errors.New("key is locked with a different secret")
const lockScript = `
local v = redis.call("GET", KEYS[1])