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
// This block of code injects our source in the content scope and then calls the | |
// passed callback there. The whole script runs in both GM and page content, but | |
// since we have no other code that does anything, the Greasemonkey sandbox does | |
// nothing at all when it has spawned the page script, which gets to use jQuery. | |
// (jQuery unfortunately degrades much when run in Mozilla's javascript sandbox) | |
(function(run_me_in_page_scope) { | |
if ('undefined' == typeof __RUNS_IN_PAGE_SCOPE__) { // unsandbox, please! | |
var src = arguments.callee.caller.toString(), | |
script = document.createElement('script'); | |
script.setAttribute("type", "application/javascript"); |
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 | |
# | |
# Sometimes massive failure can cause JsTestDriver to hang | |
# To debug those cases, it's easier to run test cases one by one | |
# to track which test case is causing trouble. | |
# | |
# This script also helps test less capable browsers such as IE6, | |
# which can get overwhelmed while trying to run too many tests too | |
# rapidly. | |
# |
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 | |
# | |
# Uses Stas Malyshev's migrate.php script to check code style | |
# | |
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' | |
version = %x{#{ENV['TM_PHP'] || 'php'} -v}.split[0..2].join(' ') | |
result = `#{ENV['TM_PHP'] || 'php'} /Users/olle/opensource/php/migrate/migrate.php '#{ENV['TM_FILEPATH']}'` | |
result.gsub!("in file #{ENV['TM_FILEPATH']}", '') | |
puts "OK!" if result.empty? | |
puts result |
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
# To install the Python client library: | |
# pip install -U selenium | |
# Import the Selenium 2 namespace (aka "webdriver") | |
from selenium import webdriver | |
# iPhone | |
driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub') | |
# Android |
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 "csv" | |
class HerokuEnvLogger | |
PREFIX = "HerokuRequest" | |
TIME_STEP = 1.minute * 1000 # ms | |
EXPIRE_IN = 6.hours | |
KEYS = %w[HTTP_X_REQUEST_START | |
HTTP_X_HEROKU_QUEUE_WAIT_TIME | |
HTTP_X_HEROKU_QUEUE_DEPTH | |
HTTP_X_HEROKU_DYNOS_IN_USE] |
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 | |
# update git submodules | |
`git submodule init && git submodule update` | |
# update symlinks | |
# inspired by http://errtheblog.com/posts/89-huba-huba | |
home = File.expand_path('~') |
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
Show hidden characters
{ | |
"cmd": ["buster-test", "--reporter", "xUnitConsole", "--color", "none"], | |
"working_dir": "${project_path}", | |
"selector": "source.js", | |
"file_regex": "@(.*?):([0-9]*)" | |
} |
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
(ns ring.middleware.x-forwarded-for | |
(:use [clojure.string :only (split)])) | |
(defn wrap-x-forwarded-for [handler] | |
(fn [request] | |
(if-let [xff (get-in request [:headers "x-forwarded-for"])] | |
(handler (assoc request :remote-addr (last (split xff #"\s*,\s*")))) | |
(handler request)))) |
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
start westeros=node(0) | |
set westeros.name = "Westeros" | |
create targaryen={house:"Targaryen"}, | |
stark={house:"Stark"}, | |
lannister={house:"Lannister"}, | |
baratheon={house:"Baratheon"}, | |
tully={house:"Tully"} |
OlderNewer