Skip to content

Instantly share code, notes, and snippets.


Jason Rudolph jasonrudolph

View GitHub Profile
jasonrudolph / mongo-console
Created Jun 9, 2012
Passing Query and Sort Params to MongoHQ RESTful API
View mongo-console
# Assuming you're familiar with specifying query and sort options
# via the MongoDB console as shown here, you can specify these same
# options via the MongoHQ RESTful API using the approach shown in the
# file below.
$ mongo -u REDACTED -p
MongoDB shell version: 2.0.4
Enter password:
connecting to:
> use one-rep-max;
jasonrudolph /
Created May 17, 2012
GitHub README Template
jasonrudolph /
Created Feb 12, 2012
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
jasonrudolph / gist:1732424
Created Feb 3, 2012
Delete trailing whitespace from all files in current directory tree
View gist:1732424
find . -type f -print0 | xargs -0 sed -i '' -E "s/[[:space:]]*$//"
jasonrudolph /
Created Oct 23, 2011
"SOLID Object-Oriented Design" - Sandi Metz @ GoRuCo 2009

"SOLID Object-Oriented Design" by Sandi Metz @ GoRuCo 2009

Date: May 30, 2009

Video on


  • Design is all about dependencies
  • If you refer to something, you depend on it.
jasonrudolph /
Created Sep 29, 2011
RubyConf 2011: Why You Don't Get Mock Objects

"Why You Don't Get Mock Objects" by Gregory Moeck

RubyConf 2011 | 2011-09-29 | Gregory Moeck (@gregmoeck) | Slides

  • Recommended as the best book on mocks: Growing Object-Oriented Software, Guided by Tests by Steve Freeman & Nat Pryce
  • Common arguments against mocks
    • They duplicate implementation
    • They lead to brittle tests
  • Mock objects + procedural programming = bad idea
  • If you're doing traditional Rails development (which tends to follow more of a "procedural", do-this-and-then-do-that style), mock objects probably aren't for you
jasonrudolph /
Created Aug 19, 2011
Programming Achievements: Suggestions from the GitHub Community

Programming Achievements: Suggestions from the GitHub Community

Last week, I published some ideas for leveling up as a developer. I put it on GitHub as a gist, and I encouraged people to modify the list to their liking:

Feel free to fork it and add more achievements. (Make sure they're measurable.)

Or, fork it and mark off the achievements you've already conquered. You might even flag the one that you're currently working on.

So far, more than 270 developers have forked this gist. Many devs have customized their forks as personal to-do lists (e.g., crossing off past achievements and highlighting the goal they're currently pursuing). A number of people have also added new achievements to their forks, indicating additional experiences that they

jasonrudolph /
Last active Jun 27, 2022
Programming Achievements: How to Level Up as a Developer
jasonrudolph /
Created May 5, 2011
Rake tasks fail to log when running in production mode
# generate a fresh app
rails -v
rails new whizbang
cd whizbang
# show empty log file
cat log/production.log
# script/runner successfully writes to the log file
./script/rails runner 'Rails.logger.error("Hello from script/runner")' -e production
View git-aliases
# git
alias gl='git pull'
alias gp='git push'
alias gd='git diff | mate'
alias gdh='git diff HEAD | mate'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcap='git commit -v -a && git push'
alias gb='git branch'
alias gba='git branch -a'