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 Reloader | |
def run_callbacks(*args) | |
case args.first.to_sym | |
when :prepare | |
# allow call to ActionDispatch.prepare! | |
# or when source was updated | |
# cleanup before every preload | |
if @app.nil? or changed? | |
reset! | |
super(:cleanup) |
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
# Set Apple Terminal.app resume directory | |
if [[ $TERM_PROGRAM == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then | |
autoload -U add-zsh-hook | |
function lion_resume_chpwd { | |
# add support for OS X Lion window resume on Terminal.app relaunch | |
# straight port from /etc/bashrc on Lion | |
local SEARCH=' ' | |
local REPLACE='%20' | |
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" |
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
; <<>> DiG 9.7.3-P3 <<>> developer.maxdome.de | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26621 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;developer.maxdome.de. IN A | |
;; ANSWER SECTION: |
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
; <<>> DiG 9.7.3-P3 <<>> +trace developer.maxdome.de | |
;; global options: +cmd | |
. 60 IN NS e.root-servers.net. | |
. 60 IN NS f.root-servers.net. | |
. 60 IN NS g.root-servers.net. | |
. 60 IN NS h.root-servers.net. | |
. 60 IN NS i.root-servers.net. | |
. 60 IN NS j.root-servers.net. | |
. 60 IN NS k.root-servers.net. |
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
Feature: Provider billing mode on | |
In order to bill active users | |
As a buyer | |
I don't want to be billed when I'm not active | |
Background: | |
Given the date is 10th January 2011 | |
Given a provider "xyz.example.com" with billing enabled | |
And an application plan "Fixed" of provider "xyz.example.com" for 100 monthly |
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
framework "CoreWLAN" | |
iface = CWInterface.interface | |
iface.disassociate | |
wlans = iface.scanForNetworksWithParameters(nil, error: nil) | |
wlan = wlans.find {|w| w.ssid == "WLAN_724A"} | |
p [wlan.bssid, wlan.ssid, wlan.securityMode, wlan.wlanChannel.channelNumber] | |
keys = File.read("./dictionary.txt").lines.to_a.reverse |
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 instance_method_already_implemented?(method_name) | |
method_name = method_name.to_s | |
return true if method_name =~ /^id(=$|\?$|$)/ | |
@_defined_class_methods ||= ancestors.first(ancestors.index(ActiveRecord::Base)).sum([]) { |m| m.public_instance_methods(false) | m.private_instance_methods(false) | m.protected_instance_methods(false) }.map(&:to_s).to_set | |
@@_defined_activerecord_methods ||= (ActiveRecord::Base.public_instance_methods(false) | ActiveRecord::Base.private_instance_methods(false) | ActiveRecord::Base.protected_instance_methods(false)).map(&:to_s).to_set | |
raise DangerousAttributeError, "#{method_name} is defined by ActiveRecord" if @@_defined_activerecord_methods.include?(method_name) | |
@_defined_class_methods.include?(method_name) | |
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
diff --git a/test/test_helpers/redis.rb b/test/test_helpers/redis.rb | |
index 3ba8649..fd0fa1e 100644 | |
--- a/test/test_helpers/redis.rb | |
+++ b/test/test_helpers/redis.rb | |
@@ -1,7 +1,13 @@ | |
+require 'backend/storage' | |
+ | |
module TestHelpers | |
module Redis | |
private |
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
var d = new Date() | |
var h = d.getHours() | |
if (h < 5){ | |
document.write("Today is ") | |
} | |
else | |
if (h < 9){ | |
document.write("Today is ") | |
} |
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
NoMethodError: | |
undefined method `split' for ["blob"]:Array | |
# /Users/mikz/.rvm/gems/ruby-1.9.3-p125-falcon@thesis/gems/rspec-expectations-2.9.0/lib/rspec/expectations/differ.rb:13:in `diff_as_string' | |
# /Users/mikz/.rvm/gems/ruby-1.9.3-p125-falcon@thesis/gems/rspec-expectations-2.9.0/lib/rspec/expectations/fail_with.rb:25:in `fail_with' | |
# /Users/mikz/.rvm/gems/ruby-1.9.3-p125-falcon@thesis/gems/rspec-expectations-2.9.0/lib/rspec/expectations/handler.rb:17:in `handle_matcher' | |
# /Users/mikz/.rvm/gems/ruby-1.9.3-p125-falcon@thesis/gems/rspec-expectations-2.9.0/lib/rspec/expectations/extensions/kernel.rb:12:in `should' | |
# /Users/mikz/.rvm/gems/ruby-1.9.3-p125-falcon@thesis/gems/rspec-core-2.9.0/lib/rspec/core/subject.rb:54:in `should' | |
# ./spec/test_spec.rb:5:in `block (2 levels) in <top (required)>' |