Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew
function pngquant_dir() { | |
if (( $+commands[pngquant] )); then | |
# Using 1000 here because OSX does so this gives consistent results | |
bytes_per_kb=1000 | |
total_saved=0 | |
for file in **/*.png; do | |
before_size=`wc -c < $file` | |
before_size=$(($before_size / $bytes_per_kb)) |
require 'pty' | |
CONFIG = { | |
:remote => { | |
:host => 'my.ssh-host.com', | |
:user => 'my-ssh-username', | |
:path => 'path-to/site/root' | |
}, | |
:posts => 'local/posts/directory' | |
} |
Handlebars.registerHelper 'if_equal', (val1, val2, fn) -> | |
if val1 == val2 | |
return fn() | |
else if fn.inverse | |
return fn.inverse() |
var canvas = document.getElementsByTagName('canvas'), | |
img = new Image(); | |
img.onload = function(){ | |
Array.prototype.slice.call(canvas).forEach(function(el){ | |
el.getContext('2d').drawImage(img, 0, 0); | |
}); | |
}; | |
img.src = 'http://thegurglingcod.typepad.com/.a/6a00d8341c387d53ef0148c84decb8970c-320wi'; |
var http = require('http'), | |
fs = require('fs'); | |
http.createServer(function(req, res){ | |
var path = (req.url === '/' ? './index.html' : '.' + req.url); | |
fs.readFile(path, 'utf-8', function(err, data){ | |
if(!err){ | |
console.log('Serving: ', req.url); | |
res.writeHead(200); | |
res.end(data); |
Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew