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
#!/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): |
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
openssl rand -base64 40 |
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
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 |
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
// 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() { |
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
# | |
# 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') |
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
# | |
# 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' |