Skip to content

Instantly share code, notes, and snippets.

@tokenbender
tokenbender / train_modal_standalone.py
Last active July 18, 2025 13:33
standalone serverless simple character level transformer
import os
import sys
import time
import math
import pickle
from contextlib import nullcontext
from pathlib import Path
import subprocess
from dataclasses import dataclass
import inspect
@willccbb
willccbb / grpo_demo.py
Last active July 18, 2025 11:36
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
@rain-1
rain-1 / LLM.md
Last active July 10, 2025 04:43
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@chriseidhof
chriseidhof / Routing.swift
Last active May 13, 2018 06:06 — forked from gonzalonunez/Routing.swift
Routing Problem
import Foundation
struct Handler {
let handleJSON: (Data) throws -> Void
init<T: Decodable>(handler: @escaping (T) -> Void) {
handleJSON = { data in
let object = try JSONDecoder().decode(T.self, from: data)
handler(object)
}
@makeev
makeev / create_pkcs7_sign.py
Created March 28, 2016 13:25
Creating a PKCS #7 detached signature of the manifest file for safari push package in python
import M2Crypto
def main():
manifest_path = 'path/to/manifest.json'
signature_path = 'path/to/signature'
# to convert .cer to .pem
# openssl x509 -inform der -in certificate.cer -out certificate.pem
# to combine certificate and key
# cat PushChatCert.pem PushChatKey.pem > ck.pem
@andymatuschak
andymatuschak / CollectionViewDataSource.swift
Last active February 12, 2021 09:44
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
@jk
jk / generate_passkit_manifest.sh
Created June 28, 2012 09:27
Generate PassKit manifest.json
echo "{"`find . -type f -exec shasum {} + | sed 's/\.\///g' | awk '{print "\t\"" $2 "\" : \"" $1 "\","}' | grep -v -E "(\.DS_Store|manifest\.json)"`"}" | sed 's/\,}/}/g' | python -mjson.tool > manifest.json