-
Data Down / Actions Up
- http://emberjs.jsbin.com/nayaho/edit?html,js - Interdependent select boxes. No observers.
- http://ember-twiddle.com/2d7246875098d0dbb4a4 - One Way Input
-
Plain JSBin's
-
Ember Version Base JSBin's
This file contains hidden or 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
| @charset "UTF-8"; | |
| /*--------------------------------------------------------------- | |
| IE78 - Zurb Foundation 4 Grid | |
| ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ | |
| https://gist.github.com/replete/7082477 | |
| (an enhanced fork of https://gist.github.com/zurbchris/5068210 ) | |
| 1) Make sure $row-width-px = your max large breakpoint row width (e.g. 960px) |
This file contains hidden or 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
| @charset "UTF-8"; | |
| /*--------------------------------------------------------------- | |
| IE6-7 Box-sizing polyfill, for Zurb ruleset | |
| ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ | |
| https://gist.github.com/replete/7082518 | |
| 1) Requires box-sizing.htc from https://github.com/Schepp/box-sizing-polyfill | |
| ˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭*/ |
This file contains hidden or 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.ArrayProxy.extend({ | |
| localStorageKey: null, | |
| init: function() { | |
| var localStorageKey = this.get('localStorageKey'); | |
| if (!localStorageKey) { | |
| throw new Error("You must specify which property name should be used to save " + this + " in localStorage by setting its localStorageKey property."); | |
| } |
This file contains hidden or 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
| // Google Tag Manager | |
| (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
| new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
| j=d.createElement(s);j.async=true;j.src= | |
| '//www.googletagmanager.com/gtm.js?id='+i;f.parentNode.insertBefore(j,f); | |
| })(window,document,'script','dataLayer','GTM-ABCDEF'); | |
| // End Google Tag Manager | |
| App.GtmUtil = { |
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.Controllerinstead ofEmber.ArrayControllerorEmber.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 hidden or 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
| // Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem | |
| // throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem | |
| // to avoid the entire page breaking, without having to do a check at each usage of Storage. | |
| if (typeof localStorage === 'object') { | |
| try { | |
| localStorage.setItem('localStorage', 1); | |
| localStorage.removeItem('localStorage'); | |
| } catch (e) { | |
| Storage.prototype._setItem = Storage.prototype.setItem; | |
| Storage.prototype.setItem = function() {}; |
This file contains hidden or 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
| import DS from 'ember-data'; | |
| export default DS.Transform.extend({ | |
| serialize: function(deserialized) { | |
| return deserialized; | |
| }, | |
| deserialize: function(serialized) { | |
| return Ember.Object.create(serialized); |
This file contains hidden or 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
| #!/bin/bash | |
| # Ubuntu Developer Script For pdf2htmlEx | |
| # Created by Rajeev Kannav Sharma | |
| # http://rajeevkannav.github.io/ | |
| # | |
| # | |
| # Downloads and configures the following: | |
| # | |
| # CMake, pkg-config | |
| # GNU Getopt |
This file contains hidden or 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/controllers/sign-in.js | |
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| actions: { | |
| signIn(){ | |
| this.set('errors', null); | |
| var params = { identification: this.get('email'), password: this.get('password') }; | |
| // Redirects to index route on success (configurable in config/environment.js) | |
| this.get('session').authenticate('simple-auth-authenticator:oauth2-password-grant', params); |