Skip to content

Instantly share code, notes, and snippets.

View tdegrunt's full-sized avatar

Tom de Grunt tdegrunt

View GitHub Profile
function upload (req, res) {
var Formidable = require('formidable'),
form = new Formidable.IncomingForm();
form.encoding = 'utf-8';
form.onPart = function (part) {
if (!part.filename) {
form.handlePart(part);
} else {
(function () {

IMPORTANT! Wikified version of this page may be found here. Feel free to edit. :)

Note that since it's kind of PITA to merge changes from other gists it's recommended that you do your changes directly to the wiki!

Game Engines

Name Latest Release Size (KB) License Type Unit Tests Docs Notes
Akihabara 1.3 GPL2/MIT Classic Repro Intended for making classic arcade-style games in JS+HTML5 3
Aves Commercial? Obsolete. Company bought by Zynga.
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script src="http://yandex.st/raphael/1.5.2/raphael.min.js"></script>
<script>
/**
* A Simple Vector Shape Drawing App with RaphaelJS and jQuery
* copyright 2010 Kayla Rose Martin - Licensed under the MIT license
* Inspired by http://stackoverflow.com/questions/3582344/draw-a-connection-line-in-raphaeljs
**/
@tdegrunt
tdegrunt / formhelper.coffee
Created May 24, 2011 19:28 — forked from janmonschke/formhelper.coffee
Simple FormHelper that works well with Backbone.js Models
###
Helps creating and submitting forms
- easy labeling
- automatically inserts values of the model to the form
- is able to serialize forms to JSON
- can submit the form to the server
- automatically displays errors if there are any
###
class FormHelper
@tdegrunt
tdegrunt / app.coffee
Created August 1, 2011 20:56 — forked from victusfate/app.coffee
express/coffeescript
# load libraries
require 'coffee-script'
mongoose = require 'mongoose'
express = require 'express'
step = require "step"
# about oauth
OAuth = require('oauth').OAuth
oauth = new OAuth(
'https://api.twitter.com/oauth/request_token',
@tdegrunt
tdegrunt / gameengines.md
Created August 2, 2011 14:10 — forked from bebraw/gameengines.md
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version.

Name Latest Release Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 1.3.1 (2011/05) 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
Aves Commer-cial Obsolete. Company bought by Zynga. E3 2010 Aves Engine Prototype "Suburban World"
bdge github Badly Design Game Engine, an HTML5 Javascript game engine [Demo](h
@tdegrunt
tdegrunt / nodejs-aws-example.js
Created August 9, 2011 08:25 — forked from juno/nodejs-aws-example.js
AWS EC2 access example w/nodejs, express, aws-lib
var app = require('express').createServer();
var aws = require('aws-lib');
var access_key_id = '***';
var secret_access_key = '***';
var endpoint = 'ec2.ap-southeast-1.amazonaws.com'; // ap-southeast-1
var ec2 = aws.createEC2Client(access_key_id, secret_access_key, {host: endpoint});
app.get('/', function(req, res) {
console.log('/');
@tdegrunt
tdegrunt / es5-iso8601.coffee
Created December 1, 2011 21:42
JavaScript and CoffeeScript polyfills for manipulating ISO 8601 date time strings
if isNaN Date.parse "2011-01-01T12:00:00-05:00"
Date.parse = ((parse) ->
# The date time string format as specified by ES 5.1 section 15.9.1.15.
pattern = ///^
(\d{4}) # Year
(?:-(\d{2}) # Optional month
(?:-(\d{2}) # Optional date
(?: # Optional time component
T(\d{2}) # Hours
:(\d{2}) # Minutes
@tdegrunt
tdegrunt / gist:1605311
Created January 13, 2012 09:43 — forked from tvandervossen/gist:1605091
Deployment to S3 with CloudFront invalidation using s3cmd 1.1 beta
Sync local-public-dir to bucket-name on S3 and invalidate changed files on CloudFront:
$ ./bin/s3cmd-1.1.0-beta1/s3cmd -c s3.config sync local-public-dir/ s3://bucket-name/ --acl-public --cf-invalidate --rexclude '.svn' --rexclude '.DS_Store'
You can create s3.config with:
$ s3cmd --configure
I keep my s3.config on an encrypted disk image which I mount manually when needed.