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
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb | |
# and made a lot more robust by me | |
# this implementation uses erb by default. if you want to use any other template mechanism | |
# then replace `erb` on line 13 and line 17 with `haml` or whatever | |
module Sinatra::Partials | |
def partial(template, *args) | |
template_array = template.to_s.split('/') | |
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}" | |
options = args.last.is_a?(Hash) ? args.pop : {} | |
options.merge!(:layout => false) |
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
# Hoptoad integration example. | |
task "deploy:before" => "isolate:dotgems" do | |
if /\.gems/ =~ `git status` | |
abort "Changed gems. Commit '.gems' and deploy again." | |
end | |
ENV["TO"] = Deploy.env | |
end |
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 -e | |
# | |
# Usage: browser | |
# pipe html to a browser | |
# e.g. | |
# $ echo '<h1>hi mom!</h1>' | browser | |
# $ ron -5 man/rip.5.ron | browser | |
if [ -t 0 ]; then | |
if [ -n "$1" ]; then |
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
" Vim syntax file | |
" Language: Soy Templates | |
" Maintainer: Rodrigo Machado rcmachado@gmail.com | |
" Last Change: Thu Apr 15 16:59:00 GMT 2010 | |
" Filenames: *.soy | |
" URL: http://gist.github.com/gists/367358/download | |
" | |
" Based on Smarty.vim | |
" For version 5.x: Clear all syntax items |
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
#!/opt/local/bin/ruby -w | |
# git clone http://github.com/jjl/get_iplayer.git ~/Workspace/bin/get_iplayer/get_iplayer | |
# curl http://ftp.twaren.net/Unix/NonGNU/flvstreamer/macosx/flvstreamer_macosx_intel_32bit_latest --output ~/Workspace/bin/flvstreamer | |
# chmod 755 ~/Workspace/bin/flvstreamer | |
GET_IPLAYER = "~/Workspace/bin/get_iplayer/get_iplayer" | |
IPLAYER_CACHE = "~/.get_iplayer/radio.cache" | |
IPLAYER_HISTORY = "~/.get_iplayer/download_history" | |
FLVSTREAMER = "~/Workspace/bin/flvstreamer" | |
DOWNLOAD_PATH = "~/Music/BBC" |
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 | |
# originally from http://stackoverflow.com/questions/3143575/list-the-files-i-own-in-subversion/3144017 | |
set -e | |
for file in `svn ls -R`; do | |
if [ -f $file ]; then | |
owner=`svn blame $file | tr -s " " " " | cut -d" " -f3 | sort | uniq -c | sort -nr | head -1 | tr -s " " " " | cut -d" " -f3` | |
if [ $owner ]; then | |
echo $file $owner |
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
--- SHDH statistics --- | |
42 parties transmitted, 41 parties received, 0.2% party loss | |
party min/avg/max/stddev = 21/47.976/105/17.097 days |
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 | |
/** | |
* Compares all running instances to all reserved instances and reports | |
* utilization. Useful for making sure you're not wasting money. :P | |
* | |
* Requires EC2_CERT and EC2_PRIVATE_KEY environment variables to be set. | |
* | |
* @author Dave | |
* @date 2010-10-05 | |
*/ |
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 -e | |
# Usage: license | |
# Prints an MIT license appropriate for totin' around. | |
# | |
# $ license > COPYING | |
#!/bin/sh | |
echo "Copyright (c) `date +%Y` Nathaniel Welch | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the |
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
task :environment do | |
require './dj-sinatra' | |
end | |
namespace :jobs do | |
desc "Clear the delayed_job queue." | |
task :clear => :environment do | |
Delayed::Job.delete_all | |
end |
OlderNewer