Skip to content

Instantly share code, notes, and snippets.

View AmilKey's full-sized avatar
🏠
Working from home

Ivan AmilKey

🏠
Working from home
View GitHub Profile
@AmilKey
AmilKey / circle.yml
Created June 17, 2016 07:22 — forked from citrus/circle.yml
circle.yml for building ember app with Circle CI
machine:
node:
version: 0.12.0
dependencies:
pre:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- npm config set spin false
- npm install -g npm@^2
- npm install -g bower
@AmilKey
AmilKey / js-micro.js
Created May 29, 2016 19:32 — forked from yuval-a/js-micro.js
Javascript micro-optimizations
// Array literal (= []) is faster than Array constructor (new Array())
// http://jsperf.com/new-array-vs-literal/15
var array = [];
// Object literal (={}) is faster than Object constructor (new Object())
// http://jsperf.com/new-array-vs-literal/26
var obj = {};
// property === undefined is faster than hasOwnProperty(property)
// http://jsperf.com/hasownproperty-vs-in-vs-undefined/17
@AmilKey
AmilKey / best_practices.md
Created April 25, 2016 18:10 — forked from alanpeabody/best_practices.md
Ember Best Practices

Ember Best Practices

Some thoughts and ideas on best practices building Ember apps after 2 years building and maintaining 6+ apps. This is less about the obvious best practices, like use ember-cli, and more along the lines of when to use what technique. As with every best practice there are exceptions to every rule.

Ember data

Ember data relationships

Routing

@AmilKey
AmilKey / javascript-query-string.js
Created February 26, 2016 07:23 — forked from DavidWells/javascript-query-string.js
JavaScript :: Regex trick: Parse a query string into an object
// http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
// JavaScript regex trick: Parse a query string into an object
var queryString = {};
anchor.href.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { queryString[$1] = $3; }
);
// Usage
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
vehicle: '',
vehicles: [1,2,3],
});
@AmilKey
AmilKey / gist:c442df6f5d7499a41bdb
Last active August 30, 2015 08:05 — forked from bortevik/gist:c9310ab768e9baa5335a
LocalStorage wraper
App.StorageService = Ember.Object.extend({
persistence: window.localStorage,
namespace: 'ember-storage-service',
init: function() {
var callback = this._handleStorageEvent.bind(this);
$(window).on('storage', callback);
},
@AmilKey
AmilKey / router-facelift-guide.md
Last active August 28, 2015 09:49 — forked from machty/router-facelift-guide.md
Guide to the Router Facelift

Ember Router Async Facelift

The Ember router is getting number of enhancements that will greatly enhance its power, reliability, predictability, and ability to handle asynchronous loading logic (so many abilities), particularly when used in conjunction with promises, though the API is friendly enough that a deep understanding of promises is not required for the simpler use cases.

@AmilKey
AmilKey / new-router-examples.md
Last active August 27, 2015 21:11 — forked from machty/new-router-examples.md
How to do cool stuff with the new Router API
@AmilKey
AmilKey / gist:a86e357d2d7114f2616a
Created June 29, 2015 13:55 — forked from lttlrck/gist:9628955
rename git branch locally and remotely - Gists - GitHub
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote