Skip to content

Instantly share code, notes, and snippets.

@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
@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
import Expo from 'expo';
import React from 'react';
import * as THREE from 'three';
import ExpoTHREE from 'expo-three';
console.disableYellowBox = true;
export default class App extends React.Component {
render() {

Keybase proof

I hereby claim:

  • I am burin on github.
  • I am burin (https://keybase.io/burin) on keybase.
  • I have a public key ASAjemSZEv5WsRPWD4RBz4lQU_pNgchSP6AB2Vm5ED4HNwo

To claim this, I am signing this object:

@burin
burin / gist:ab156df44fd313bb1b0a
Last active October 26, 2017 18:41
Squashing your commits into one commit without using interactive rebase.

Squashing your commits into one commit without using interactive rebase (https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request#squash-your-changes)

This basically takes the diff of your branch + origin/master and sets them aside for you to "recommit" them.

git fetch -ap # get in sync w/ server
git checkout jscs-disallow-redundant-spaces # switch to the appropriate branch
git reset --hard origin/jscs-disallow-redundant-spaces # get my branch to be exactly the same as what's on the server
MERGE_BASE=$(git merge-base origin/jscs-disallow-redundant-spaces origin/master) # get the commit where your branch originates
git reset --mixed $MERGE_BASE # reset to the point where your branch originates, but put your changes like you just made them
@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 / presentations.md
Created April 20, 2016 15:45
Presentation Dark Patterns

The Skip Over

Having slides that look great when skipped over, but don't stand up to any scrutiny if used as an actual slide.

"oh this was for the exec team when we presented this to them over 3 hours. since we only have 1 hour for you plebes, we’ll skip over it. but we already presented it to execs and they gave it the thumbs up. "

The "I have time for questions at the end"

“i’ll have time for questions at the end, so hold on to that thought and if i haven’t answered it by the end...”

Lately I've seen a lot of git commits that say:

Merge branch 'master' of http://git.labs.sabre.com/git/rails

Or while on a feature branch called add-toggle:

Merge branch 'add-toggle' of http://git.labs.sabre.com/git/rails

These are typically trivial merge commits that don't provide much value when going through the git log, so I'd prefer not to see them. You'll see them when using a visual tool like gitk or SourceTree, which I do pretty often throughout the day.

@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,