Skip to content

Instantly share code, notes, and snippets.

<object width="480" height="270">
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=xyz&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1" />
<embed src="http://vimeo.com/moogaloop.swf?clip_id=xyz&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="480" height="270"></embed>
<video
src="http://www.vimeo.com/play_redirect?clip_id=xyz"
controls="controls"
#!/bin/bash
# WEB SERVER
sudo apt-get update
sudo apt-get install nginx
# APPS FROM SOURCE
cd /usr/local/src/
# PHP (w/FPM for NGINX)
@jgwhite
jgwhite / Pre-flight
Created December 1, 2010 16:56
Pre-flight QA Checklist
- airbrake
- newrelic
- todos
- robots.txt
- favicon
- apple-touch-icon
- caching
- meta description
- title
- browser compatibility
@jgwhite
jgwhite / EC2 Sums
Created December 15, 2010 14:23
Reminder of EC2 pricing for Micro instances
On-demand:
Micro US: $0.02/hour = $127.2/year = ~£80/year
Micro EU: $0.025/hour = $159/year = ~£100/year
Reserved:
Micro US: $54/year + $0.007/hour = $98.52/year = ~£60/year
Micro EU: $54/year + $0.01/hour = $117.6/year = ~£75/year
@jgwhite
jgwhite / switch-on-string.java
Created February 18, 2011 11:11
Java switch on String value
ValueEnum enumval = ValueEnum.fromString(myString);
switch (enumval) {
case MILK : lap(); break;
case WATER: sip(); break;
case BEER : quaff(); break;
default : dance(); break;
}
@jgwhite
jgwhite / Exif Headline to Filename
Created March 8, 2011 13:59
Updates exif Headline attribute to match filebasename
for I in *.jpg ; do exiftool -overwrite_original -Headline=`basename $I .jpg` $I ; done
float afmin = 75;
float afmax = 25 ;
float maxOmin = 8;
float maxOmax = 28;
float blobalphamin = 0;
float blobalphamax = 30;
float scoopamin = 0;
float scoopamax = 22;
float discamin = 0;
float discamax = 30;
@jgwhite
jgwhite / with-history.js
Created May 31, 2011 10:56
Simple pushState wrapper
// WithHistory v1.0.0
// hello@withassociates.com
//
// Usage:
// $(document).bind('WithHistory.urlDidChange', function() { ... });
// window.withHistory = new WithHistory();
// window.withHistory.pushState(newUrl) // push new url
// window.withHistory.url(); // get current url
var WithHistory = function() {
#!/bin/sh
rvm install ree
rvm use ree@global
gem install bundler
gem install rake
cd ~/wherever/project/lives
rvm gemset create project_name
echo "rvm use ree@project_name" > .rvmrc
`cat .rvmrc`
echo -e "source :rubygems\ngem middleman" > Gemfile