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
def scooby(&block) | |
`say #{yield}` | |
end | |
scooby do | |
"be-doo-be-doo" | |
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
jQuery(function() { | |
$("#badge").badge({ | |
user_name: 'awendt', | |
user_id: 4158038, | |
show: 12, | |
link_text: "All my photos on 23 Photo Sharing" | |
}); | |
}); |
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
Consider this: | |
I have developed a feature on a branch (F) that is merged into a staging branch (S) using `--no-ff`. | |
Meanwhile, the master branch (M) has evolved: | |
I--------M | |
\ | |
\---S | |
\ / | |
F |
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
// as seen on http://jetlogs.org/2007/09/03/jquery-select-boxes-and-change-events/ | |
var message = new Array(); | |
message[1] = "You have selected first item"; | |
message[2] = "You have selected the second item"; | |
message[3] = "You have selected the last item"; |
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 Hash | |
def except(*blacklist) | |
self.reject {|key, value| blacklist.include?(key) } | |
end | |
def only(*whitelist) | |
self.reject {|key, value| !whitelist.include?(key) } | |
end | |
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
namespace :secret do | |
desc "Generate config/session_key_secret if it does not exist" | |
task :generate_file do | |
session_key_sec_file = "#{RAILS_ROOT}/config/session_key_secret" | |
if File.exists?(session_key_sec_file) | |
puts "File #{session_key_sec_file} already exists. Nothing to do." | |
else | |
puts "Generating #{session_key_sec_file}... " | |
exec "rake --silent secret > #{session_key_sec_file}" |
NewerOlder