Skip to content

Instantly share code, notes, and snippets.

View nickdesaulniers's full-sized avatar

Nick Desaulniers (paternity leave) nickdesaulniers

View GitHub Profile
@rcmachado
rcmachado / html5.vim
Created December 15, 2009 10:35
Vim syntax file for HTML 5
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <rcmachado@gmail.com>
" URL: http://gist.github.com/256840
" Last Change: 2010 Aug 26
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
#!/usr/bin/perl
######################################################################
#
# File : split_bootimg.pl
# Author(s) : William Enck <enck@cse.psu.edu>
# Description : Split appart an Android boot image created
# with mkbootimg. The format can be found in
# android-src/system/core/mkbootimg/bootimg.h
#
# Thanks to alansj on xda-developers.com for
@davidnunez
davidnunez / gist:1404789
Created November 29, 2011 13:20
list all installed packages in android adb shell
pm list packages -f
@maxcountryman
maxcountryman / bf.c
Created January 29, 2012 17:20
A simple brainfuck interpreter in C
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// initialize the tape with 30,000 zeroes
unsigned char tape[30000] = {0};
// set the pointer to point at the left-most cell of the tape
unsigned char* ptr = tape;
@nathanhammond
nathanhammond / Emscripten OS X.md
Created March 4, 2012 21:48
How to get Emscripten running on OS X.

Running emscripten on OS X

There are a number of additional dependencies required for getting things installed on OS X. Starting with a blank slate OS X machine, this is the process it takes:

# Install Xcode Command Line Tools

# Install Homebrew
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
@cuppster
cuppster / node-express-cors-middleware.js
Created April 9, 2012 16:02
express.js middleware to support CORS pre-flight requests
app.use(express.methodOverride());
// ## CORS middleware
//
// see: http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
@potch
potch / mozApp.js
Created May 3, 2012 16:22
simple open web app lib
// manage a webapp.
// place <link rel="app-manifest" href="path-to-manifest.webapp"> in your <head>
// mozApp.install() attempts installation
// mozApp.uninstall() removes
// mozApp.isRunning() indicates whether the app is currently installed and open
var mozApp = (function() {
var manLink = document.querySelector('link[rel="app-manifest"]'),
manifestURL = manLink.href;
var self = false;
@TooTallNate
TooTallNate / node_pointer.h
Last active April 7, 2016 02:03
C helper functions for wrapping and unwrapping Node Buffer instances as "pointers"
/*
* Helper functions for treating node Buffer instances as C "pointers".
*/
#include "v8.h"
#include "node_buffer.h"
/*
* Called when the "pointer" is garbage collected.