Skip to content

Instantly share code, notes, and snippets.

View caseyhoward's full-sized avatar

Casey Howard caseyhoward

View GitHub Profile
@fib = Hash.new{ |hash, key| hash[key] = hash[key - 1] + hash[key - 2] }
@fib[0] = @fib[1] = 1
@fib[35]
@fib = Hash.new{ |hash, key| hash[key] = hash[key - 1] + hash[key - 2] }
@fib[0] = @fib[1] = 1
puts 0.upto(30).map {|x| @fib[x]}.join(' ')
def score(dice)
counts = (1..6).inject({}) do |counts, number|
counts[number] = dice.count(number)
counts
end
total = counts.inject(0) do |total, (number, count)|
if count >= 3
counts[number] -= 3
total += (number == 1 ? 1000 : 100) * number
end
p { background-color: green; }
@media max-device-width: 0px {
.hidden-by-link-tag-media-query {
display: none;
}
}
.shown-by-linked-stylesheet {
display: block;
}
img { background-image: url('/test.png'); }
.something { background-image: url('/test.png'); }
.imported-styles {
background-image: url('/imported.png');
}
@import "https://gist.github.com/caseyhoward/7124460/raw/29f31f2fe16591a88178f1d79296f0bd3dbcc969/imported.css"
/* .imported-styles {
* background-image: url('/imported.png');
* }
*/
@media (max-device-width: 0px) {
.hidden-by-link-tag-media-query {
display: none;
}
@import "https://gist.github.com/caseyhoward/7124460/raw/29f31f2fe16591a88178f1d79296f0bd3dbcc969/imported.css"
/* .imported-styles {
* background-image: url('/imported.png');
* }
*/
@media (max-device-width: 1px) {
.hidden-by-link-tag-media-query {
display: none;
}