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
itunes-s3.yml |
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
# initializer solution for paperclip + passenger combo | |
# Paperclip::Attachment#post_process => "/tmp/stream.3916.0 is not recognized by the 'identify' | |
# command" error. | |
if RAILS_ENV == "development" | |
Paperclip.options[:image_magick_path] = "/opt/local/bin" | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Colors</key> | |
<dict> | |
<key>Background</key> | |
<string>0.195 0.195 0.195</string> | |
<key>InsertionPoint</key> | |
<string>0.902 0.902 0.902</string> |
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
require "net/http" | |
def twit(username, password, status, timeout=10) | |
response = Net::HTTP.start('twitter.com', 80) do |http| | |
req = Net::HTTP::Post.new("/statuses/update.xml") | |
req.set_form_data({'status'=> status}) | |
req.basic_auth(username, password) | |
http.read_timeout = timeout | |
http.request(req) | |
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
module Harmony | |
# Allows accessing config variables from harmony.yml like so: | |
# Harmony[:domain] => harmonyapp.com | |
def self.[](key) | |
unless @config | |
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml") | |
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys | |
end | |
@config[key] | |
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: license | |
# Prints an MIT license appropriate for totin' around. | |
# | |
# $ license > COPYING | |
year=`date "+%Y"` | |
cat <<EOF | |
Copyright (c) $year Chris Wanstrath | |
Permission is hereby granted, free of charge, to any person obtaining |
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
require "rubygems" | |
require "hpricot" | |
doc = Hpricot.XML(`tumblr read num=10`) | |
(doc/"post").each do |p| | |
puts `tumblr delete post-id=#{p.attributes['id']}` | |
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
;; As seen on | |
;; http://lucky-dip.net/articles/2009/08/06/restart-passenger-from-emacs-using-rinari/ | |
;; Anyway, here is a small snippet of emacs lisp to easily restart the | |
;; Passenger server for the project you are currently working on. It | |
;; assumes you have Rinari installed. | |
(defun restart-passenger () | |
"Restart passenger using the current rinari root" (interactive) | |
(shell-command (concat "touch " (rinari-root) "tmp/restart.txt")) | |
(message "Passenger restarted")) |
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
require "rubygems" | |
require "hpricot" | |
doc = Hpricot.XML(`tumblr read num=10`) | |
(doc/"post").each do |p| | |
puts `tumblr delete post-id=#{p.attributes['id']}` | |
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
`wget http://www.kids-n-fun.nl/kleurplaten/prinses%20en%20de%20kikker/prinsess_en_kikker_#{sprintf("%02d", i)}.jpg` |
OlderNewer