Skip to content

Instantly share code, notes, and snippets.

floats = 'left' 'right'
float(dir)
float dir
if dir in floats
display inline
@bengourley
bengourley / gist:2948429
Created June 18, 2012 13:40
Fileupload API
var fileUpload = require('file-upload')
, gridfsAdapter = require('fileupload-gridfs')
var middleware = fileUpload({
adapter: gridfsAdapter({ dbName: 'mydb' })
}).middleware
@bengourley
bengourley / gist:2320653
Created April 6, 2012 15:07
LaTex Stuff
\documentclass[doc]{apa}
\usepackage{url}
\usepackage{apacite}
\usepackage{setspace}
\onehalfspacing
\begin{document}
\title{
My Document:\\
@bengourley
bengourley / gist:2152795
Created March 21, 2012 21:00
Setting up OS X from scratch

Setting up my fresh OS X install from scratch:

  • Install xcode (once installed go to Xcode->Preferences->Components to download command line tools, then sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/ to point to things like opendiff)
  • Install purchased apps from AppStore
  • Install Dropbox
  • Install Chrome, Firefox
  • Install brew
  • brew install git
  • brew install mongo
  • mkdir -p /data/db sudo chgrp admin /data/db sudo chmod g+w /data/db
set daemon 300 with start delay 60
check host BenGourley-dev with address 127.0.0.1
start "/sbin/start site.BenGourley-dev"
stop "/sbin/stop site.BenGourley-dev"
if failed port 3000 protocol HTTP
request /
with timeout 5 seconds
then restart
#!upstart
description "Sitename-state"
author "Ben Gourley"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn # restart when job dies
respawn limit 5 60 # give up restart after 5 respawns in 60 seconds
|-- /var/w/
|-- .versions/
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
|-- SiteName --> [email protected] (symlink)
|-- AnotherSite --> [email protected] (symlink)
|-- /var/w/
|-- .versions/
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
|-- SiteName --> [email protected] (symlink)
|-- AnotherSite --> [email protected] (symlink)
|-- /var/w/
|-- .versions/
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
|-- SiteName (symlink)
|-- AnotherSite (symlink)
|-- /var/w/
|-- .versions/
|-- [email protected]
|-- [email protected]
|-- [email protected]
|-- [email protected]
|-- [email protected]
|-- SiteName (symlink)
|-- AnotherSite (symlink)