Skip to content

Instantly share code, notes, and snippets.

View juggy's full-sized avatar
🎯
Focusing

Julien Guimont juggy

🎯
Focusing
View GitHub Profile
@juggy
juggy / controllers.application.js
Created November 16, 2016 21:29 — forked from ofersadgat/controllers.application.js
Computed Update Count
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
counter: Ember.computed({
get(){
return 0;
},
set(k,v){
const fieldList = [
{ label: 'Foo Fields', fields: [{name: 'foo', selected: false}] },
{ label: 'Bar Fields', fields: [{name: 'bar', selected: true}] }
]
fields: Ember.computed('fieldList.@each.fields', function() {
return this.get("fieldList").mapBy("fields");
}),
enabledFields: Ember.computed("fields", "fields.@each.selected", function(){
@juggy
juggy / application.controller.js
Created August 28, 2015 18:40 — forked from patrickarlt/application.controller.js
ember-with-custom-events
import Ember from 'ember';
class ItemRating extends HTMLElement {
createdCallback () {
this.insertAdjacentHTML('afterbegin', `
<a data-rating="1">&#9733;</a>
<a data-rating="2">&#9733;</a>
<a data-rating="3">&#9733;</a>
<a data-rating="4">&#9733;</a>
<a data-rating="5">&#9733;</a>
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'th',
downArrow: '&#9660;',
upArrow: '&#9650;',
actions: {
sortBy(model, sortProperty, order) {
// Remove all selected classes from all the header links
@juggy
juggy / gist:1156873
Created August 19, 2011 14:06
Patched Ruby 1.9.2 for faster load and GC
cd /tmp
# Faster require:
# https://gist.github.com/1008945
curl -O https://raw.github.com/gist/1008945/4edd1e1dcc1f0db52d4816843a9d1e6b60661122/ruby-1.9.2p290.patch
# GC-tuning:
# https://gist.github.com/856296
curl -O https://raw.github.com/gist/856296/a19ac26fe7412ef398bd9f57e61f06fef1f186fe/patch-1.9.2-gc.patch