Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.min.js"></script>
<style>
body { margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background: #1a1a1a; }
button { margin: 5px; padding: 8px 16px; background: #333; color: white; border: none; cursor: pointer; }
button:hover { background: #444; }
#controls { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); }
</style>
#%% <- this is vscode stuff, this will run on the command line but plots might come out weird
import numpy as np
u32 = np.uint32
i32 = np.int32
def golden_ratio_sequence(i: u32) -> u32:
return u32(i) * u32(2654435769) # 0.614... in 0.32 fixed point
def reverse_bits32(x: u32) -> u32:
x = u32(x)
@graemephi
graemephi / katex.js
Last active December 30, 2021 14:26
const katex = require('katex');
const assert = require('assert').ok;
let inline = {
throwOnError: false,
displayMode: false,
output: 'html'
};
let display = {
@graemephi
graemephi / tags.lua
Created September 14, 2019 09:31
SM divisions as Etterna tags
return {
playerTags = {
["1.0"] = {
["Xeb4929a4eb3853fc83d697ea26e84bd975287a3c"] = 1,
["Xfb7680d6e93f66c121cf731e9e3b92a757c36ea2"] = 1,
["Xf686c11495ebc7d9001e94ef301e572ea8f48702"] = 1,
["Xaba01b647d8557875ccdcb40223d69c91363c97d"] = 1,
["X894c41ae059aeef84c5cc00ffe3519be7740583f"] = 1,
["X1578af947c1e045f2d3af8efb7a813c7feb0df2f"] = 1,
["X3383369dbf15282b0a1fd658d128c518b8433e41"] = 1,
#include <stdio.h>
#include <stdbool.h>
typedef struct TripleIterator
{
int iterations;
int x, y, z;
} TripleIterator;
bool next_triple(TripleIterator *it)