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
f=IO. read( | |
__FILE__) .gsub(/[^ | |
\s]/x,?#);s= $**'loves';s | |
.upcase!;i=1;a =s.chars.uniq. | |
map{|c|s.count(c)};loop{b=''; | |
b<<"#{a.shift.to_i+a.pop.to_i | |
}"while(a.any?);d=b.to_i;a= | |
b.chars;d<101&&abort(d> | |
50?f:f.gsub(/^.*/){ | |
|s|i=13+i%3;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
v=$* | |
def p*a;puts a*' 'end | |
loop{a,b=v[0],v[6] | |
w=v.map &:to_i | |
p a,:attacks,b+?! | |
w[11]*rand/2>w[4]*rand ? (p b,:dodges!):(h=v[7]=w[7]-=d=[rand(w[2])-rand(w[9])/2,1].max | |
p a,:hits,b,:for,d,:damage! | |
p b,:has,h<1?"been slain!":"#{h} health left." | |
h<1&&exit) | |
v.rotate!6} |
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
<!DOCTYPE html> | |
<body> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/coffee-script/1.7.1/coffee-script.min.js"></script> | |
<script src="owl.coffee" type="text/coffeescript"></script> |
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
a=$<.map{|l|l.split.sort} | |
p a.count{|s|1==a.count(s)}-1 |
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
$F.map(&:size).max.times{|i|puts$F.map{|s|s[i]||' '}.join' '} |
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 Greeting | |
def greet(who) | |
"Hello #{who}" | |
end | |
end | |
class Hacker | |
include Greeting | |
def greet(who) |
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 Mapper < BasicObject | |
def initialize(enumerable) | |
@enumerable = enumerable | |
end | |
def method_missing(*args, &block) | |
@enumerable.map { |o| o.public_send(*args, &block) } | |
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
que | |
de | |
no | |
a | |
la | |
el | |
es | |
y | |
en | |
lo |
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
--color | |
--require spec_helper |
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
# "Proof" of https://twitter.com/tweetsauce/status/965259567322943490 | |
# 1 = 1! | |
# 2 = 2! | |
# 145 = 1! + 4! + 5! | |
# 40,585 = 4! + 0! + 5! + 8! + 5! | |
# These are the only four numbers with this property. | |
# Store the factorials from 0 to 9 for later use. | |
factorials = (0..9).map {|n| (1..n).inject(:*) || 1 } |
OlderNewer