Skip to content

Instantly share code, notes, and snippets.

@burin
burin / gist:3840737
Created October 5, 2012 16:06
Full screen web app in iPhone 5 (save to home screen)
<!-- standard viewport tag to set the viewport to the device's width
, Android 2.3 devices need this so 100% width works properly and
doesn't allow children to blow up the viewport width-->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<!-- width=device-width causes the iPhone 5 to letterbox the app, so
we want to exclude it for iPhone 5 to allow full screen apps -->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" />
<!-- provide the splash screens for iPhone 5 and previous -->
<link href="assets/splashs/splash_1096.png" rel="apple-touch-startup-image" media="(device-height: 568px)">
<link href="assets/splashs/splash_iphone_2x.png" rel="apple-touch-startup-image" sizes="640x960" media="(device-height: 480px)">
@burin
burin / .jshintrc
Created July 6, 2012 16:50
jshint configuration
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,
/*!
* jQuery Cookie Plugin
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
@burin
burin / gist:2003460
Created March 8, 2012 21:07
git pull with rebase (when working in master)
# if working in local master directly instead of in a feature branch:
# you want to bring in updates that have occurred on the remote branch
# without creating a merge commit
# this will rewind your commits, bring in changes from master,
# then put your changes back on top
git pull --rebase
# git pull --rebase origin master
# then a push will look like your changes have occurred on top of the latest
@burin
burin / gist:2003144
Created March 8, 2012 20:12
git rebase workflow
# create new local feature branch
git checkout -b new_feature
# do work, get money
git commit -m 'sweet'
# push to origin for anti-bus protocol
git push origin new_feature
@burin
burin / each_with_index.coffee
Created June 27, 2011 14:33
each_with_index handlebars helper, adds an {{index}} prop accessible from within the block
Handlebars.registerHelper 'each_with_index', (array, fn) ->
buffer = ''
for i in array
item = i
item.index = _i
buffer += fn(item)
buffer
# group 1
cd ~
mkdir .gems bin lib src
# group 2
echo 'export GEM_HOME="$HOME/.gems"' >> .bash_profile
echo 'export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"' >> .bash_profile
echo 'export PATH="$HOME/bin:$HOME/.gems/bin:$PATH"' >> .bash_profile
source ~/.bash_profile
var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("ls -la", puts);
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Forms Static : Default</title>
<style>
</style>
</head>
<body>