Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
g7tri77k4pp4

James keppy

🙃
g7tri77k4pp4
  • USA
View GitHub Profile
View gist:9281510
packpurchase λ cat Gemfile.lock
GIT
remote: git://github.com/smashingboxes/capistrano-haller.git
revision: e4e92394891fd858677f79c2101408c86aca1894
specs:
capistrano-haller (0.0.2)
capistrano (< 3.0)
GIT
remote: git://github.com/smashingboxes/cardboard.git
View haller
ackpurchase λ cap hall_notify:notify_hall_room
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/highline-1.6.20/lib
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/net-sftp-2.1.2/lib
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/net-scp-1.1.2/lib
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/net-ssh-gateway-1.2.0/lib
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/capistrano-2.15.5/lib
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/net-ssh-2.8.0/lib
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/json-1.8.1/lib
/Users/Luca/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib
/Users/Luca/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0
View gist:c5d0c35bff8fb3874fc3
I, [2014-02-17T17:49:07.694501 #14991] INFO -- : Refreshing Gem list
I, [2014-02-17T17:49:10.763734 #14991] INFO -- : listening on addr=/tmp/unicorn.packpurchase.sock fd=10
I, [2014-02-17T17:49:11.081006 #14991] INFO -- : master process ready
I, [2014-02-17T17:49:11.097897 #14995] INFO -- : worker=0 ready
I, [2014-02-17T17:49:11.102993 #14998] INFO -- : worker=1 ready
I, [2014-02-18T15:29:08.030600 #22657] INFO -- : executing ["/home/deployer/www/packpurchase/shared/bundle/ruby/2.0.0/bin/unicorn", "-D", "-c", "/home/deployer/www/packpurchase/shared/config/unicorn.rb", "-E", "staging", {10=>#<Kgio::UNIXServer:/tmp/unicorn.packpurchase.sock>}] (in /home/deployer/www/packpurchase/releases/20140218152825)
I, [2014-02-18T15:29:08.620449 #22657] INFO -- : inherited addr=/tmp/unicorn.packpurchase.sock fd=10
I, [2014-02-18T15:29:08.645071 #22657] INFO -- : Refreshing Gem list
I, [2014-02-18T15:29:10.537629 #14991] INFO -- : reaped #<Process::Status: pid 14995 exit 0> worker=0
I, [2014-02-18T15:29:10.537860 #
@keppy
keppy / kpoker
Created May 29, 2012
poker game initialization
View kpoker
def initialize(numhands, n = 5, deck = [r+s for r in '23456789TJQKA' for s in 'SHDC'])
deck.shuffle
i = 0
numhands.times do (n*i).upto(n*(i+1)) {|x|... }
end
end
View gist:2831339
class PokerGame
include Enumerable
include Comparable
attr_reader :hand
def initialize(hands, cards)
ranks = %w{ 2 3 4 5 6 7 8 9 T J Q K A }
suits = %w{ S H D C }
card_stack = Array.new
h = Array.new
View gist:2831329
def initialize(hands, cards)
ranks = %w{ 2 3 4 5 6 7 8 9 T J Q K A }
suits = %w{ S H D C }
card_stack = Array.new
h = Array.new
suits.each {|suit|
ranks.size.times {|i|
card_stack << (ranks[i]+suit)
}
}
View gist:2835207
class PokerGame
include Enumerable
include Comparable
attr_reader :hand
def initialize(hands, cards)
ranks = %w{ 2 3 4 5 6 7 8 9 T J Q K A }
suits = %w{ S H D C }
card_stack = Array.new
num_hands = Array.new
@keppy
keppy / gist:3012287
Created Jun 28, 2012
Modeling a debate app
View gist:3012287
def User
has_many :propositions, :as => :debateable
has_many :oppositions, :as => :debateable
end
def Proposition
belongs_to :debateable, :polymorphic => :true
has_one :opposition, :as => :debateable
end
View gist:3042484
require 'spec_helper'
describe Debate do
#let(:prop_user) { FactoryGirl.create(:user) }
#let(:opp_user) { FactoryGirl.create(:user) }
before do
@prop_user = User.new(name: "Prop User", email: "prop@email.com")
@opp_user = User.new(name: "Opp User", email: "opp@email.com")
@debate = Debate.new(title: "Test Debate")
@keppy
keppy / gist:3133180
Created Jul 18, 2012
Problem with routes
View gist:3133180
routes.rb
----------
Debateable::Application.routes.draw do
resources :users do
resources :posts
end
resources :topics do
resources :posts