Skip to content

Instantly share code, notes, and snippets.

View slothbear's full-sized avatar
🏠
Working on Zocalo, club membership/newsletter tracking.

Paul Morganthall slothbear

🏠
Working on Zocalo, club membership/newsletter tracking.
View GitHub Profile
We couldn’t find that file to show.
---
name: Captain Hammer
leak: true
---
name: Dr. Horrible
leak: false
---
journey: regex
leak: true
---
<?xml version="1.0" encoding="utf-8"?>
<response emailAddress="rsw@rswgame.com" receivedTime="1251145165.04" rswAddress="rswgame.com:8123" rswSecure="True" serverName="RSW Server" version="0.98.9.4.2" webAddress="http://rswgame.com/">
<gameHeader changeSeq="1776" endCondition="score:None" gameId="floors3d" involved="True" multi="1" nextTurnTime="Mon, 31 Aug 2009 13:00:00 -0000" numPlayers="11" numPositions="11" numWaitingFor="5" parametersName="Classic" quick="True" started="Sat, 04 Apr 2009 20:30:23 -0000" state="active" submittedFinal="True" turnNumber="20">
<playerHeader handle="kohlechtohr" msgCount="138" numOrders="2" score="1155" type="Collector" unreadCount="12"/>
<override newValue="25" paramName="PointsPerWorldDiscoveredFlyThrough" typeName="Skip Tracer"/>
<override newValue="4" paramName="MaxFleetHops" typeName="Skip Tracer"/>
<override newValue="1" paramName="PointsPerIndustry" typeName="Emperor"/>
<override newValue="True" paramName="CanOwnRobots" typeName="Warlord"/>
<ov
@slothbear
slothbear / imperative.feature
Created October 10, 2011 21:34
the shining beacon of the declarative scenario
Scenario: Request notification of replies to forum topic
Given I sign in as "Marcus/password"
And I compose a forum topic
And I enable the checkbox "topic_notify_me"
# topic_notify_me is the ID of "Email me when someone replies"
# can't use label because the label is *after* the field (?)
And I press "Save topic"
When another user replies to the topic
Then I should receive an email.
@slothbear
slothbear / gist:1384738
Created November 22, 2011 02:41
rails console test of belongs_to association
ruby :032 > site = Site.create(:name => "Boston")
SQL (0.5ms) INSERT INTO "sites" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 22 Nov 2011 02:28:57 UTC +00:00], ["name", "Boston"], ["updated_at", Tue, 22 Nov 2011 02:28:57 UTC +00:00]]
=> #<Site id: 5, name: "Boston", created_at: "2011-11-22 02:28:57", updated_at: "2011-11-22 02:28:57">
ruby :033 > device = Device.create(:name => "hackatron")
SQL (0.6ms) INSERT INTO "devices" ("created_at", "name", "site_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 22 Nov 2011 02:29:13 UTC +00:00], ["name", "hackatron"], ["site_id", nil], ["updated_at", Tue, 22 Nov 2011 02:29:13 UTC +00:00]]
=> #<Device id: 5, name: "hackatron", created_at: "2011-11-22 02:29:13", updated_at: "2011-11-22 02:29:13", site_id: nil>
ruby :034 > site.devices << device
(0.4ms) UPDATE "devices" SET "site_id" = 5, "updated_at" = '2011-11-22 02:29:39.327808' WHERE "devices"."id" = 5
Device Load (0.2ms) SELECT "devices".* FROM "devices" WHER
@slothbear
slothbear / site.rb
Created December 5, 2011 00:29
Getting a count of a has_many :through association
class Site < ActiveRecord::Base
has_many :zests
has_many :reviews, :through => :zests
has_many :a_grades, :through => :zests, :source => :reviews,
:conditions => {:grade => 5}
def total_with_grade(grade)
reviews.where("grade = ?", grade).count
end
@slothbear
slothbear / - list all rubies.sh
Last active December 11, 2015 00:58
My road to ruby-1.9.3-p362
__list_remote_all_for 1.9.3
1.9.3 or any other filter
➜ ~ __list_remote_all_for 1.9.3
https://rvm.io/binaries/arch/libc-2.15/x86_64/ruby-1.9.3-p194.tar.bz2
https://rvm.io/binaries/arch/libc-2.15/x86_64/ruby-1.9.3-p286.tar.bz2
https://rvm.io/binaries/arch/libc-2.15/x86_64/ruby-1.9.3-p327.tar.bz2
https://rvm.io/binaries/centos/5.6/x86_64/ruby-1.9.3-p286.tar.bz2
https://rvm.io/binaries/centos/5.6/x86_64/ruby-1.9.3-p327.tar.bz2
https://rvm.io/binaries/centos/6.3/x86_64/ruby-1.9.3-p194.tar.bz2
@slothbear
slothbear / home-.gitignore
Last active December 12, 2015 02:38
Why does git ignore a file called ?VERSION"?
.DS_Store
bundler_stubs/
@slothbear
slothbear / gist:5002420
Created February 21, 2013 05:34
highlight a line
def hilite(text); "\n\e[1;30;43m #{text}".ljust(90) + "\e[0m"; end
@slothbear
slothbear / rvm-23-Jan-2014.log
Last active January 4, 2016 07:29
rvm --trace update 2.0.0 2.1.0 #=> Unknown ruby string (do not know how to handle): //.
[previous terminal window]
\curl -sSL https://get.rvm.io | bash -s stable
[rvm installed just fine]
[new terminal window with rvm]
Last login: Thu Jan 23 18:56:17 on ttys009
drako:~ Guest$ rvm list
rvm rubies