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 'date' | |
DUE_DATE = "2012-02-15" | |
#data taken from http://spacefem.com/pregnant/charts/duedate2.php | |
#starts at day 222 | |
DATA = [ | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
1, 2, 1, 4, 2, 2, 1, 4, 6, 7, 5, 1, 5, 8, 7, 9, 10, 11, 13, 13, 18, | |
14, 13, 9, 27, 29, 27, 31, 27, 26, 36, 43, 43, 51, 67, 74, 60, 47, |
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
# use me to deliver emails plz kthx | |
class Notifier | |
class Job | |
def self.perform(name, args) | |
NotifierMailer.send(name, *deserialize(args)).deliver! | |
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
# IO speed tests on a new softlayer server using the cheap 500gb Sata drives. | |
#62500 blocks per gig | |
# want to double ram | |
# have 12gb, so want 24gb worth | |
# 62500 * 24 = 1500000 | |
root@koz-two:~# time sh -c "dd if=/dev/zero of=ddfile bs=16k count=1500000 && sync" | |
1500000+0 records in | |
1500000+0 records out |
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
root@koz-two:~# time sh -c "dd if=/dev/zero of=ddfile bs=16k count=500000 && sync" | |
500000+0 records in | |
500000+0 records out | |
8192000000 bytes (8.2 GB) copied, 96.6069 s, 84.8 MB/s | |
real 1m44.247s | |
user 0m0.092s | |
sys 0m16.049s | |
root@koz-two:~# time dd if=ddfile of=/dev/null bs=16k | |
500000+0 records in |
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 m(object=Object.new, pattern=nil) | |
methods = (object.public_methods(true) - Object.new.public_methods(true)).sort | |
methods = methods.grep pattern unless pattern.nil? | |
ObjectMethods.new(methods) | |
end | |
class ObjectMethods < Array | |
def inspect | |
puts sort |