This file contains hidden or 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 jmp { cd -P "$JMP_PATH/$1" 2>/dev/null || echo Not found; } | |
function setjmp { ln -s "`pwd`" "$JMP_PATH/$1"; } | |
function deljmp { rm -i "$JMP_PATH/$1"; } | |
export JMP_PATH="$HOME/.jmp" |
This file contains hidden or 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 os | |
import sys | |
import io | |
import tarfile | |
import urllib.request | |
ARCHIVE_URL = 'http://d.pr/f/YqS5+' | |
This file contains hidden or 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
# Tests for antialiasing a high-frequency image in various ways | |
# Nathan Reed, July 2014 | |
# Written for Python 3.4; requires numpy and Pillow to be installed | |
import concurrent.futures | |
import math | |
import multiprocessing | |
import numpy as np | |
import optparse | |
import random |
This file contains hidden or 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
Collection of oneliner music formulas. Version 2011-10-18 | |
I've tried to collect all the formulas in the related threads etc. | |
(excluding those that clearly sound like random first experiments or total | |
crap; when several variants are available, i've chosen the shortest one) | |
If you think I've missed something that should be here, please let me know. | |
====== 1ST ITERATION ====== |
This file contains hidden or 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 load(images, done) { | |
var toLoad = images.length | |
var res = Array(toLoad) | |
var loaded = 0 | |
images.forEach(function (url, i) { | |
var image = new Image | |
image.onload = function () { | |
res[i] = this | |
if (++loaded == toLoad) |
This file contains hidden or 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
macro _sin { | |
case { _($x:lit) } => | |
{ | |
var res = Math.sin(unwrapSyntax(#{ $x })) | |
return [makeValue(res, #{ $x })] | |
} | |
case { _($x) } => | |
{ | |
return #{ Math.sin($x) } |
This file contains hidden or 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 foo() { | |
this.a = function () { return 96 } | |
this.b = function () { return this.a() * 10101 } | |
} | |
function bar() {} | |
bar.prototype = new foo | |
b = new bar | |
b.a() // 96 |
This file contains hidden or 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
# _ = empty | |
# X = solid ground | |
# S = sand | |
_________________ | |
_____SSSSSS______ | |
___SSSXXXXSSS____ | |
____SSSXXXXSSS___ | |
______SSSSSS_____ |
This file contains hidden or 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 | |
last_non_blank_ln=$(grep -En ^. $1 |tail -n 1 |sed 's/:.*//') | |
head -n $((last_non_blank_ln + 1)) $1 > _xxx | |
mv _xxx $1 |
This file contains hidden or 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
(box2d-html5) -> git commit | |
[master e170981] There are two sides to every issue: one side is right and the other is wrong, but the middle is always evil. | |
120 files changed, 125 insertions(+), 125 deletions(-) | |
rename contrib/{Enhancements/Controllers/b2BuoyancyController.js => enhancements/controllers/buoyancycontroller.js} (100%) | |
rename contrib/{Enhancements/Controllers/b2ConstantAccelController.js => enhancements/controllers/constantaccelcontroller.js} (100%) | |
rename contrib/{Enhancements/Controllers/b2ConstantForceController.js => enhancements/controllers/constantforcecontroller.js} (100%) | |
rename contrib/{Enhancements/Controllers/b2Controller.js => enhancements/controllers/controller.js} (100%) | |
rename contrib/{Enhancements/Controllers/b2GravityController.js => enhancements/controllers/gravitycontroller.js} (100%) | |
rename contrib/{Enhancements/Controllers/b2TensorDampingController.js => enhancements/controllers/tensordampingcontroller.js} (100%) | |
rewrite contrib/paths.json (99%) |