Some stuff that makes me happy:
- good decisions
- well written, persuasive prose
- elegant solutions
- evocative experiences
- genuine, honest communication
- afterglow
- summertime
- doodling
def mail_to_obf(email_address, name = nil, html_options = {}) | |
substr = ' *AT* ' | |
ej = email_address.gsub(/@/, substr) | |
mt = mail_to(ej, name || ej, html_options) | |
javascript_tag("document.write('#{mt}'.replace('#{substr}', '@', 'g'))") | |
end |
# Detect rss feed, parse it, and report number of posts per date. | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
# First find the rss | |
url = ARGV[0] || "http://twitter.com/burnto" | |
doc = Hpricot(open(url)) |
# Detect rss feed, parse it, and report number of posts per date. | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
# First find the rss | |
url = ARGV[0] || "http://twitter.com/burnto" | |
doc = Hpricot(open(url)) |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
n = ARGV[0] | |
n = n.gsub(/\s+/, "%2C%2D") | |
xml = open("http://gdata.youtube.com/feeds/api/videos?category=#{n}").read | |
doc = Hpricot::XML(xml) |
git log --since=yesterday | |
git log --since="3 days ago" | |
git log --before=today |
# You can get your own setup: | |
# >> import distutils | |
# >> distutils.sysconfig.get_config_vars() | |
macx { | |
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5 | |
QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5.sdk # need this if building on PPC | |
CONFIG += x86 | |
LIBS += -framework \ | |
IOKit \ |
Array.prototype.simple_moving_average = function(window_length) { | |
var averaged = new Array(this.length); | |
var chunk = []; | |
for (k = 0; k < this.length; k++) { | |
chunk.push(this[k]); | |
if (chunk.length > window_length) chunk.shift(); | |
averaged[k] = chunk.sum() / chunk.length; // sum() is an exercise left to the reader | |
} | |
return averaged; | |
}; |
Some stuff that makes me happy:
hello humans | |
// Image replacement scss mixin | |
@mixin image_replace($img, $width, $height, $x: 0, $y: 0) { | |
display: block; | |
background: image-url($img) no-repeat $x $y; | |
width: $width; | |
height: $height; | |
overflow: hidden; | |
text-indent: -9999em; | |
} |