Skip to content

Instantly share code, notes, and snippets.

@bcurren
bcurren / redis_pubsub_demo.rb
Created May 3, 2011 21:19 — forked from pietern/redis_pubsub_demo.rb
Updated redis pubsub with cramp
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@wvl
wvl / source_for.coffee
Created February 10, 2011 00:11
Get a repeatable, readable version of the source of an object
{inspect} = require 'util'
source_for = (obj, level=[]) ->
source = ""
Object.keys(obj).sort().forEach (k) ->
indent = level.join('')
if typeof obj[k] == 'function'
source += indent + k + ": " +Object.getOwnPropertyDescriptor(obj, k).value.toString() + "\n"
else if typeof obj[k] == 'object'
source += indent + k + ":\n" + source_for(obj[k], level.concat(' '))
@ltvolks
ltvolks / mate_pdb.py
Created March 23, 2010 20:32
Use TextMate Bookmarks as PDB breakpoints
#!/usr/bin/env python
"""
mate_pdb.py
Execute a script file in the debugger using breakpoints set
via Bookmarked Lines in TextMate.
Intended usage is to call from within a TextMate Command in
your Python bundle