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
evens, odds = (1..10).partition(&:even?) |
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
require 'spec_helper' | |
class Foo | |
def self.bar(first, second, third) | |
err_msg = '%s cannot be nil' | |
raise ArgumentError, err_msg % 'first' unless first | |
raise ArgumentError, err_msg % 'second' unless second | |
raise ArgumentError, err_msg % 'third' unless third | |
"#{first} #{second} #{third}" |
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
require 'state_machine' | |
module Sandpit | |
class Foo | |
state_machine :state, initial: :created do | |
event :start do | |
transition created: :running | |
transition running: same | |
end | |
event :stop do |
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 | |
# Set up a fresh MacBook for software development with my personal preferences. | |
# | |
# Inspiration taken from the following: | |
# - Mathias Bynen's popular config: https://github.com/mathiasbynens/dotfiles | |
# - Thoughtbot's dev-centric script: https://github.com/thoughtbot/laptop | |
# - The legendary Jessie Frazelle: https://github.com/jessfraz | |
# - Defaults-Write: https://www.defaults-write.com/ | |
# |
OlderNewer