-
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
App.InactivityWarningComponent = Ember.Component.extend({ | |
active: false, | |
inactiveTimeout: 12000000, // Amount of time before we redirect to the sign in screen - the session should have expired by this point. (20 minutes) | |
warningTimeout: 30000, // Amount of time the user has to perform an action before the last keep alive fires - 30 seconds | |
timeout: 1170000, // 19.5 minutes. We want to be less than the 20 minute timeout to be sure the session is renewed. | |
didInsertElement: function(){ | |
//if($('meta[name="in-development"]').attr('content')){ return; } // Uncomment and add a meta tag to your head if you want to avoid session timeout in development | |
var context = this; |
#Webpage Thumbnails In Python A small WSGI script that uses selenium's headless PhantomJS driver to capture webpage screenshots, and PIL to resize them. Cropping options could easily be added.
##Dependencies
- Python selenium
- Python PIL
- PhantomJS
This is a set of helpers for finding the application's currently active models/routes/controllers/etc. This isn't a straightforward process because of how Ember (rightly) encapsulates application objects, but it's useful in debugging environments to be able to quickly access them. And with the beta release of Ember Data, the store is not easily accessible without helpers either.
All helpers can be called directly if you provide them an application instance:
In addition to the techniques described in the
Asynchronous Routing Guide,
the Ember Router provides powerful yet overridable
conventions for customizing asynchronous transitions
between routes by making use of error
and loading
substates.
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
import DS from 'ember-data'; | |
import {RSVP} from 'ember'; | |
var Adapter = DS.RESTAdapter.extend({ | |
namespace: 'api/v1', | |
findAll: function(store, type, sinceToken) { | |
var url = this.buildURL(type.typeKey); | |
var cached = localStorage.getItem(url); |
/** | |
* `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes | |
* all items from all source arrays in an efficient way. | |
* | |
* Usage: | |
* | |
* ```javascript | |
* var obj = Ember.Object.create({ | |
* people: [ | |
* { |
Ember.GoogleAnalytics = Ember.Mixin.create({ | |
trackPageView: function() { | |
if(!Ember.isNone(ga)) { | |
Ember.run.next(function() { | |
var loc = window.location, | |
page = loc.hash ? loc.hash.substring(1) : loc.pathname + loc.search; | |
ga('send', 'pageview', page); | |
}); | |
} |