- http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html
- http://blog.8thlight.com/uncle-bob/2014/04/25/MonogamousTDD.html
- http://david.heinemeierhansson.com/2014/test-induced-design-damage.html
- http://blog.8thlight.com/uncle-bob/2014/05/01/Design-Damage.html
- http://david.heinemeierhansson.com/2014/slow-database-test-fallacy.html
- http://blog.8thlight.com/uncle-bob/2014/04/30/When-tdd-does-not-work.html
- https://www.destroyallsoftware.com/blog/2014/tdd-straw-men-and-rhetoric
- http://articles.coreyhaines.com/posts/active-record-spec-helper/
- http://martinfowler.com/bliki/UnitTest.html
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
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks | |
# of the ActiveRecord pattern. Several apps I have seen, and several | |
# developers I have spoken to are looking towards other patterns for object | |
# persistence. The major drawback with ActiveRecord is that the notion | |
# of the domain object is conflated with what it means to store/retrieve | |
# it in any given format (like sql, json, key/value, etc). | |
# | |
# This is an attempt to codify the Repository pattern in a way that would | |
# feel comfortable to beginner and seasoned Ruby developers alike. | |
# |
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 with_conditions(method_name, computed_value) | |
if method_name.to_s == 'address' && !computed_value.nil? | |
address.renderable? | |
else | |
super | |
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
require "spec_helper" | |
describe ExampleController do | |
context "GET #index" do | |
let(:resources) { FactoryGirl.create_list(:resource) } | |
before do | |
get :index | |
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
gem 'kaminari' | |
gem 'ransack' |
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
# | |
# This file configures the New Relic Agent. New Relic monitors | |
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead. | |
# For more information, visit www.newrelic.com. | |
# | |
# Generated June 03, 2013 | |
# | |
# This configuration file is custom generated for Barsoom | |
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
# This is the code from my 'There is No Such Thing as Metaprogramming' talk, | |
# which premiered at the Arlington, VA Ruby Users Group on Feb 22nd. | |
# Without the deliver and walk-through to the solution below this example | |
# will be missing quite an important bit of content (mainly the tracking of | |
# 'self' while developing the solution, but it still a useful read. | |
# Here is the Toddler with no metajuju. Note that the developer, as well as | |
# the code, is completely unuaware of the interpreter. A developer with a | |
# background in compiled languages would be comfortable looking at this. |
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
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence | |
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users | |
if exists('$TMUX') | |
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\" | |
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\" | |
else | |
let &t_SI = "\<Esc>]50;CursorShape=1\x7" | |
let &t_EI = "\<Esc>]50;CursorShape=0\x7" | |
endif |
!!
Repeat Previous Command!-1
Repeat Previous Command!-2
Repeat 2nd Previous Command!ps
Execute Previous Command STARTING WITH ps!^
First Argument From Previous Command!:2
2nd Argument From Previous Command!$
Last Argument From Previous Command!!:$
Last Argument From Previous Command
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 'active_record' | |
require 'arel' | |
# Ruby-like syntax in AR conditions using the underlying Arel layer (Rails >= 3.0). | |
# | |
# What you would usually write like this: | |
# | |
# User.where(["users.created_at > ? AND users.name LIKE ?", Date.yesterday, "Mary"]) | |
# | |
# can now be written like this: |
OlderNewer