Skip to content

Instantly share code, notes, and snippets.

# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
@saimonmoore
saimonmoore / Gemfile
Created March 26, 2010 12:12 — forked from lifo/Gemfile
CRAMP Websocket example
gem 'cramp'
gem 'erubis', '2.6.5'
gem 'usher', "0.6.0"
require 'rubygems'
require 'lib/couchdb_adapter'
COUCHDB_LOCATION = "couchdb://localhost:5984/test_cdb_adapter"
DataMapper.setup(
:couch,
Addressable::URI.parse(COUCHDB_LOCATION)
)
waxClass{"PolygonShape", NSObject}
function initWithNumberOfSides_minimumNumberOfSides_maximumNumberOfSides(self, sides, min, max)
self.super:init()
self._minimumNumberOfSides = min
self._maximumNumberOfSides = max
self._numberOfSides = sides
return self
end
waxClass{"PolygonShape", NSObject}
function initWithNumberOfSides_minimumNumberOfSides_maximumNumberOfSides(self, sides, min, max)
self.super:init()
self:minimumNumberOfSides(min)
self:maximumNumberOfSides(max)
self:numberOfSides(sides)
return self
end
@saimonmoore
saimonmoore / watchr script for wax specs
Created March 10, 2010 00:30
watchr script for wax specs
WAX_PATH = File.expand_path("wax")
watch( 'data/scripts/tests/(.*)\.lua' ) {|md| system("#{WAX_PATH}/bin/hammer --headless WAX_TEST=YES") }
watch( 'data/scripts/(.*)\.lua' ) {|md| system("#{WAX_PATH}/bin/hammer --headless WAX_TEST=YES") }
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set langmenu=none "Set all the menu's to use English
colorscheme delph "Use custom colour scheme
if has("autocmd")
filetype plugin indent on "Load filetype specific plugins and indent file
endif
set nomodeline "Exploitable, should be off
set nocompatible "Turn off vi compatibility
set ruler "Show cursor position
set hidden "Don't force me to save before changing buffers
Handy vim commands and their break down
Command: " qa0f'yi'_Pa = <Esc>_guiwjq3@a " (without external quotes or spaces)
Breakdown:
qa - start recording a macro named 'a'
0 - Move cursor to first column
f' - Find first occurence of ' moving forwards
yiw' - Yank the inner word ignoring the '
a = <Esc> - Append ' = ' and enter command mode
User.create(:name => 'Chloe', :email => '[email protected]', :password => 'secret', :password_confirmation => 'secret')
User.create(:name => 'Sofia', :email => '[email protected]', :password => 'secret', :password_confirmation => 'secret')
User.create(:name => 'Ana', :email => '[email protected]', :password => 'secret', :password_confirmation => 'secret')
User.create(:name => 'Claudia', :email => '[email protected]', :password => 'secret', :password_confirmation => 'secret')