This file contains hidden or 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
about | |
account | |
action | |
activity | |
add | |
admin | |
administration | |
affiliate | |
api | |
app |
This file contains hidden or 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
#!/bin/sh | |
# Don't allow console.log() statements to be committed. | |
# | |
# Add to .git/hooks/pre-commit | |
# | |
# Note: jquery.js seems to always include 1 reference | |
# in a debugging section, that one can be safely | |
# ignored. 1 reference to console.log is cool |
This file contains hidden or 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
# Easily inspect any list of objects in logger. | |
# Provided as a hack to the standard ruby (or Rails) logger: | |
# | |
# Example Code: | |
# | |
# # in some_file.rb | |
# chicken = :fred | |
# all_the_birds = [chicken, :roadrunner] | |
# my_logger.inspector(chicken, all_the_birds) # outputs to log: | |
# |
This file contains hidden or 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
Do you think it is a good idea to do downcase and a == or is there a better way? | |
def nbde_new_evaluation_result(nbde_evaluation) | |
letter = nbde_evaluation.part1_test_result.downcase | |
if letter == "p" | |
"Pass" | |
elsif letter == "f" | |
"Fail" | |
else | |
"Unknown" |
This file contains hidden or 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
jlindley@hypatia:~$ rvm -v | |
rvm 0.1.32 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/] | |
jlindley@hypatia:~$ rvm install rbx | |
Installing pre-requisites | |
Extracting rubinius-1.0.0-20100514.tar.gz ... | |
mv: rename /Users/jlindley/.rvm/src/rubinius-1.0.0 to /Users/jlindley/.rvm/src/rbx-1.0.0-20100514/rubinius-1.0.0: Directory not empty | |
Configuring rbx | |
Compiling rbx |
This file contains hidden or 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
# new branches appropriately merge from the starting point branch | |
git config --global branch.autosetupmerge true | |
# pull from origin and merge by default | |
git config --global branch.master.remote origin | |
git config --global branch.master.merge refs/heads/master |
This file contains hidden or 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
module Kernel | |
def other | |
o = [] | |
ObjectSpace.each_object{|obj| o << obj unless (o==self)} | |
o | |
end | |
end | |
class Teapot | |
This file contains hidden or 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
jlindley@hypatia:~/Projects/AMS/site_assign[master]$ st | |
# On branch master | |
nothing to commit (working directory clean) | |
jlindley@hypatia:~/Projects/AMS/site_assign[master]$ mate . | |
jlindley@hypatia:~/Projects/AMS/site_assign[master]$ | |
jlindley@hypatia:~/Projects/AMS/site_assign[master*]$ st | |
# On branch master | |
# Untracked files: | |
# (use "git add <file>..." to include in what will be committed) | |
# |
This file contains hidden or 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
named_scope :multiple_per_zip, lambda{ | |
zip_counts = Site.count( | |
:all, :group => 'addresses.zip', :joins => :addresses | |
) | |
multi_site_zip_counts = zip_counts.reject{|k,v| v < 2} | |
just_zips = multi_site_zip_counts.map{|pair| pair[0]}.compact | |
{:conditions => ['addresses.zip in (?)', just_zips.join(",")]} | |
} |
This file contains hidden or 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
#!/bin/bash | |
cd /var/apps/buffarumble/current | |
export RAILS_ENV=production | |
/usr/bin/ruby -r'config/environment.rb' \ | |
-e 'puts RAILS_ENV' \ | |
-e 'puts "Events undelivered before: #{Event.undelivered.count}"' \ | |
-e 'Event.undelivered.map(&:dispatch!)' \ | |
-e 'puts "Events undelivered after: #{Event.undelivered.count}";0' |