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
// | |
// prototype-scriptaculous-hint-text.js | by Rick Branson -- Released into the public domain. | |
// | |
// Adds placeholder text above an input. Fades in and out. Is sexy. No kids. Not tested in IE (yet). | |
// | |
// $(element).hintText("string", { | |
// hiddenOpacity: the opacity of the placeholder text when it's hidden. (0.0 to 1.0) | |
// shownOpacity: the opacity of the placeholder text when it's shown. (0.0 to 1.0) | |
// effectDuration: the length (in seconds) of the fading effect, 0 turns it off. | |
// textPadding: the amount of text padding to use if none is explicitly set on |
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 use this, drop it into your lib directory and add a require to an initializer | |
# in config/initializers. | |
# | |
# This little extension to Mongoid allows belongs_to_related associations to | |
# have an "in" option, which will traverse the object graph to find the | |
# collection that will contain the related model object. | |
# | |
# The goal is to allow relations to be created that reference objects embedded | |
# in documents, instead of only objects that are contained within collections. |
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
#!/bin/sh | |
# | |
# Runs node.js against script, logging to a logfile. We have to do | |
# this because there's no way to call node directly and have start-stop-daemon | |
# redirect stdout to a logfile. | |
# | |
LOGFILE=/var/log/node/node-application.log | |
NODE=/usr/local/bin/node | |
JAVASCRIPT=/var/apps/node-application/app.js |
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 | |
if ARGV[0] == "autoconf" | |
puts "yes" | |
exit | |
end | |
if ARGV[0] == "config" | |
puts <<EOT | |
graph_title delayed_jobs |
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 | |
# | |
# Read's ABC's XML files for 2010 election totals and dumps them out. | |
# | |
# http://a.abcnews.com/xml/elections/2010/dynamic/dynamicgeneral/prod/elections/national/HouseMap.xml | |
# http://a.abcnews.com/xml/elections/2010/dynamic/dynamicgeneral/prod/elections/national/SenateMap.xml | |
# | |
# Copyright (c) 2010 Rick Branson | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
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
# Copyright (c) 2010 Richard Branson | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
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
wget -nv --limit-rate=150k --delete-after -p http://www.site.com/path/to/page |
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
# The Computer Language Benchmarks Game | |
# http://shootout.alioth.debian.org/ | |
# transliterated from Mario Pernici's Python program | |
# contributed by Rick Branson | |
require "rubygems" | |
require "gmp" | |
def gmpz(n) |
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
#!/bin/sh -x | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
git checkout master | |
git merge ${CURRENT} | |
git push origin master | |
git checkout ${CURRENT} |
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
#!/bin/sh -x | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
if [ "$CURRENT" == "master" ]; then | |
echo "Current branch is master!" | |
exit | |
fi | |
git checkout master |