This file contains hidden or 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
02:53 <@kylev> anyone awake? | |
02:55 <@emopants> no | |
02:55 <@kylev> can you reach www.change.org? | |
02:56 <@emopants> no | |
02:56 <@emopants> 10 AMAZON.COM.edge2.Washington1.Level3.net (4.79.22.2) 95.528 ms | |
AMAZONCOM.edge2.Washington1.Level3.net (4.79.22.10) 96.821 ms | |
AMAZONCOM.edge2.Washington1.Level3.net (4.79.230.46) 96.502 ms | |
02:56 <@emopants> 11 * * * | |
02:57 <@emopants> looks like the amazon cloud is angry | |
02:57 <@emopants> 8 vadata-gw.ip4.tinet.net (173.241.128.46) 114.560 ms 112.409 ms |
This file contains hidden or 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
diff --git a/lib/core_extensions/action_controller_request.rb b/lib/core_extensions/action_controller_request.rb | |
index fcd578c..08bdd4a 100644 | |
--- a/lib/core_extensions/action_controller_request.rb | |
+++ b/lib/core_extensions/action_controller_request.rb | |
@@ -7,4 +7,11 @@ class ActionController::Request | |
end | |
end | |
+ | |
+ BASE_CHANGE_DOMAIN = ENV['BASE_URL'].split(':')[0] |
This file contains hidden or 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
DATABASE_YAML = <<-YML | |
defaults: &defaults | |
adapter: mysql2 | |
username: root | |
password: | |
host: localhost | |
port: 3306 | |
development: | |
<<: *defaults |
This file contains hidden or 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
timed_loop_batch(0.25, 1000, 100) do |batch_size| | |
changed = GiantMetric.connection.update_sql("DELETE FROM giant_metrics WHERE created_at <= #{1.month.ago} LIMIT #{batch_size}") | |
break if changed < batch_size | |
end |
This file contains hidden or 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 Capybara | |
class Session | |
# `execute_script` variant that first waits for jQuery's $ to be defined. | |
def execute_jquery(script) | |
synchronize_javascript("$ !== 'undefined'") | |
execute_script(script) | |
end | |
# `evaluate_script` variant that first waits for jQuery's $ to be defined. |
This file contains hidden or 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 Object | |
def wtf! | |
raise (self.respond_to?(:pretty_inspect) ? self.pretty_inspect : self.inspect) | |
end | |
end |
This file contains hidden or 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
# Create happily takes IO-like objects as body. | |
file = directory.files.create( | |
:key => 'giant_linux_distro.iso', | |
:body => File.open("nightly.iso"), # No ma! No read()! | |
:public => true | |
) | |
# Get will take a block for streamy goodness. | |
directory.files.get("giant_thing.bin") do |chunk, remaining, total| | |
output.write(chunk) |
This file contains hidden or 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 | |
# Some members of ruby community continue to misunderstand the interplay of | |
# signal handlers and exception handling. This is a brief exploration | |
# via examples. You can run them by uncommenting the invocations at | |
# the bottom. You can see their behavior with Ctrl-C. | |
# | |
# Some of the examples will require a kill -9 from another terminal to | |
# stop. | |
# |
This file contains hidden or 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
function noBar() { | |
console.log(bar()); | |
} | |
// ReferenceError: bar is not defined | |
function hoistedVar() { | |
console.log(bar()); | |
var bar = function() { | |
return 42; |
This file contains hidden or 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
/** | |
* MIDI Visual Metronome | |
* | |
* Developed on Sparkfun Uno R3 and Sparkfun MIDI Shield. | |
* | |
* Reqires the popular FortySevenEffects MIDI library: | |
* https://github.com/FortySevenEffects/arduino_midi_library | |
* | |
* The intended application is with MIDI and electronic music in | |
* a situation where proper stage or in-ear monitors are not |
OlderNewer