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
Loading development environment (Rails 3.0.7) | |
irb(main):001:0> This.find(2).some_those | |
=> [] | |
irb(main):002:0> This.reflect_on_all_associations.map(&:name) | |
=> ["some_those", "other_those"] | |
irb(main):003:0> This.find(2, :include => :some_those) | |
ActiveRecord::ConfigurationError: Association named 'some_those' was not found; perhaps you misspelled it? | |
from /var/lib/gems/1.8/gems/activerecord-3.0.7/lib/active_record/association_preload.rb:116:in `preload_one_association' | |
from /var/lib/gems/1.8/gems/activesupport-3.0.7/lib/active_support/ordered_hash.rb:126:in `each' | |
from /var/lib/gems/1.8/gems/activesupport-3.0.7/lib/active_support/ordered_hash.rb:126:in `each' |
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
syn region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gim]\{0,3\}\s*$+ end=+/[gim]\{0,3\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline | |
data = data.replace(/(\r\n|\n|\r)/gm, "").replace(/'/g, "\\'"); |
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
# given array 'arr' and object 'x' the responds to 'a' and 'b', | |
# which is faster? | |
arr << x.a | |
arr << x.b | |
arr | |
# or | |
arr = arr + [x.a, x.b] |
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
~/.vim | |
~/.vim/bundles/brew | |
~/.vim/bundles/colorchart | |
~/.vim/bundles/colorindent | |
~/.vim/bundles/csapprox | |
~/.vim/bundles/cucumber | |
~/.vim/bundles/fugitive | |
~/.vim/bundles/git | |
~/.vim/bundles/haml | |
~/.vim/bundles/indent-guides |
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 Calendar < ActiveRecord::Base | |
has_many :reservations | |
end | |
class Reservation < ActiveRecord::Base | |
belongs_to :calendar | |
def self.search(search_fields) | |
results = self #this is where I'd like to access the collection search was called on |
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
Team 1 | Team 2 | Team 3 | Team 4 | Team 5 | Team 6 | Team 7 | Team 8 | Team 9 | Team 10 | Team 11 | Team 12 | Team 13 | Team 14 | Team 15 | Team 16 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | 2 | 2 | 1 | 1 | 1 | 2 | 2 | 1 | 1 | 2 | 2 | 2 | 1 | 1 | 1 |
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
Remove hack for binding ^ that prevents binding ctrl-^ | |
--- irssi-0.8.15.orig/src/fe-text/gui-readline.c | |
+++ irssi-0.8.15/src/fe-text/gui-readline.c | |
@@ -392,12 +392,6 @@ | |
str[g_unichar_to_utf8(key, str)] = '\0'; | |
} | |
- if (strcmp(str, "^") == 0) { | |
- /* change it as ^^ */ | |
- str[1] = '^'; |
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 'rubygems' | |
require 'bloops' | |
b = Bloops.new | |
b.tempo = 100 | |
sound = b.sound Bloops::SQUARE | |
sound.volume = 0.5 | |
sound.sustain = 0.3 | |
sound.attack = 0.1 | |
sound.decay = 0.3 |
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
div.p { | |
/* div's as p's | |
* | |
* this is a work-around for how rails | |
* displays error messages on a form | |
*/ | |
margin-bottom: 1em; | |
} | |
.small { |
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
% gvim | |
Xlib: extension "RANDR" missing on display ":0.0". | |
(gvim:19111): atk-bridge-WARNING **: AT_SPI_REGISTRY was not started at session startup. | |
(gvim:19111): atk-bridge-WARNING **: IOR not set. | |
(gvim:19111): atk-bridge-WARNING **: Could not locate registry |