This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{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(' ')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |