Skip to content

Instantly share code, notes, and snippets.

View irohiroki's full-sized avatar

Hiroki Yoshioka irohiroki

View GitHub Profile
@irohiroki
irohiroki / rspec-syntax-cheat-sheet.rb
Created March 27, 2012 06:23 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@irohiroki
irohiroki / singleton.coffee
Created December 1, 2011 02:11 — forked from meltingice/singleton.coffee
Example singleton class and example for Coffeescript
class Singleton
# We can make private variables!
instance = null
# Static singleton retriever/loader
@get: ->
unless instance
instance = new @
instance.init()
require 'ruby-debug'
require 'socket'
require 'forwardable'
class SporkDebugger
DEFAULT_PORT = 10_123
HOST = '127.0.0.1'
extend Forwardable
def_delegators :state, *[:prepare_debugger, :initialize]