Skip to content

Instantly share code, notes, and snippets.

@markbao
markbao / Sync your Mac OS X Address Book with Pine (.addressbook).scpt
Created August 3, 2010 06:13
This will allow you to sync your Mac OS X Address Book with Pine. It'll take a few seconds if you have a few hundred contacts.
-- adapted from http://forums.macosxhints.com/showthread.php?t=17762 but it actually works here
tell application "Address Book"
set pineBook to ""
-- Count people as we loop over all of the people in each group
set i to 1
repeat with thePerson in every person
-- Check that there are e-mail entries for this person
if email of thePerson exists then
set theName to (name of thePerson) as string
-- Output every e-mail address entered for this person
@bmarini
bmarini / default.vcl.pl
Created June 30, 2011 18:01
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)