Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
# | |
# A C Parser using the Parslet library. | |
# | |
# ANSI C Grammar: | |
# | |
# * http://www.lysator.liu.se/c/ANSI-C-grammar-l.html | |
# * http://www.lysator.liu.se/c/ANSI-C-grammar-y.html | |
# | |
require 'parslet' |
#include <stdio.h> | |
static int SEED = 0; | |
static int hash[] = {208,34,231,213,32,248,233,56,161,78,24,140,71,48,140,254,245,255,247,247,40, | |
185,248,251,245,28,124,204,204,76,36,1,107,28,234,163,202,224,245,128,167,204, | |
9,92,217,54,239,174,173,102,193,189,190,121,100,108,167,44,43,77,180,204,8,81, | |
70,223,11,38,24,254,210,210,177,32,81,195,243,125,8,169,112,32,97,53,195,13, | |
203,9,47,104,125,117,114,124,165,203,181,235,193,206,70,180,174,0,167,181,41, | |
164,30,116,127,198,245,146,87,224,149,206,57,4,192,210,65,210,129,240,178,105, |
/* from valgrind tests */ | |
/* ================ sha1.c ================ */ | |
/* | |
SHA-1 in C | |
By Steve Reid <[email protected]> | |
100% Public Domain | |
Test Vectors (from FIPS PUB 180-1) |
tim@2540p:~/luanode$ ab -n 20000 -c 100 http://127.0.0.1:8080/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient) | |
Completed 2000 requests | |
Completed 4000 requests | |
Completed 6000 requests | |
Completed 8000 requests |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
function str_repeat(i, m) { | |
for (var o = []; m > 0; o[--m] = i); | |
return o.join(''); | |
} | |
function sprintf() { | |
var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = ''; | |
while (f) { | |
if (m = /^[^\x25]+/.exec(f)) { | |
o.push(m[0]); |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
/** | |
* Enable route to __noSuchMethod__ when unknown method calling. | |
* | |
* @param {Object} obj Target object. | |
* @return {Object} | |
*/ | |
function enableMethodMissing(obj) { | |
var functionHandler = createBaseHandler({}); | |
functionHandler.get = function(receiver, name) { |
// Yeah, global variables suck, but it's kind of a necessary evil here | |
AudioUnit *audioUnit = NULL; | |
float *convertedSampleBuffer = NULL; | |
int initAudioSession() { | |
audioUnit = (AudioUnit*)malloc(sizeof(AudioUnit)); | |
if(AudioSessionInitialize(NULL, NULL, NULL, NULL) != noErr) { | |
return 1; | |
} |