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 'rspec' | |
module Dog | |
def self.bark | |
"Woof!" | |
end | |
end | |
describe "Rspec re-setting stubs on classes" do | |
it "should return 'Woof!'" 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
fsync = false | |
full_page_writes = false | |
bgwriter_lru_maxpages = 0 | |
autovacuum = off |
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
(ns euler.p8) | |
(defn ones-digit-of | |
[number] | |
(mod number 10)) | |
(defn shift-digit-from | |
[number] | |
(/ (- number (ones-digit-of number)) 10)) |
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
I'm giving a talk on Ruby at EAFIT in Medellin next week! Below are the details: | |
Fecha: Martes 24 de julio | |
Hora: 6:00 a 7:00 PM | |
Lugar:27-103 | |
It's open to the public, but if you're not with the university tweet me and I'll forward your name to the University so that you can be put on the list for security. | |
My cell phone is 320-652-4001, call me if you have any problems getting in or questions about the event and I'll see what I can do to help. You can also tweet @justinleitgeb with any questions or comments. |
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
for bottle in `brew list` ; do brew remove $bottle && brew install $bottle ; done |
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
class Node | |
attr_accessor :next, :name | |
end | |
a = Node.new | |
b = Node.new | |
c = Node.new | |
a.next = b | |
b.next = c |
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 'rspec' | |
class Node | |
attr_accessor :next | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
end |
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
class Node | |
attr_accessor :next | |
end | |
a = Node.new | |
b = Node.new | |
c = Node.new | |
a.next = b | |
b.next = c |
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 'minitest/autorun' | |
# Demonstrates the way that refinements are applied in Ruby 2.0.0preview1. | |
module RegularStringCounts | |
refine String do | |
def num_caps | |
self.scan(/[A-Z]/).count | |
end | |
end |
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
# These MIME types, which we don't use, are vulnerable per CVE-2013-0156 | |
ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML) | |
ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::YAML) |