I hereby claim:
- I am atog on github.
- I am atog (https://keybase.io/atog) on keybase.
- I have a public key whose fingerprint is 947D 3BC6 3C3F A68E 0437 2140 E63E 0B9D 1B81 8B66
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var delay = (function() { | |
var timer = 0; | |
return function(ms, callback) { | |
clearTimeout(timer); | |
return timer = setTimeout(callback, ms); | |
}; | |
})(); | |
USAGE: |
# 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 |
<?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> |
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 |
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 |
#!/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 |
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 |
;; 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")) |