View ec2env.sh
#!/bin/sh | |
# | |
# ec2env.sh | |
# mnmldave | |
# | |
# Switch between EC2_PRIVATE_KEY and EC2_CERT environment variables. Licensed under | |
# WTFPL v2.0. | |
# | |
# Installation (you'll have to open a new terminal after installing): |
View gist:2979219
openssl rand -base64 40 |
View gist:1463847
driver = WebDriver.for(:remote, :url => Helper.grid, :desired_capabilities => caps) | |
width = 1024 | |
height = 768 | |
# Resize window. In Firefox and Chrome, must create a new window to do this. | |
# http://groups.google.com/group/webdriver/browse_thread/thread/e4e987eeedfdb586 | |
case driver.capabilities[:browser_name] | |
when 'firefox', 'chrome' | |
handles = driver.window_handles |
View bit155-history.js
// Adds click event handlers to all the pager links within some content element, c. | |
function prepareContent(c) { | |
$('ul.pager a', c).each(function(i,e) { | |
var $e = $(e), | |
path = $e.attr('href'), | |
base = Drupal.settings.basePath, | |
regex = '^' + base.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | |
if (path && path.match(regex)) { | |
$e.click(function() { |
View Rakefile
# | |
# Sample rake task for starting a Thin rack server for a PHP application (like | |
# Wordpress or Drupal or whatever). | |
# | |
# Requires php-cgi be available on path (I used homebrew on my mac to install | |
# php since it doesn't come pre-installed) and gems 'thin', 'rack' and | |
# 'rack-legacy'. | |
# | |
BASE_PATH = File.expand_path(File.dirname(__FILE__)) | |
SRC_PATH = File.join(BASE_PATH, 'src') |
View index_to_column.rb
# | |
# Converts a number into a column name like in Excel. For example, | |
# | |
# index_to_column(0) = 'A' | |
# index_to_column(1) = 'B' | |
# index_to_column(2) = 'C' | |
# ... | |
# index_to_column(25) = 'Z' | |
# index_to_column(26) = 'AA' | |
# index_to_column(27) = 'AB' |