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
Without magical change: | |
real 0m26.563s | |
user 0m26.182s | |
sys 0m0.192s | |
With magical change: | |
real 0m2.215s | |
user 0m2.024s |
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 Parslet::Atoms | |
class Context | |
def cache(obj, source, &block) | |
yield | |
end | |
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
$ autotest | |
/home/djwhitt/.rbenv/versions/1.9.3-p125/bin/ruby -I.:lib:test -rubygems -e "%w[helper test/helper.rb test/test_foo.rb].each { |f| require f }" | |
Run options: --seed 60917 | |
# Running tests: | |
. | |
Finished tests in 0.000344s, 2904.3004 tests/s, 2904.3004 assertions/s. |
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
Test gist |
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
// | |
// Make Jasmine think this is a browser | |
// | |
setTimeout = function(fn) { fn(arguments); }; | |
clearTimeout = function() {}; | |
setInterval = function() {}; | |
clearInterval = function() {}; |
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
task :a do | |
puts "hi" | |
end | |
Rake.application.lookup(:a).clear | |
task :a do | |
puts "hello" | |
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
[1, 2, 3].each do |x| | |
x # => | |
end | |
# C-c C-f ... | |
[1, 2, 3].each do |x| | |
x # => 1, 2, 3 | |
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
include_recipe "apache2" | |
["htdocs", "src"].each do |dir| | |
directory "/srv/www/rdoc.spcom.org/#{dir}" do | |
owner "root" | |
group "root" | |
mode "0755" | |
recursive true | |
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
Host * | |
ControlPath ~/.ssh/master-%l-%r@%h:%p | |
ControlMaster auto |
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
(defn palindrome? [x] | |
(let [s (.toString x) | |
l (.length s)] | |
(if (or (= l 0) (= l 1)) | |
true | |
(if (= (.charAt s 0) (.charAt s (- l 1))) | |
(palindrome? (.substring s 1 (- l 1))) | |
false)))) | |
(defn products [] |