- Collecting input
- Performing work
- Delivering output
- Handling failures
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
RSpec.configure do |config| | |
config.before(:suite) do | |
Thread.current[:query_counter] = Hash.new(0) | |
end | |
config.around(:example) do |procsy| | |
callback = lambda do |*args| | |
event = ActiveSupport::Notifications::Event.new(*args) | |
sql = event.payload[:sql].to_s.strip | |
operation = sql.split(' ', 2).first.to_s.downcase |
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
# Re-try randomly failing examples | |
config.around(:each) do |ex| | |
attempts = [ENV["RSPEC_ATTEMPTS"].to_i, 1].max | |
attempts.times do |i| | |
example = RSpec.current_example | |
example.instance_variable_set("@exception", nil) | |
if i > 0 | |
puts "Re-running rspec example #{example.location}. Attempt #{i + 1} of #{attempts}" | |
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
module Sprockets | |
class Manifest | |
def logger_with_debug | |
logger_without_debug.tap do |logger| | |
logger.level = Logger::DEBUG | |
end | |
end | |
alias_method_chain :logger, :debug | |
end | |
end |
I hereby claim:
- I am anolson on github.
- I am anolson (https://keybase.io/anolson) on keybase.
- I have a public key whose fingerprint is F1C4 5C7C 42AC 5FD2 492D D67B C68E 0F36 79C0 CAD4
To claim this, I am signing this object:
- https://github.com/burke/zeus
- Preload rails app (like spork)
- zeus start and then zeus console, zeus rspec (in less than a second)
- https://github.com/wakiki/rspec-zeus-tmbundle
run rspec (without type zeus rspec) (https://github.com/thoughtbot/dotfiles)
rspec() {
Implement a Ruby program that outputs the validity of a number by applying the Luhn Checksum.
http://en.wikipedia.org/wiki/Luhn_algorithm
Please treat this as you would any other project or task you'd encounter during your daily work. This will show us how currently code, and not how you coded 6, 12 or 18 months ago. Your code should also be suitably tested.
Input:
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
<html> | |
<head> | |
<link rel=stylesheet href="/style/screen.css" media="screen" type="text/css"> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title><%= @path %></title> | |
</head> | |
<body> | |
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
<html> | |
<head> | |
<title>D3</title> | |
<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script> | |
<script type="text/javascript" charset="utf-8" src="d3.v2.js"></script> | |
<script type="text/javascript" charset="utf-8" src="d3.layout.min.js"></script> | |
NewerOlder