Skip to content

Instantly share code, notes, and snippets.

@mauricemach
mauricemach / gist:1376601
Created November 18, 2011 14:33
git config
git config --global user.name foo
git config --global user.email [email protected]
git config --global color.ui auto
@mauricemach
mauricemach / gameengines.md
Created October 18, 2011 02:04 — 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.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out these pages: [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]].

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"](http://www.
require('zappa') ->
before = (req, res, next) ->
console.log 'before'
next()
@use before
@get '/': ->
console.log 'route'
'route'
# auth_helper.coffee
@include = ->
helper auth: (cb) ->
if session.user
@user = session.user
cb()
else
redirect '/login'
# account_controller.coffe
zappa =
run: (f)->
# Re-compile the function in a context that contains the Zappa
# methods as globals.
app = require('express').createServer()
vm = require 'vm'
code = 'zappa_code='+f.toString()
views = {}
router = {}
@mauricemach
mauricemach / gist:1205485
Created September 9, 2011 04:13
benchmark of scope manipulation methods in node.js
log = console.log
ben = require 'ben'
vm = require 'vm'
times = 10000
global.sum = (x, y) -> x + y
vm_script = vm.createScript 'console.log(typeof require);', 'vm_script'
new_function = new Function('locals', 'console.log(typeof require);')
applied = -> console.log(typeof require)
helper requires_login: (cb) ->
if request.session.user then cb()
else redirect "/sessions/new?redir=" + request.url
get "/accounts/new": ->
requires_login ->
render "home/accountNew"
@mauricemach
mauricemach / zappa_partials_beautiful.coffee
Created November 16, 2010 20:20
Proposed API for partials.
get '/': ->
@items = [
{name: 'coffeescript', url: 'http://coffeescript.org'}
{name: 'ruby', url: 'http://ruby-lang.org'}
{name: 'python', url: 'http://python.org'}
]
render 'default'
view ->
@mauricemach
mauricemach / zappa_partials_ugly.coffee
Created November 16, 2010 20:18
"Faking" partials with what we have in zappa today
get '/': ->
@items = [
{name: 'coffeescript', url: 'http://coffeescript.org'}
{name: 'ruby', url: 'http://ruby-lang.org'}
{name: 'python', url: 'http://python.org'}
]
# I think helpers belong in the template's locals "namespace",
# but we cannot currently specify the template's locals in zappa.
@partial = partial
@mauricemach
mauricemach / realtime_tracking.coffee
Created November 11, 2010 20:39
Proof of concept on realtime visits tracking.
express = require 'express'
io = require 'socket.io'
ck = require 'coffeekup'
app = express.createServer()
app.get '/', (req, res) ->
res.send ck.render ->
@title = 'WebSockets tracker'
doctype 5
html ->