This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# when loading a save, you'd use this to simulate time since last save | |
# EventManager.simulate_time_span(LAST_UNIX_TIMESTAMP, THIS_UNIX_TIMESTAMP) | |
# for example, this will simulate the last 30 seconds before the game opened | |
# EventManager.simulate_time_span(OS.get_unix_time() - 30, OS.get_unix_time()) | |
# there is an optional third argument to that that specifies a minimum priority | |
# EventManager.simulate_time_span(LAST_UNIX_TIMESTAMP, THIS_UNIX_TIMESTAMP, Priority.UNSKIPPABLE) | |
# .. will only run unskippable events | |
# if the third argument is not specified, both skippable and unskippable events are run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
import java.util.Comparator; | |
import java.util.Collections; | |
int index = 0; | |
PImage pokemon, current; | |
PGraphics pie; | |
HashMap<Integer,Integer> colorMap; | |
ArrayList<Integer> colorByCount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// writing | |
var o = new MetaView(); | |
o.writeInt16(-128); | |
o.writeUint16(128); | |
o.writeFloat32(3.141592); | |
o.writeFloat32([1.5, 1.5]); | |
o.writeUTF8String("räksmörgås"); | |
// saving | |
var s = o.finalize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from quarrel import Quarrel | |
@Quarrel("multiply", int, int) | |
@Quarrel("multiply", int) | |
def multiply_int(a, b = 2): | |
print(a * b) | |
@Quarrel("greet", str) | |
def greet(name): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// only semi-golfed, mostly because i was in the headspace; only used for debugging | |
var w, h, x, y, m=maze(w=16,h=16), g=[]; | |
// generate fully walled grid | |
for(y = 0; y < h * 2 + 1; y ++) { | |
g[y]=[] | |
for(x = 0; x < w * 2 + 1; x ++) | |
g[y].push(!(y&1)?"#":!(x&1)?"#":" "); | |
} |
NewerOlder