Skip to content

Instantly share code, notes, and snippets.

@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
@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: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
floats = 'left' 'right'
float(dir)
float dir
if dir in floats
display inline
@bengourley
bengourley / gist:3710028
Created September 12, 2012 21:22
jitsu deploy :(
info: Welcome to Nodejitsu bengourley
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Skipping require-analyzer because noanalyze option is set
info: Skipping require-analyzer because noanalyze option is set
info: Creating snapshot 1.0.5-10
error: Error running command deploy
error: read ETIMEDOUT
error: Error: read ETIMEDOUT
@bengourley
bengourley / flyout.js
Created October 5, 2012 12:09
module.js example usage
module('flyout', function (module) {
module.exports = flyout
function flyout() {
// Use jQuery as $ is in the global
// scope and available w/out require()
$('.flyout').animate({ ... }, 300)
@bengourley
bengourley / animate.js
Last active October 11, 2015 13:28
Hack on Zepto fx as a jQuery plugin
(function () {
// Mock necessary parts of zepto for fx module
window.Zepto = function () { return $(arguments) }
window.Zepto.isObject = function () { return false }
window.Zepto.each = $.each
window.Zepto.extend = $.extend
window.Zepto.fn = {}
/*
@bengourley
bengourley / like-this.js
Created October 12, 2012 12:12
Example break.js usage
// Make breakpoints first
window.addBreakpoint('medium', '(min-width: 600px)')
window.addBreakpoint('large', '(min-width: 900px)')
// Test the initial window width
if (window.innerWidth < 600) {
// load mobile imgs
} else if (window.innerWidth < 900) {
@bengourley
bengourley / dependencies
Created October 12, 2012 19:39
jitsu deploy error
"dependencies": {
"express": "3.0.0rc1",
"jade": "0.27",
"stylus": "0.28",
"nib": "0.7",
"versionator": "0.2",
"compact": "0.1",
"request": "2.10",
"async": "~0.1",
"bcrypt": "~0.7",
info: Welcome to Nodejitsu bengourley
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Skipping require-analyzer because noanalyze option is set
info: Skipping require-analyzer because noanalyze option is set
info: Creating snapshot 0.1.0-28
info: Updating app iowmcc
info: Activating snapshot 0.1.0-28 for iowmcc
info: Starting app iowmcc