Skip to content

Instantly share code, notes, and snippets.

View joostdevries's full-sized avatar

Joost de Vries joostdevries

  • Amsterdam, Netherlands
View GitHub Profile
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
export default Ember.Controller.extend({
appName:'Ember Twiddle',
userName: 'Tristansdfsd',
});
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@joostdevries
joostdevries / pagination-patch-recordarray.js
Created April 25, 2015 09:31
extend record array for pagination/infinite scroll
DS.AdapterPopulatedRecordArray.reopen({
queryPageParam: 'page_number',
metaPageParam: 'currentPage',
metaTotalPagesParam: 'totalNumPages',
isPaginating: false,
nextPage: function (append) {
var meta = this.get('meta');
if(meta[this.get('metaPageParam')]<meta[this.get('metaTotalPagesParam')]-1)
export default Em.Controller.extend({foo: 'foo'});
@joostdevries
joostdevries / application.hbs
Last active August 29, 2015 14:17
Ember Twiddle sample
<h1>Ember Twiddle Gist demo</h1>
{{outlet}}
@joostdevries
joostdevries / gist-to-ember-cli-app.md
Last active August 29, 2015 14:16
How to create an Ember CLI app using Github Gist

Gist > Ember CLI app

Basically, it's really simple: Create a Gist where the files follow the same naming convention as you would use in an Ember CLI app.

Because Gists can't have folders, just use . instead of /. Eg:

  • controllers.application.js
  • templates.application.hbs

Once your Gist is ready to test, just put the ID in the playground URL, eg. http://ember-playground.joostdvrs.com/f2c90713bdfdf54a262b. All the magic then happens client-side:

  • Your templates are transpiled using ember-template-compiler
import Ember from 'ember';
export default Em.Controller.extend({
userName: null,
prettyUserName: function() {
return this.get('userName') ? this.get('userName') : 'everyone';
}.property('userName')
});
@joostdevries
joostdevries / gist:68744dd139c24db55e90
Created January 7, 2015 13:08
Issue references above description
window.location.hostname==='github.com' && $('.discussion-item-ref').each(function() {var el=$(this).clone();$('.js-discussion').prepend(el);});