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 / gist:d4be8bd20d10d0a067ec
Created April 29, 2015 11:17
add permission to .npm
sudo chown -R $USER /usr/local
sudo chown -R `whoami` ~/.npm
@AmilKey
AmilKey / gist:5abaa44e39e755d36b3b
Created May 5, 2015 14:45
hooks of ember view
/// HOOKS
var noop = function () {};
Renderer.prototype.willCreateElement = noop; // inBuffer
Renderer.prototype.createElement = noop; // renderToBuffer or createElement
Renderer.prototype.didCreateElement = noop; // hasElement
Renderer.prototype.willInsertElement = noop; // will place into DOM
Renderer.prototype.didInsertElement = noop; // inDOM // placed into DOM
Renderer.prototype.willRemoveElement = noop; // removed from DOM willDestroyElement currently paired with didInsertElement
Renderer.prototype.willDestroyElement = noop; // willClearRender (currently balanced with render) this is now paired with createElement
@AmilKey
AmilKey / gist:b5b0009f8cea9f445e34
Created May 19, 2015 09:41
component as collectionView
{{#list-block content=widgets}}
item value {{value}}
{{/list-block}}
to
<ul class='list-block'>
<li class='list-block__item'>
item value drawer-value
</li>
<li class='list-block__item'>
item value hot-drawer-value
@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
@AmilKey
AmilKey / gist:18ee9dbbb7855a096f26
Created June 30, 2015 11:57
rename group files in linux
for d in */; do
for f in $d*/; do
# echo $f
if [[ $f == *"4ktv_"* ]]
then
#COPY
# cp -r $f $d"xlarge/"
# echo $d"xlarge/"
#DELETE
rm -rf $f
@AmilKey
AmilKey / open-key.coffee
Created August 1, 2015 11:42
add open-key before load ember app
Em.onLoad 'Ember.Application', (application)->
application.initializer
name: 'OpenKey'
initialize: (container, app)->
app.deferReadiness()
url = "#{app.CONFIG.API.host}/open-key"
Ember.$.ajax
url: url
method: "GET"
success: (result, textStatus, jqXHR) ->
@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 / 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 / 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);
},