- what
- the
- fuck
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 PersonRepository < Norm::PostgreSQLRepository | |
def named(name) | |
select_records(select_statement.where(:name => name) | |
end | |
def named_ordered_by_created_at(name) | |
select_records(select_statement. | |
where(:name => name). | |
order(:created_at, :desc)) |
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
11:30 < txus> what does "cis" mean?? | |
11:30 < jkleske> mortice: no, definitely not. | |
11:30 < medk> 10:37 piman_ ➤ if you are comfortable with your birth sex/gender assignment, you are cis. | |
11:30 < fwg_> now we need the bot | |
11:32 < piman_> Just, in general, I don't like comparisons of "well, X is more diverse than Y", because it always seems to ignore some axes. | |
11:32 < mortice> fair | |
11:33 < mortice> i also don't think it's relevant; saying "berlin is more diverse than X" doesn't mean we don't have to work to improve diversity | |
11:33 < fwg_> well it can only be said as a subjective perception | |
11:33 < gkarekinian> Most meetups in Berlin are just white males | |
11:34 < jkleske> full ack |
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
#if I have... | |
A.new(B.new(C.new(D.new))) | |
#is there some way (some inject sorcery?) to construct this from a list of the classes? | |
list = [A, B, C, D] |
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
git show --name-only REVISION --pretty="format:" | while read file | |
do | |
echo $file: | |
git show REVISION:$file | |
done | cat |
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
1.9.3p448 :007 > Resource.all.sort_by(&:average_rating) | |
Resource Load (0.4ms) SELECT "resources".* FROM "resources" | |
Rating Load (0.3ms) SELECT "ratings".* FROM "ratings" WHERE "ratings"."resource_id" = $1 ORDER BY "ratings"."id" ASC LIMIT 1 [["resource_id", 1]] | |
Rating Load (0.2ms) SELECT "ratings".* FROM "ratings" WHERE "ratings"."resource_id" = $1 [["resource_id", 1]] | |
Rating Load (0.2ms) SELECT "ratings".* FROM "ratings" WHERE "ratings"."resource_id" = $1 ORDER BY "ratings"."id" ASC LIMIT 1 [["resource_id", 2]] | |
Rating Load (0.2ms) SELECT "ratings".* FROM "ratings" WHERE "ratings"."resource_id" = $1 [["resource_id", 2]] | |
=> [#<Resource id: 2, title: nil, summary: nil, link: nil, created_at: "2013-07-29 13:53:52", updated_at: "2013-07-29 13:53:52", user_id: nil>, #<Resource id: 1, title: nil, summary: nil, link: nil, created_at: "2013-07-29 13:52:36", updated_at: "2013-07-29 13:52:36", user_id: nil>] |
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
~> irb | |
1.9.3-p194 :001 > 10.0 / 0.0 | |
=> Infinity | |
1.9.3-p194 :002 > 0.0 / 0.0 | |
=> NaN | |
1.9.3-p194 :003 > 10 / 0 | |
ZeroDivisionError: divided by 0 | |
from (irb):3:in `/' | |
from (irb):3 | |
from /Users/thomasstuart/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>' |
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
1.9.3-p194 :019 > 10.0 / 0.0 | |
=> Infinity | |
1.9.3-p194 :020 > 0.0 / 0.0 | |
=> NaN |
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
#put me in your ~/.(bash|zsh|other-posix-shell)rc | |
rails() { | |
command=$1 | |
shift | |
case $command in | |
g|generate) | |
script/generate $*;; | |
c|console) |
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
1.9.3p392 :001 > method(:include) | |
=> #<Method: main.include> | |
1.9.3p392 :002 > Module.new.method(:include) | |
=> #<Method: Module#include> |