Skip to content

Instantly share code, notes, and snippets.

View jasonmit's full-sized avatar
🌴
On a hiatus from open source

Jason Mitchell jasonmit

🌴
On a hiatus from open source
View GitHub Profile
@jasonmit
jasonmit / gist:7819701
Created December 6, 2013 07:02
My base64 Ember View for File Uploading
var UploaderView = Ember.ContainerView.extend({
tagName: 'button',
classNames: ['btn', 'btn-white', 'has-icon', 'uploader'],
didInsertElement: function() {
this.pushObject(this.uploadView.create());
},
render: function(buffer) {
buffer.push('<i class="icon-download"></i> Upload');
@jasonmit
jasonmit / evented-localStorage.js
Created December 1, 2013 08:10
Evented localStorage (used for data-binding)
var store = (function($) {
if(typeof(Storage) === 'undefined') {
throw new Error('This browser does not support localStorage')
}
var _$ = $({});
this.get = function(key) {
return localStorage.hasOwnProperty(key) ? localStorage[key] : false;
};