Skip to content

Instantly share code, notes, and snippets.

View tdegrunt's full-sized avatar

Tom de Grunt tdegrunt

View GitHub Profile
@chrismatthieu
chrismatthieu / registrar.js
Created April 17, 2011 02:14 — forked from mheadd/registrar.js
SIP registrar
var sip = require('sip');
var sys = require('sys');
var redis = require('redis');
//Trim leading and trailing whitespace from string values.
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');
}
sip.start({},function(request) {
unless typeof exports is "undefined"
Spine = exports
else
Spine = @Spine = {}
Spine.version = "0.0.4"
$ = Spine.$ = @jQuery || @Zepto || -> arguments[0]
makeArray = Spine.makeArray = (args) ->
@warrendunlop
warrendunlop / gist:1169536
Created August 24, 2011 23:06
batman.js ASCII
./+oyNds/.
`+mMMMMMMMMMMms.
`oNMMMMMMMMMMMMMMMs
+NMMMMMMMMMMMMMMMMm/
.-```.:yMMMMMMMMMMMds/`
`-/++sNmho:` .omMMmyo+/::/+shNMMd/`
`/dMMMMMMMMMMMMmMMmo. :sNMN+
@tnhu
tnhu / gist:1331813
Created November 1, 2011 20:31 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@airhorns
airhorns / gist:1590577
Created January 10, 2012 19:13
How to jqueryize nodes rendered by batman
# Option 1
class SomeController extends Batman.Controller
index: ->
# Do some stuff
view = @render()
view.on 'ready', ->
# The view's HTML is now in the DOM, ready for jQuerying.
# To make your jQuery selectors faster, you can use the second argument of `$` and
# pass in the view's node as the node to search for your selector within
@ktusznio
ktusznio / controller.coffee
Created January 10, 2012 21:24
Batman Filtering
class Shopify.OrdersController extends Shopify.ApplicationController
index: (params) ->
@allOrders = Shopify.Order.get('all')
@_filterOrders()
addFilter: (type, value) ->
@set "#{type}Filter", value
@_filterOrders()
_filterOrders: ->
events =
events: {}
bind: (topic, handler, context = this) ->
(@events[topic] ||= []).push { handler, context }
trigger: (topic, args...) ->
if @events[topic]?
event.handler.apply event.context, args for event in @events[topic]
@topfunky
topfunky / Cakefile
Created February 11, 2012 21:53
Run tasks sequentially in a Cakefile
task 'sample_task', sample_task = (callback) ->
doSomethingAndRunCallbackAfter callback
task 'setup', 'All: Import all data and run webserver', ->
tasks = [install, pre_populate, populate_couch, graph_sync, server]
runSequentially = (currentTask, otherTasks...) ->
currentTask ->
if otherTasks.length
runSequentially otherTasks...
runSequentially tasks...
@dejayc
dejayc / fixNlc.sh
Created February 20, 2012 19:39
Fixes the ipfw DummyNet rules created by Network Link Conditioner when using Internet Sharing in Mac OS X Lion
#!/bin/bash
LAN_INTERFACE=''
BRIDGE_INTERFACE=''
SCRIPT_NAME=$( basename "${0}" )
POLL_SLEEP_SECONDS=5
getProcessInfo() {
local PROCESS="${1}"
ps -ef | grep "${PROCESS}" | grep -v "grep ${PROCESS}"