Skip to content

Instantly share code, notes, and snippets.

View NZKoz's full-sized avatar

Michael Koziarski NZKoz

View GitHub Profile
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
# 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
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 148ea53..fc68d00 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -406,7 +406,7 @@ Run `rake gems:install` to install the missing gems.
# Eager load application classes
def load_application_classes
- return if $rails_rake_task
+ return if $rails_rake_task && configuration.dependency_loading
class Array
def pop_rand
delete(rand(size))
end
end
arr = (1..500).to_a
4.times do
puts arr.pop_rand
# Back Port of ActiveSupport::Concern
# Copyright (c) 2005-2010 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
irb(main):001:0> module Foo
irb(main):002:1> extend self
irb(main):003:1> def bar
irb(main):004:2> 1
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0> Foo.bar
=> 1
irb(main):008:0> module Bar
<ul>
<% @users.each do |user| %>
<li><%= link_to user.name, user %></li>
<% end %>
</ul>
<script>
jQuery(function($) {
$("a").click(function(event) {
event.preventDefault();
@NZKoz
NZKoz / gist:608901
Created October 3, 2010 20:32 — forked from nikz/gist:608899
# use me to deliver emails plz kthx
class Notifier
class Job
def self.perform(name, args)
NotifierMailer.send(name, *deserialize(args)).deliver!
end
end
@NZKoz
NZKoz / crash_report.txt
Created November 24, 2010 19:42
Awesomest Crash Report ever
Interval Since Last Panic Report: 807314 sec
Panics Since Last Report: 1
Anonymous UUID: 518467BE-F1A3-4E55-AA3D-48AF32563036
Thu Nov 25 08:34:51 2010
panic(cpu 1 caller 0x28f16b): "pmap_flush_tlbs() timeout: " "cPu(an)i (CPUf0)a Ungrespto rnssiond te in epruprocsss, pap=
EAX: 0xModel: MacBook5,1, BootROM MB51.007D.B03, 2 processors, Intel Core 2 Duo, 2.4 GHz, 4 GB, SMC 1.32f8
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.10.131.36.1)
<object id="myExperience12345" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="486" />
<param name="height" value="412" />
<param name="playerID" value="12345" />
<param name="playerKey" value="BLAHBLAH" />
<param name="isVid" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="@videoPlayer" value="123456" />