I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.touchZone::after | |
content ' ' | |
display block | |
width 100% | |
height 100% | |
z-index 100 | |
top 0 | |
position absolute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Original source: https://gist.github.com/oskarrough/914653b03d886c015320 | |
* Modified fork: https://gist.github.com/consideRatio/761c6286158e70feaed7 | |
* | |
* Working authentication with | |
* Firebase 2.0.x + Ember.js 1.8.1 + Ember Data Canary + EmberFire 1.3.0 + Ember CLI | |
* works for me! oskar@rough.dk | |
* | |
* Note: this assumes you've set up login on your Firebase, | |
* only handles Google and Facebook for now. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// strip-units required by spread mixin | |
// http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass | |
@function strip-units($number) | |
@return $number / ($number * 0 + 1) | |
// pow and sqrt required by ease function | |
// adapted from https://github.com/at-import/Sassy-math/blob/master/sass/math.scss | |
@function pow($base, $exponent) | |
$value: $base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ParallaxManager, ParallaxPart; | |
ParallaxPart = (function() { | |
function ParallaxPart(el) { | |
this.el = el; | |
this.speed = parseFloat(this.el.getAttribute('data-parallax-speed')); | |
this.maxScroll = parseInt(this.el.getAttribute('data-max-scroll')); | |
} | |
ParallaxPart.prototype.update = function(scrollY) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Ember.Object.extend({ | |
previousUnauthorizedTransition: null, | |
token: localStorage.token, | |
username:null, | |
tokenChanged: function() { | |
localStorage.token = this.get('token'); | |
}.observes('token') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// utils/computed/search.js | |
import Ember from 'ember'; | |
var computed = Ember.computed; | |
export default function search(dependentKey, propertyKey, searchQueryKey, returnEmptyArray) { | |
returnEmptyArray = (typeof returnEmptyArray === "undefined") ? false : returnEmptyArray; | |
return computed("" + dependentKey + ".@each." + propertyKey, searchQueryKey, function() { | |
var items, query; | |
if (returnEmptyArray && !this.get(searchQueryKey)) { | |
return Ember.A([]); |
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use
Ember.Controller
instead ofEmber.ArrayController
orEmber.ObjectController
- Fetch data in your route, and set it as normal properties on your top-level controller. Export an
Ember.Controller
, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function saveItem(key, value) { | |
var json = JSON.stringify(value); | |
localStorage.setItem(key, json); | |
} | |
function loadItem(key) { | |
var json = localStorage.getItem(key); | |
return JSON.parse(json); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.StorageService = Ember.Object.extend({ | |
persistence: window.localStorage, | |
namespace: 'ember-storage-service', | |
init: function() { | |
var callback = this._handleStorageEvent.bind(this); | |
$(window).on('storage', callback); | |
}, | |