Skip to content

Instantly share code, notes, and snippets.

@need12648430
need12648430 / PokéPie
Created August 30, 2014 04:50
PokéPieChart, now with 200% more comments
import java.util.Map;
import java.util.Comparator;
import java.util.Collections;
int index = 0;
// sprite sheet
PImage pokemon;
// current pokemon sprite
PImage current;
// current pie chart
@need12648430
need12648430 / send_sms_get_example.php
Last active July 11, 2021 11:32
Tiny SMS Gate Examples
<?php
// just for the record
$phone_ip = "10.0.0.2";
$phone_port = 8080;
$phone_page = "/send";
// to be clear, this is set in the app preferences
// you can turn off password protection, but i wouldn't suggest it
$tinysmsgate_password = "password";
@need12648430
need12648430 / build-templates.sh
Last active June 2, 2022 03:27
A script to build Godot export templates.
#!/bin/bash
export EMSCRIPTEN_ROOT=[path containing em++, emsdk-portable/emscripten/*]
export ANDROID_HOME=[path to android sdk, usually /home/*/Android/Sdk]
export ANDROID_NDK_ROOT=[path to android ndk, likely $ANDROID_HOME/ndk-bundle]
X11_DEBUG=false
X11_RELEASE=false
WIN_DEBUG=false
WIN_RELEASE=false
@need12648430
need12648430 / name.js
Last active December 30, 2022 17:45
Pronounceable Seeded Name Generator
function name (id, l) {
function n(){return id=(399*id)%509}
var r="BDGKNPTVZ"[n()%9]
for (var i=1;i<l;i++) r+=i%2?"aeiou"[n()%5]:"bdgknptvz"[n()%9]
return r
};
// id=seed, l=length
function name (id, l) {
// lcg prng
@need12648430
need12648430 / l-system.scd
Created October 14, 2019 07:40
L-System in SuperCollider
// Instrument
(
SynthDef(\sine, {
arg freq = 440, amp = 0.5;
Out.ar(0, SinOsc.ar(freq, 0.0, amp * EnvGen.kr(Env.perc(0.01, 0.25), doneAction: 2)) ! 2);
}).add;
)
// Basic Stochastic L-System
(