Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / hangman_test2.rb
Created March 24, 2012 08:07
require_relative 'hangman_class'
require 'test/unit'
class TestHangman < Test::Unit::TestCase
def test_startup_value
Hangman.class_eval do
attr_accessor :words, :finish, :limit, :win
end
hangman = Hangman.new
assert(hangman.words.length > 0, "should have more than one in dictionary")
@apirak
apirak / hangman.rb
Created March 23, 2012 14:49
Hangman game with class and yield
require_relative 'hangman_class_2'
hangman = Hangman.new
hangman.start do
puts hangman.answer
print "#{hangman.limit} Enter your best guest: "
hangman.guess(gets)
end
@apirak
apirak / hangman.rb
Created March 23, 2012 14:42
Hangman game with simple class
require_relative 'hangman_class'
hangman = Hangman.new
hangman.start
until hangman.finish
puts hangman.answer
print "#{hangman.limit} Enter your best guess: "
hangman.guess(gets)
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
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
@didip
didip / tornado-nginx-example.conf
Created January 30, 2011 05:19
Nginx config example for Tornado
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}