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 | |
require 'rubygems' | |
require 'eventmachine' | |
require 'open-uri' | |
require 'json' | |
def fetch_ticker | |
content = open("https://mtgox.com/api/1/BTCUSD/ticker").read | |
result = JSON.parse(content) |
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 | |
# tunnel.sh | |
# Configure | |
LOCAL_HOST=127.0.0.1; | |
USERNAME="your_username"; | |
# set your remote address and SSH port. | |
TUNNEL_PORT="2022" | |
REMOTE_HOST="my.homedomainorip.com -p $TUNNEL_PORT"; |
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 ToHaml | |
def initialize(path) | |
@path ||= path | |
end | |
def convert! | |
Dir["#{@path}/**/*.erb"].each do |file| | |
`html2haml -rx #{file} #{file.gsub(/\.erb$/, '.haml')}` | |
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
/** | |
* Implementation of moduleName_preprocess_hook(). | |
* | |
* Replace Drupal core's jquery.js with the new one from jQuery Update module. | |
*/ | |
function jquery_update_preprocess_page(&$variables) { | |
// Only do this for pages that have JavaScript on them. | |
if (!empty($variables['scripts'])) { | |
// Perform the logic if either jQuery Update's jquery.js is newer than |
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
// This jQuery plugin will cause the targeted | |
// elements to rumble when they are moused over. | |
(function($) { | |
// Default config options | |
$.fn.rumble = function(conf){ | |
var config = $.extend({}, $.fn.rumble.defaults, conf); | |
// Loop over each of the elements in the jQuery | |
// stack so that we can set up the properties | |
// for the individual elements. | |
return this.each(function(){ |