Skip to content

Instantly share code, notes, and snippets.

View nolaneo's full-sized avatar

Eoin Nolan nolaneo

  • Intercom
  • Dublin, Ireland
View GitHub Profile
@nolaneo
nolaneo / controllers.application.js
Last active October 29, 2019 15:05
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
init() {
this._super(...arguments);
// let select =
}
});
import Ember from 'ember';
import { computed } from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
number: 0,
computedProperty: computed('number', function() {
if (this.number > 5) {
throw new Error("Oh shit!")
} else {
import Ember from 'ember';
export default Ember.Controller.extend({
oneSelected: Ember.computed.equal('toggled', 1),
twoSelected: Ember.computed.equal('toggled', 2),
threeSelected: Ember.computed.equal('toggled', 3),
actions: {
toggle(item) {
this.set('toggled', item);
}
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement() {
Ember.$(document).on('click.' + this.get('elementId'), Em.run.bind(this, () => {
this.get('close')();
console.error('I CLOSED MYSELF!');
}));
},
willDestroyElement() {
@nolaneo
nolaneo / controllers.application.js
Last active October 3, 2017 17:06
Firefox input type=number WAT
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
showInput() {
console.log('Show the input!');
this.set('isShowingInput', true);
Ember.run.schedule('afterRender', this, () => {
Ember.$('input').focus().select();
@nolaneo
nolaneo / controllers.application.js
Created December 21, 2016 18:22
Dynamic key validation
import Ember from 'ember';
export default Ember.Controller.extend({
a: false,
b: false,
c: false,
validationSet: ['a', 'b', 'c'], //Imagine this being a dynamic set of keys that we care about
@nolaneo
nolaneo / generator.rb
Created June 7, 2016 21:02
Euro 2016 Pool Generator
# GROUP A
# Albania - 401/1
# France - 4.2/1
# Romania 126/1
# Switzerland 51/1
# GROUP B
# England 9/1
# Russia 67/1
# Slovakia 151/1