Skip to content

Instantly share code, notes, and snippets.

View Marak's full-sized avatar

Marak

View GitHub Profile
@Marak
Marak / vlcrc.js
Created October 5, 2011 21:32 — forked from garth/vlcrc.js
Remote control multiple VLC apps via the command line using nodejs
// To start vlc with telnet remote control:
// ./VLC --extraintf rc --rc-host 0.0.0.0:3000
//
// To connect to multiple vlc's
// node vlcrc.js host1:3000 host2:3000
var net = require('net');
var readline = require('readline');
//addresses of servers
@Marak
Marak / pipedDataStream.js
Created September 20, 2011 18:49 — forked from bmeck/pipedDataStream.js
Read in data piped ala `cat config.json | node app.js`
var tty = require('tty');
exports.pipedDataStream = pipedDataStream;
//
// If there was piped input, it returns a ReadableStream of the content
// use "data" and "end" events as per the norm.
//
// Else returns falsey.
//
@Marak
Marak / console.log.js
Created July 12, 2011 07:25 — forked from tmpvar/.gitignore
A console.log implementation that plays "nice" with large amounts of data. Keeps node alive until the output has flushed to screen.
/*
A console.log that won't leave you hanging when node exits
*/
console.log = function(d) {
var res = process.stdout.write(d + '\n');
// this is the first time stdout got backed up
if (!res && !process.stdout.pendingWrite) {
process.stdout.pendingWrite = true;
@Marak
Marak / mockreadwritestream.js
Created May 20, 2011 06:29 — forked from indexzero/mockreadwritestream.js
A mock stream for node.js that is both Readable and Writeable.
var events = require('events'),
util = require('util');
var MockReadWriteStream = helpers.MockReadWriteStream = function () {
//
// No need to do anything here, it's just a mock.
//
};
util.inherits(MockReadWriteStream, events.EventEmitter);
@Marak
Marak / levenshtein.js
Created May 18, 2011 23:21 — forked from graphnode/levenshtein.js
levenshtein function in javascript
function levenshtein(s1, s2) {
// http://kevin.vanzonneveld.net
// + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
// + bugfixed by: Onno Marsman
// + revised by: Andrea Giammarchi (http://webreflection.blogspot.com)
// + reimplemented by: Brett Zamir (http://brett-zamir.me)
// + reimplemented by: Alexander M Beedie
// * example 1: levenshtein('Kevin van Zonneveld', 'Kevin van Sommeveld');
// * returns 1: 3
@Marak
Marak / git-commit-prefixes
Created May 18, 2011 06:12 — forked from indexzero/git-commit-prefixes
Short list of Git commit prefixes used at Nodejitsu
[api]: New apis / changes to apis
[test]: Update test/* files
[dist]: Changes to submodules, version bumps, updates to package.json
[minor]: Small changes
[doc]: Updates to documentation
[ux]: Updates to UX
[fix]: Bug fixes
[bin]: Update binary scripts associated with the project
[merge]: Resolved git merge from upstream or otherwise
[refactor]: Refactor of existing code with no external API changes
@Marak
Marak / git-commit-prefixes
Created April 20, 2011 22:39 — forked from indexzero/git-commit-prefixes
Short list of Git commit prefixes used at Nodejitsu
[api]: New apis / changes to apis
[test]: Update test/* files
[dist]: Changes to submodules, version bumps, updates to package.json
[minor]: Small changes
[doc]: Updates to documentation
[ux]: Updates to UX
[fix]: Bug fixes
[merge]: Resolved git merge from upstream or otherwise
[refactor]: Refactor of existing code with no external API changes

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
@Marak
Marak / lineWrap.js
Created January 15, 2011 17:04 — forked from indutny/lineWrap.js
function lineWrap(str) {
// Split by lines
return str.split(/\r|\n|\r\n/g).reduce(function(prev, piece) {
var parts = [];
// Wrap line
while (piece.length) {
var match = piece.match(/^.{1,80}(?:\s|$)/),
matchlen;
@Marak
Marak / gist:772298
Created January 10, 2011 03:12 — forked from gerhard/gist:372205
#!/usr/bin/env ruby
# Configures the git author to a list of developers when pair programming
#
# Usage: pair cr pf (Sets the author to 'Charlie Robbins, and Paolo Fragomeni')
# pair (Unsets the author so the git global config takes effect)
#
# Author: Bryan Helmkamp (http://brynary.com)
#######################################################################