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
#!/usr/bin/env ruby | |
unless ARGV.size == 1 | |
puts "git-stale-branches [days ago]" | |
exit | |
end | |
require 'date' | |
days_ago = ARGV.first.to_i |
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
namespace :spec do | |
namespace :units do | |
desc "Run unit specs with PATTERN in the spec file name" | |
RSpec::Core::RakeTask.new(:selective => "db:test:prepare") do |t| | |
t.pattern = FileList["spec/**/*#{ENV['PATTERN']}*_spec.rb"].exclude("spec/integration/**/*_spec.rb") | |
end | |
end | |
namespace :integration do | |
desc "Run integration specs with PATTERN in the spec file name" |
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
#!/usr/bin/env ruby | |
# To use this: | |
# * Set up the jshint Gem with your Rails app: https://github.com/liquid/jshint_on_rails | |
# * Copy this file to [YOURPROJECT]/.git/hooks/pre-commit | |
# * chmod 0755 .git/hooks/pre-commit | |
files_changed = `git diff --name-only HEAD` | |
if files_changed.any? { |line| line =~ %r|public/javascripts| } | |
puts "Running jshint to check changes to javascript ..." |
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
0.000000 67.214.211.240 -> 208.85.151.4 DNS Standard query AAAA app.profitably.com | |
0.038723 208.85.151.4 -> 67.214.211.240 DNS Standard query response | |
0.038903 67.214.211.240 -> 208.85.151.4 DNS Standard query AAAA app.profitably.com.blueboxgrid.com | |
0.040013 208.85.151.4 -> 67.214.211.240 DNS Standard query response, No such name | |
0.040165 67.214.211.240 -> 208.85.151.4 DNS Standard query A app.profitably.com | |
0.079842 208.85.151.4 -> 67.214.211.240 DNS Standard query response A 208.85.144.70 | |
0.080195 67.214.211.240 -> 208.85.144.70 TCP 59764 > https [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=3099548928 TSER=0 WS=7 | |
0.080386 208.85.144.70 -> 67.214.211.240 TCP https > 59764 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460 WS=4 | |
0.080415 67.214.211.240 -> 208.85.144.70 TCP 59764 > https [ACK] Seq=1 Ack=1 Win=5888 Len=0 | |
0.090365 67.214.211.240 -> 208.85.144.70 SSL Client Hello |
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
18.356621 67.214.211.240 -> 208.85.151.4 DNS Standard query AAAA app.profitably.com | |
18.357004 208.85.151.4 -> 67.214.211.240 DNS Standard query response | |
18.357079 67.214.211.240 -> 208.85.151.4 DNS Standard query AAAA app.profitably.com.blueboxgrid.com | |
18.357454 208.85.151.4 -> 67.214.211.240 DNS Standard query response, No such name | |
18.357535 67.214.211.240 -> 208.85.151.4 DNS Standard query A app.profitably.com | |
18.357956 208.85.151.4 -> 67.214.211.240 DNS Standard query response A 208.85.144.70 | |
18.358148 67.214.211.240 -> 208.85.144.70 TCP 55367 > https [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=2257194637 TSER=0 WS=7 | |
18.358274 208.85.144.70 -> 67.214.211.240 TCP https > 55367 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460 WS=4 | |
18.358296 67.214.211.240 -> 208.85.144.70 TCP 55367 > https [ACK] Seq=1 Ack=1 Win=5888 Len=0 | |
18.367894 67.214.211.240 -> 208.85.144.70 SSL Client Hello |
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 read_only_struct(*attrs) | |
c = Class.new | |
eval_me = <<-CLASS_EVAL_OH_NOES | |
def initialize(#{attrs.map { |sym| sym.to_s }.join(', ')}) | |
#{attrs.map { |attr| "@#{attr} = #{attr}" }.join("\n")} | |
end | |
attr_reader #{attrs.map { |sym| ":#{sym.to_s}" }.join(', ')} | |
CLASS_EVAL_OH_NOES | |
c.class_eval eval_me |
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 NilClass | |
def foobar=(fb) | |
@foobar = fb | |
end | |
def foobar_is_true? | |
@foobar == nil? | |
end | |
end |