Skip to content

Instantly share code, notes, and snippets.

View indexzero's full-sized avatar
🌎
Always bet on Open Source

Charlie Robbins indexzero

🌎
Always bet on Open Source
View GitHub Profile
; CouchDB Config
; Drop in PREFIX/local.d/npmjs.ini
[couch_httpd_auth]
public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev
users_db_public = true
[httpd]
secure_rewrites = false
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.chord {
fill-opacity: .67;
@indexzero
indexzero / Makefile
Last active August 29, 2015 14:13 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

var html = "<div><hr>foo<div>bar</div></div>";
var c = -1;
html = html.replace(/\<([^<\>]*)\>/g, function(str, r) {
if(r.indexOf("/") === -1) {
c++;
return "[\"" + r + ((c == 0) ? "\"," : "\"],");
var a = {
x: 1
};
var props = {
x: { value: 1 }
};
var b = Object.create(a);
var c = Object.create(a,b);
@indexzero
indexzero / arena
Created October 7, 2010 05:22 — forked from chapel/arena
var httpAgent = require('http-agent'),
url = require('url'),
sys = require('sys');
exports.start = function () {
var agent = httpAgent.create('www.bungie.net', ['/stats/reach/playergamehistory.aspx?player=thechapel&vc=2']);
agent.addListener('next', function (err, agent) {
var uri = url.parse(agent.current.uri);
exports.dispatch(uri);
var b = new Buffer(256*256)
for (var i = 0 ; i < 256*256 ; i ++) {
b[i] = i % 256
}
var s = b.toString("binary")
var b2 = new Buffer(s, "binary")
for (var i = 0 ; i < 256*256 ; i ++) {
if (b2[i] !== i) console.error("error at 0x"+i.toString(16))
}
{
'We make sure we can talk to Twitter':
/* We'll be using same server for following requests. */
using('api.twitter.com')
.get('/help/test.json')
.expect(200, "ok", "/help/test.json returns 200 and ok")
.get('/help/test.txt')
/* Here we ignore response */
.expect(406, dc.ignore(), "/help/test.txt is not acceptable"),

Game Engines

Name Latest Release Size (KB) License Type Unit Tests Docs Notes
The Render Engine 1.5.3 MIT Cross-browser; extensive API; open-source. 2
gameQuery 0.5.1 CC BY-SA 2.5 Designed to be used with jQuery
gTile 0.0.1 (2008-07-21) Tile based
Akihabara 1.3 GPL2/MIT Classic Repro Intended for making classic arcade-style games in JS+HTML5 3
The Javascript 2D Game Engine GPL Emphasis on gravity/physics/collision detection; uses HTML5 Canvas and ExplorerCanvas for IE support. Focus on limiting CPU usage. 4
The GMP Javascript Game Engine