This file contains 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
class Card | |
SUITS = %w(S H D C).freeze | |
RANKS = %w(2 3 4 5 6 7 8 9 10 J Q K A).freeze | |
RANKS_SCORES = RANKS.each_with_index.to_h | |
include Comparable | |
attr_reader :suit, :rank | |
def initialize(suit, rank) |
This file contains 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
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification | |
apply plugin: 'android' | |
targetCompatibility = 1.6 | |
sourceCompatibility = 1.6 | |
android { | |
target = 'android-14' |
This file contains 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
source "http://rubygems.org" | |
gem "webmachine" | |
gem "actionpack" | |
gem "thin" | |
gem "datamapper" | |
gem "dm-migrations" | |
gem "dm-sqlite-adapter" | |
gem "debugger" |
This file contains 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
gem 'rails', '3.2.1' | |
gem 'mongoid', :git => 'git://github.com/mongoid/mongoid.git' | |
gem 'mongoid-paperclip', :require => "mongoid_paperclip" | |
# if you're using rspec (should be temporary until mongoid-rspec will be updated to mongoid 3.0) | |
# group :test do | |
# gem "mongoid-rspec", :git => 'https://github.com/tanordheim/mongoid-rspec.git', :branch => 'mongoid_3_0' | |
# end | |
This file contains 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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential git-core curl libssl-dev \ | |
libreadline5 libreadline5-dev \ | |
zlib1g zlib1g-dev \ | |
libmysqlclient-dev \ | |
libcurl4-openssl-dev \ | |
libxslt-dev libxml2-dev |
This file contains 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
require 'fcntl' | |
require 'eventmachine' | |
#what is needed | |
#mkfifo mypipe | |
#that everything written thru the pipe have a "\n" | |
#ex: echo "foobar\n" > mypipe | |
#HPO = Handle Pipe Output | |
module HPO |
This file contains 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
require 'net/http' | |
module Net | |
class HTTP | |
def self.enable_debug! | |
raise "You don't want to do this in anything but development mode!" unless Rails.env == 'development' | |
class << self | |
alias_method :__new__, :new | |
def new(*args, &blk) | |
instance = __new__(*args, &blk) | |
instance.set_debug_output($stderr) |