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
# script logic | |
if $PROGRAM_NAME == __FILE__ | |
# the script itself is being executed | |
exit | |
end | |
require 'rspec' | |
RSpec.describe 'the script' do |
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 'bundler/inline' | |
gemfile do | |
gem 'rspec', '3.7', require: false | |
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
diff -U 0 -r rails-3.1.0/Gemfile rails-3.1.1/Gemfile | |
--- rails-3.1.0/Gemfile 2011-10-07 12:07:06.000000000 -0400 | |
+++ rails-3.1.1/Gemfile 2011-10-07 12:59:13.000000000 -0400 | |
@@ -3 +3 @@ | |
-gem 'rails', '3.1.0' | |
+gem 'rails', '3.1.1' | |
@@ -14,3 +14,3 @@ | |
- gem 'sass-rails', " ~> 3.1.0" | |
- gem 'coffee-rails', "~> 3.1.0" | |
- gem 'uglifier' |
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
unbind C-b | |
set -g prefix C-a | |
set -g default-terminal "screen-256color" | |
set -g history-limit 5000 | |
bind C-a send-prefix | |
# force a reload of the config file | |
unbind r | |
bind r source-file ~/.tmux.conf |
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
$ irb | |
irb(main):001:0> module Mod1 | |
irb(main):002:1> def self.included base | |
irb(main):003:2> puts 'included Mod1' | |
irb(main):004:2> end | |
irb(main):005:1> end | |
=> nil | |
irb(main):006:0> module Mod2 | |
irb(main):007:1> def self.included base | |
irb(main):008:2> puts 'included Mod2' |
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 'textacular/searchable' | |
class Book | |
# :title, String | |
# :author, String | |
extend Searchable(:title) | |
end | |
Book.create :title => "Poignant Guide to Ruby", :author => "_why" |
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
sociable = ->(options = {}) { | |
resources :comments, options | |
resources :categories, options | |
resources :tags, options | |
} | |
resources :messages do sociable.(only: :create) end | |
resources :posts, &sociable | |
resources :items, &sociable |
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
--- /Library/Widgets/Weather.wdgt/Weather.js 2012-07-20 10:53:24.000000000 -0400 | |
+++ /Library/Widgets/Weather.wdgt/Weather.js 2012-07-20 10:53:40.000000000 -0400 | |
@@ -406,7 +406,7 @@ | |
if (entry != null) | |
{ | |
iconData.push(entry); | |
- maxOffset = entry.voffset > maxOffset ? entry.voffset : maxOffset; | |
+ // maxOffset = entry.voffset > maxOffset ? entry.voffset : maxOffset; | |
if (entry.hoffset < 0) |
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
class Address < ActiveRecord::Base | |
def self.order_proximity_to(latitude, longitude) | |
order(Arel::Nodes::Haversine.new(arel_table[:latitude], | |
arel_table[:longitude], | |
latitude, | |
longitude)) | |
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
$ time rspec --help > /dev/null | |
real 0m0.292s | |
user 0m0.221s | |
sys 0m0.064s | |
$ time ./bin/rspec --help > /dev/null | |
real 0m1.167s | |
user 0m1.017s | |
sys 0m0.137s |