Skip to content

Instantly share code, notes, and snippets.

@joshvermaire
joshvermaire / gist:3856784
Created October 9, 2012 05:27
Remove " 2" from filenames
for f in IMG_$***\ 2.*; do
mv "$f" "${f/\ 2/}"
done
@joshvermaire
joshvermaire / gist:3853982
Created October 8, 2012 18:11
ThisLife Twitter Summary Card
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@thislife">
<meta name="twitter:url" content="http://www.thislife.com">
<meta name="twitter:title" content="ThisLife. Your Story.">
<meta name="twitter:description" content="The best home for all your photos and videos.">
<meta name="twitter:image" content="#### Some sort of image heree??? ####">
@joshvermaire
joshvermaire / alfred_shell_script_extension
Created September 18, 2012 21:30
Quick Alfred JSONLint Extension
echo `pbpaste` | python -mjson.tool | pbcopy; echo "Linted!";
@joshvermaire
joshvermaire / normalize.css
Created August 23, 2012 05:06
normalize.css for modern browsers and IE 10+
/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
/*! modified by Josh Vermaire to remove support IE8-9 */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/*
* Prevents modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
@joshvermaire
joshvermaire / crontab
Created August 22, 2012 01:39
Daily Cron Script for Github Logs
0 */5 * * * * /Users/joshvermaire/github/thislife/tl-html5/email.sh
@joshvermaire
joshvermaire / gist:3319827
Created August 11, 2012 01:39
Current Sublime Text 2 User Preferences
{
// Wide caret_style...wish it blinked as well
"caret_style": "wide",
// Custom Theme
"color_scheme": "Packages/User/Solarized (Dark).tmTheme",
// Ensure new line of end of file on save
"ensure_newline_at_eof_on_save": true,
// Amazing font http://levien.com/type/myfonts/inconsolata.html
"font_face": "Inconsolata",
// Inconsolata is small in general
@joshvermaire
joshvermaire / gist:3174435
Created July 25, 2012 04:41
Notes on the LinkedIn Building A Performant HTML5 APP Meetup

LinkedIn iPad app performance

extending the Router to use a baserouter which funells all data through a router https://gist.github.com/3112096

double render caching render next page before getting to the next page (header in linkedin's case)

"Lighter is your DOM, faster is your app" what to consider # of dom nodes as too many?

define(['jquery'], function($) {
return $(document.body).on('click', function(e) {
return alert('hi');
});
});
@joshvermaire
joshvermaire / queryString.coffee
Created June 27, 2012 00:17
Parse a query String
getQueryVariable = (variable) ->
query = window.location.search.slice(1)
vars = query.split "&"
i = 0
while i < vars.length
pair = vars[i].split("=")
return unescape(pair[1]) if pair[0] is variable
i++
@joshvermaire
joshvermaire / gist:2942810
Created June 16, 2012 23:16
multiple collections per model instance
tlmodel = (attributes, options) ->
attributes = _.extend({}, defaults, attributes) if defaults = getValue(this, "defaults")
attributes or = {}
options or = {}
attributes = @parse(attributes) if options.parse
@collections = {}
@attributes = {}
@_escapedAttributes = {}
@cid = _.uniqueId("c")
@changed = {}