Skip to content

Instantly share code, notes, and snippets.

View bigeasy's full-sized avatar

Alan Gutierrez bigeasy

  • New Orleans, LA
View GitHub Profile
@bigeasy
bigeasy / foo.sh
Created June 12, 2012 02:20
performance of http_simple.js
PORT=6000 /tmp/node-v0.6 benchmark/http_simple.js &
pid=$!
sleep 1
for i in {0..2}; do
ab -t 30 -c 100 http://127.0.0.1:6000/bytes/123 2>/dev/null | grep Req
done
kill $pid
sleep 60
@bigeasy
bigeasy / .bash_profile
Created June 27, 2012 17:44
hidegrep
# Add to your `.bash_profile`. If you do something that is incredibly
# destructive, like `git push --force origin HEAD`, you can then
# delete it, how ever many times you've run it, from your history
# using `hidegrep --force`.
function hidegrep()
{
while true; do
hist=$(history | grep -e "$1" | head -n 1)
if [ -z "$hist" ]; then break; fi
@bigeasy
bigeasy / README.md
Created July 9, 2012 22:11
Open Source Contribution Policy
We couldn’t find that file to show.
@bigeasy
bigeasy / partial.js
Created July 16, 2012 19:08
Load and Specialize
var tz = require('timezone');
var loaded = tz(require('timezone/fr_FR'), require('timezone/America/Detroit'));
var fr = loaded('America/Detroit', 'fr_FR');
console.log(fr('*', '%c'));
@bigeasy
bigeasy / decode.js
Created August 1, 2012 05:07
Decode XHR Send as UTF8
var fs = require('fs');
var file = new Buffer(fs.readFileSync('shapefile-filereader.zip', 'utf8'), 'binary');
console.log(file.length)
fs.writeFileSync('out.zip', file);
@bigeasy
bigeasy / gist:3267134
Created August 5, 2012 21:10
CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
include(BundleUtilities)
project(synapse)
if (UNIX)
set(gecko_defs "-DXP_UNIX")
if(APPLE)
set(gecko_defs "${gecko_defs} -DXP_MACOSX")
endif()
@bigeasy
bigeasy / rere.js
Created October 4, 2012 15:35
JavaScript regular expression to match regular expression special characters.
const REGEX = new RegExp('(\\' + '/ . * + ? | ( ) [ ] { } \\'.split(' ').join('|\\') + ')', 'g');
@bigeasy
bigeasy / README.md
Created October 9, 2012 05:42
US Median Age by County

US Median Age by County

A display of US median age by county using the census.ide.org API.

@bigeasy
bigeasy / javascript.vim.patch
Created October 17, 2012 00:07
Multi-line string syntax highlighting for Vim.
--- /usr/share/vim/vim73/syntax/javascript.vim 2012-10-16 19:57:21.000000000 -0400
+++ javascript.vim 2012-10-16 19:56:57.000000000 -0400
@@ -34,8 +34,8 @@
syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo
syn match javaScriptSpecial "\\\d\d\d\|\\."
-syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"\|\\\n+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc
-syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'\|\\\n+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc
+syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc
+syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc
@bigeasy
bigeasy / Output on Fedora 16
Created November 4, 2012 05:41
Node.js Millisecond Timeout
[ [ 0, 1859987 ], [ 0, 1678600 ], [ 0, 1074869 ], [ 0, 1100038 ] ]
[ [ 0, 2997281 ], [ 0, 2231579 ], [ 0, 2200601 ], [ 0, 3107400 ] ]
[ [ 0, 2925 ], [ 0, 2907 ], [ 0, 2910 ], [ 0, 2860 ] ]
[ [ 0, 2869 ], [ 0, 2895 ], [ 0, 2800 ], [ 0, 2851 ] ]
[ [ 0, 1425 ], [ 0, 1925 ], [ 0, 1858 ], [ 0, 1383 ] ]