Skip to content

Instantly share code, notes, and snippets.

@derrickshowers
derrickshowers / gist:80fb450490ff03e6e274
Created April 18, 2015 23:54
Delegation Design Pattern Using Swift
import UIKit
protocol YelpRequestDelegate {
func getYelpData() -> AnyObject
func processYelpData(data: NSData) -> NSData
}
class YelpAPI {
var delegate: YelpRequestDelegate?
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Arrays',
foo: [],
bar: Ember.computed('foo', function() {
console.log('bar called');
}),
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
foo: 'foo',
bar: 'bar',
actions: {
someAction() {
console.log('someAction fired');
}
}
import Ember from 'ember';
export default Ember.Component.extend({
init: function() {
// You need this whenever you override init (talks about it a bit in the docs
this._super(...arguments);
// Get the days left somehow
var deadline = new Date();
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
@derrickshowers
derrickshowers / controllers.application.js
Last active August 5, 2016 01:25
Auth Route Sibling
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@derrickshowers
derrickshowers / controllers.application.js
Created August 30, 2016 03:22
Ember.object.create Test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
testObject: Ember.Object.create({
emberObj: Ember.Object.create({
foo: 'foo',
}),
nonEmberObj: {
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
rows: [
1,
2,
3,
4,