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
#!/usr/bin/ruby | |
puts " " * 22 + "*" | |
puts " " * 21 + "*" * 3 | |
puts " " * 20 + "*" * 5 | |
puts " " * 19 + "*" * 7 | |
puts " " * 18 + "*" * 9 | |
puts " " * 17 + "*" * 11 | |
puts " " * 16 + "*" * 13 | |
puts " " * 15 + "*" * 15 |
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
puts " *" | |
puts " ***" | |
puts " *****" | |
puts " *******" | |
puts " *********" | |
puts " ***********" | |
puts " *************" | |
puts " ***************" | |
puts " *****************" | |
puts " *******************" |
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
#!/usr/bin/ruby | |
secret = rand(100) | |
100.times { | |
puts "guess the secret number" | |
guess = gets.to_i | |
if secret == guess |
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
mystery = methods.sample; send mystery, *Array.new(method(mystery).arity.abs) { ObjectSpace.each_object.to_a.sample } |
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
expect(fstab_file.content).to satisfy('ext filesystems panic on error') { |content| | |
content.lines.all? { |line| | |
line !~ /ext[234]/ or | |
line =~ /ext[234].*errors=panic/ | |
} | |
} |
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
it 'fstab mountpoints have correct options' do | |
expect(fstab_file.lines).to be_all { |line| | |
line !~ /ext[234]/ or | |
line =~ /ext[234].*errors=panic/ | |
} | |
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 Foo | |
attr_accessor :bar | |
def initialize | |
@bar = 99 | |
end | |
def baz | |
puts bar | |
bar += 1 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
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVrrrrrrrrrrrrr | |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVrrrrrrrrrrrrr | |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV |
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
353, 177 | |
233, 332 | |
178, 231 | |
351, 221 | |
309, 151 | |
105, 289 | |
91, 236 | |
321, 206 | |
156, 146 | |
94, 82 |
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
booger:2 evan$ time perl star_two_perl <input | |
line oeylbtcxjqnzhgyyylfapviusr | |
inner oeylbtcxjqnzhgkyylfapviusr | |
real 0m0.010s | |
user 0m0.006s | |
sys 0m0.003s | |
booger:2 evan$ time ruby star_two_ruby < input | |
star_two_ruby:12:in `block (2 levels) in <main>': line oeylbtcxjqnzhgyyylfapviusr (RuntimeError) | |
inner oeylbtcxjqnzhgkyylfapviusr |