View proc_example.coffee
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
# Example code adapted from http://processingjs.org/learning | |
delay = 10 | |
X = width / 2 | |
Y = height / 2 | |
# Setup the Processing Canvas | |
setup = -> | |
strokeWeight( 10 ) | |
View getattr_sub.py
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
def getattr_sub(obj, attrs, default='__default__'): | |
""" | |
>>> getattr_sub(int, '__class__.__name__', None) | |
'type' | |
>>> getattr_sub(int, '__cleese__.__name__', 'missing') | |
'missing' | |
""" | |
if type(attrs) == str: | |
attrs = attrs.split('.') | |
View simple_sprites.py
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
#!/usr/bin/env python | |
import os, sys | |
import subprocess | |
import Image | |
from collections import namedtuple | |
min_css = lambda (s): s.replace(" ", "").replace("\n", "") + "\n" |
View vimrc
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
"" zi : toggle folding | |
"" | |
call pathogen#runtime_append_all_bundles() | |
set spl=en spell | |
set tag=/home/koloss/workspace/tags | |
set ruler | |
set number | |
set wrap | |
set tabstop=4 |
View gorun.sh
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
#!/usr/bin/env bash | |
if [ "$1" ]; then | |
$GOBIN/gofmt -w -s=true $1 | |
$GOBIN/gofix $1 | |
$GOBIN/6g -o $1.6 $1 | |
$GOBIN/6l -o $1.bin $1.6 | |
$PWD/$1.bin | |
fi |
View defer.js
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
// Adapted mostly from https://github.com/unscriptable/promises/blob/master/src/Tiny.js | |
// There are a few major problems with this promise that keep it from | |
// being useful outside of a constrained environment: | |
// 1. It modifies it's own public API: | |
// The then(), resolve(), and reject() methods are rewritten when the promise | |
// is completed (i.e. resolved or rejected). There's nothing inherently wrong | |
// with this unless some other code is overriding or hijacking the public | |
// methods (in which case, they'd be overriding the obsolete methods). | |
// 2. It doesn't distinguish between the "front end" API and the "back end" API: | |
// If some other code decided to call our reject() method, it could. We would |
View youtube_transcribe.py
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import sys | |
import os.path | |
import HTMLParser | |
from xml.sax.saxutils import unescape | |
from xml.dom import pulldom |
View unicode_test.txt
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
イërnâ七iônàنلzætiøn |
View KSON.js
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
/* KSON: Keyless Schemafied Object Notation | |
* | |
* Version: 0.1 Alpha | |
* | |
* A serialization format with two goals in mind: | |
* 1. Easily parsable using minimal javascript. | |
* 2. Reduce serialized size compared to JSON. | |
* | |
* 1. is accomplished by using the (comparativly fast) JSON parse/stringify | |
* functions, thus reducing the task of KSON to packing/unpacking the values |
View filepaths.py
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 os | |
def filepaths(rootdir, ext_filter=None): | |
if isinstance(ext_filter, basestring): | |
_filter = lambda p: p.endswith(ext_filter) | |
elif isinstance(ext_filter, tuple): | |
_filter = lambda p: os.path.splitext(p)[1] in ext_filter | |
else: | |
_filter = ext_filter |
OlderNewer