Movie | Recommended by |
---|---|
Initial D | @dabunter |
Coffee and Cigarettes | @borncamp |
The Garbage Pail Kids Movie | @munchingzombie |
Robo Vampire | @munchingzombie |
Gymkata | @munchingzombie |
Food Fight (?) | @munchingzombie |
What Is It? | @munchingzombie |
Watermelon Man | @fuzzleonard |
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
CHAR_TO_CELL = { '_' => :unknown, 'x' => :empty, '#' => :full, '?' => :multiple } | |
CELL_TO_CHAR = { empty: 'X', full: '#', multiple: '_', unknown: '_' } | |
def expand_row raw_row | |
split = raw_row.split /([_X#]\d*)/ | |
items = split.reject { |s| s == '' } | |
items.map do |item| | |
item[0] * [1, item[1..-1].to_i].max | |
end.join.split('').map { |c| CHAR_TO_CELL[c] } |
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
{ | |
"origin": ["Did you know that #fact# #what# because of #reason#? Apparently #cause#."], | |
"fact": [ | |
"the #odd-season# Equinox", | |
"the #even-season# #even-event#", | |
"the #timing# #sun-event#", | |
"Daylight #savings# Time", | |
"Leap #leap#", | |
"Easter", |
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
require 'fiber' | |
require 'pp' | |
class MyWrapper | |
include Enumerable | |
def initialize | |
@fiber = fiber | |
@results = [] | |
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
inputs = [[:sensor, "input1", 0], [:sensor, "input2", 1], [:sensor, "input3", 2], [:sensor, "input4", 3], [:sensor, "input5", 4], [:sensor, "input6", 5], [:sensor, "input7", 6], [:sensor, "input8", 7], [:sensor, "input9", 8], [:sensor, "input10", 9], [:sensor, "input11", 10], [:sensor, "input12", 11], [:sensor, "input13", 12], [:sensor, "input14", 13], [:sensor, "input15", 14], [:sensor, "input16", 15], [:sensor, "input17", 16], [:sensor, "input18", 17], [:sensor, "input19", 18], [:sensor, "input20", 19]] | |
outputs = [[:effector, "output1", 0], [:effector, "output2", 39], [:effector, "output3", 40], [:effector, "output4", 41], [:effector, "output5", 42], [:effector, "output6", 43], [:effector, "output7", 44], [:effector, "output8", 45], [:effector, "output9", 46], [:effector, "output10", 47], [:effector, "output11", 48], [:effector, "output12", 49], [:effector, "output13", 50], [:effector, "output14", 51], [:effector, "output15", 52], [:effector, "output16", 53], [:effector, "output17", 54], [:effector, "outp |
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
def priority(n) | |
WireMind::Circuits::Circuit.new.tap do |priority| | |
# I/O | |
inputs = (1..n).map { |idx| priority.input("input#{idx}") } | |
outputs = (1..n).map { |idx| priority.output("output#{idx}") } | |
# Nodes |
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 Bash | |
def self.clear | |
print "\e[H\e[2J" | |
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
#!/usr/bin/env ruby | |
#------------------------------------------------------------------------------ | |
# Aggregate Print useful information from /proc/[pid]/smaps | |
# | |
# pss - Roughly the amount of memory that is "really" being used by the pid | |
# swap - Amount of swap this process is currently using | |
# | |
# Reference: | |
# http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361 |
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 Kernel | |
def object_count_change(root = ActiveRecord::Base) | |
before = Hash.new(0).tap { |hash| ObjectSpace.each_object(root) { |obj| hash[obj.class.to_s] += 1 } } | |
yield | |
after = Hash.new(0).tap { |hash| ObjectSpace.each_object(root) { |obj| hash[obj.class.to_s] += 1 } } | |
Hash.new.tap do |change| | |
all_keys = (before.keys + after.keys).uniq.sort | |
all_keys.each { |key| change[key] = after[key] - before[key] } | |
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
require 'set' | |
class Bindings | |
################ | |
# # | |
# Declarations # | |
# # | |
################ | |
NewerOlder