Skip to content

Instantly share code, notes, and snippets.

View Vimeo HTML5 Embed
<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"
View nginx, php-fpm on ubuntu (no mysql server)
#!/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 Dec 1, 2010
Pre-flight QA Checklist
View Pre-flight
- airbrake
- newrelic
- todos
- robots.txt
- favicon
- apple-touch-icon
- caching
- meta description
- title
- browser compatibility
@jgwhite
jgwhite / EC2 Sums
Created Dec 15, 2010
Reminder of EC2 pricing for Micro instances
View EC2 Sums
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 Feb 18, 2011
Java switch on String value
View switch-on-string.java
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 Mar 8, 2011
Updates exif Headline attribute to match filebasename
View Exif Headline to Filename
for I in *.jpg ; do exiftool -overwrite_original -Headline=`basename $I .jpg` $I ; done
View Controller.pde
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;
View luckyme-splash-cookie
@jgwhite
jgwhite / with-history.js
Created May 31, 2011
Simple pushState wrapper
View with-history.js
// 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() {
View gist:1016622
#!/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
You can’t perform that action at this time.