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/ruby | |
# | |
# Usage: ftp-backup.rb <directory> <filename> | |
# Example: ftp-backup.rb /home/jwood/backup/ my_important_file | |
require 'net/ftp' | |
NUM_BACKUPS = 7 | |
directory_name = ARGV[0] |
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/ruby | |
# | |
# This script assumes that you have either 0 or 1 pgbackups stored | |
# on Heroku, and that you already have the heroku gem installed | |
# and configured on your system. | |
# | |
PROJECT_DIRECTORY = "/home/jwood/dev/myproj" | |
BACKUP_FILE = "/home/jwood/backup/myproj.dump" |
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
class Car | |
include MongoMapper::Document | |
include Tenacity | |
t_has_many :wheels | |
t_has_one :dashboard | |
end | |
class Wheel < ActiveRecord::Base | |
include Tenacity |
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
// ==UserScript== | |
// @name Campfire Audio Notification | |
// @namespace http://johnpwood.net | |
// @description Play a sound when a message is received from a specific user or when it contains a specific word. | |
// @author John Wood | |
// @homepage http://johnpwood.net | |
// @include *.campfirenow.com/room* | |
// ==/UserScript== | |
try { if ( typeof(Campfire) != "undefined" ) { |
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/bash | |
dev_dir=/Users/jwood/dev | |
for d in `ls $dev_dir`; do | |
test -d $dev_dir/$d/log | |
if [ $? -eq 0 ]; then | |
for f in `ls $dev_dir/$d/log/*.log`; do | |
> $f | |
done |
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/bash | |
# | |
# This script surrounds the command passed in with start and finish notifications | |
# to the Proby task monitoring application. | |
# | |
# | |
# === SETUP | |
# | |
# * Make sure the proby script is executable. | |
# |
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/bash | |
# | |
# DESCRIPTION | |
# Slowly delete a file by truncating it by a small amount every half second | |
# until the file is eventually deleted. This should prevent the system from | |
# freaking out when attempting to delete a single, large file. | |
# | |
# USAGE | |
# fade.sh <file> | |
# |
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
<?php | |
$PROBY_API_KEY = 'secret'; | |
function do_post_request($url, $data, $headers) { | |
$postdata = http_build_query($data); | |
$header_string = ""; | |
foreach ($headers as $key => $value) { | |
$header_string .= $key . ": " . $value . "\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
# SSH to one of the production servers | |
capssh -e production | |
# Shortcut for SSHing into one of the production servers | |
capssh production | |
# SSH to the production server that is in the db role | |
capssh -e production -r db | |
# If you only have one server defined, you can connect to it by simply running capssh |
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
first("#foo").click | |
expect(first(".message").value).to eql("Loaded successfully") |
OlderNewer