Skip to content

Instantly share code, notes, and snippets.

View magnetised's full-sized avatar

Garry Hill magnetised

View GitHub Profile
alias clsb='osascript -e "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"k\" using command down"'
# use textmate's "Filter through Command"
# to fix a document in-place
sed -e 's/[[:space:]]*$//'
#!/usr/bin/env ruby
# quickly check to see if a domain name is free
require 'rubygems'
require 'session'
cmd = 'whois -Q'
domains = ARGV
### /etc/postfix/main.cf
transport_maps = hash:/etc/postfix/transport
# auth
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
# tls
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
var ${1:f} = (function(${2:t}) {
return function($3) {
${2}.${4:${5:method}()};
};
})(this);
# install freetype and cairo
wget http://downloads.sourceforge.net/freetype/freetype-2.3.9.tar.bz2?use_mirror=heanet
cd freetype-2.3.9
./configure
make
make install
wget http://fontconfig.org/release/fontconfig-2.6.0.tar.gz
cd fontconfig-2.6.0
## fix install of swiftiply on debian
# add following to
cd /opt/ruby-enterprise-1.8.6-20090520/lib/ruby/gems/1.8/gems/swiftiply-0.6.1.1
vim ext/fastfilereader/mapper.cpp
# add in
@magnetised
magnetised / gist:770812
Created January 8, 2011 12:54
Find element under cursor
document.onmousemove = function(event) { console.log(document.elementFromPoint(event.clientX, event.clientY)) }
%{ extends 'parent' }
%{ block :introduction }
%{ 2.times do |n| -}
Template inheritance is great!
%{ end }
%{ endblock }
%{ block :example }
%{ blocksuper }
Title
%{ block :introduction }
Introduction here...
%{ endblock }
%{ block :example }
Do it like this...
%{ endblock }