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
var _ = require("underscore"); | |
var f = function () { | |
console.log(JSON.stringify(_.toArray(arguments))); | |
} | |
f.apply(null, [1,2,3]); | |
var h =Function.prototype.bind.apply(f, [null, 1,2,3]) |
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
var express = require("express"), | |
server = express.createServer(), | |
fn_sharedmem = require("../lib/fn_sharedmem"), | |
_ = require("underscore"), | |
jade = require("jade"); | |
server.use(express.bodyParser()); | |
server.use(express.cookieParser()); | |
server.get("/", function (req, res) { |
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
MODULE=hello | |
LIBS= | |
INCLUDES= | |
CCX_FLAGS=-g -fPIC -DPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include/ -I/usr/include/node $(INCLUDES) | |
LINK_FLAGS=-shared -L/usr/lib $(LIBS) | |
all: $(MODULE).node |
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
node-waf clean build -v 2>&1 | grep runner | head -n 1 | cut -d ' ' -f 6- | python -c "import sys; print(' '.join([x.strip('\'') for x in sys.stdin.readline().split(', ')]).replace('[\'','').replace(']\'', ''))" |
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
for F in $(ldd Demo/chipmunk_demos| awk '{ print $1 }'); do readelf -Ws /usr/lib/$F | grep gluUnProject; if [ $? -eq 0 ]; then echo $F; fi; done |
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
This gist will host random code listings for blogger posts. |
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 curses | |
from curses import KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT | |
MAP = [ | |
'#### ####', | |
'# #### #', | |
'# #', | |
'## ##', |
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/python2 | |
import warnings | |
warnings.simplefilter('ignore', DeprecationWarning) | |
import httplib2, urllib, time | |
from urllib import urlencode | |
try: | |
import json | |
except ImportError: |
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 ruby | |
def usage(stdout = false) | |
stream = stdout ? $stdout : $stderr | |
bin = File.basename($0) | |
indent = " " * (bin.length() + "Usage: ".length()) | |
stream.puts("Usage: #{bin} [--help|-h]") | |
stream.puts(indent + " [--yes|--no|--maybe]") |
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 ruby | |
def usage(stdout = false) | |
stream = stdout ? $stdout : $stderr | |
bin = File.basename($0) | |
indent = " " * (bin.length() + "Usage: ".length()) | |
stream.puts("Usage: #{bin} [--help|-h]") | |
stream.puts(indent + " [--vertical]") |