Skip to content

Instantly share code, notes, and snippets.

View jasonrudolph's full-sized avatar

Jason Rudolph jasonrudolph

View GitHub Profile
@jasonrudolph
jasonrudolph / programming-achievements-suggested-by-github-members.md
Created August 19, 2011 21:25
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
jasonrudolph / github-api-example.md
Created April 15, 2014 12:09
Debugging "Reference update failed" error when creating a branch via the GitHub Git Refs API
@jasonrudolph
jasonrudolph / how-to-reproduce.sh
Created May 5, 2011 00:16
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
@jasonrudolph
jasonrudolph / 2011-09-29-why-you-dont-get-mock-objects.md
Created September 29, 2011 18:19
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
# Search for code containing the term "_cache" in repositories owned by @jasonrudolph
curl -G -H "Accept: application/vnd.github.preview.text-match" \
https://api.github.com/search/code --data-urlencode "q=@jasonrudolph _cache"
# A Ruby snippet posted as a comment on http://vitobotta.com/applying-bitwise-operations-to-rspec-testing/
# [ activable?, persisted?, new?, suspended? ]
# =============================================
combinations = [
[ false, false, false, false ],
[ false, false, true, false ],
[ false, false, false, true ],
[ false, true, false, false ],
@jasonrudolph
jasonrudolph / mongo-console
Created June 9, 2012 13:07
Passing Query and Sort Params to MongoHQ RESTful API
# 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 staff.mongohq.com:10095/one-rep-max -u REDACTED -p
MongoDB shell version: 2.0.4
Enter password:
connecting to: staff.mongohq.com:10095/one-rep-max
> use one-rep-max;
@jasonrudolph
jasonrudolph / README.md
Created May 17, 2012 00:07
GitHub README Template
@jasonrudolph
jasonrudolph / gist:1732424
Created February 3, 2012 20:48
Delete trailing whitespace from all files in current directory tree
find . -type f -print0 | xargs -0 sed -i '' -E "s/[[:space:]]*$//"
@jasonrudolph
jasonrudolph / solid-oo-design-by-sandi-metz-at-goruco-2009.md
Created October 23, 2011 13:56
"SOLID Object-Oriented Design" - Sandi Metz @ GoRuCo 2009

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

Date: May 30, 2009

Video on confreaks.net

Notes

  • Design is all about dependencies
  • If you refer to something, you depend on it.