View controllers.application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
this._super(...arguments); | |
this.set('range', Array(5)); | |
}, | |
View strip_params.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyPlugs do | | |
def strip_params(conn, param_key) when is_binary(param_key) do | | |
param = Map.get(conn.params, param_key) |> strip_param | | |
params = Map.put(conn.params, param_key, param) | | |
%{conn | params: params} | | |
end | | |
| | |
defp strip_param(%{__struct__: mod} = struct) |
View application.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
View application.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
View application.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
}); |
View application.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
View application.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
actions: { | |
handleAnswer(questionId, value) { | |
alert('answer handled ' + questionId + ' ' + value); | |
} | |
} |
View application.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
actions: { | |
addExpense() { this.get('expense').pushObject(Ember.Object.create({amount: 100})); | |
} | |
}, | |
View each_group.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'fiber' | |
module EachGroup | |
def each_group(*fields, &block) | |
grouper = Grouper.new(*fields, &block) | |
loop_fiber = Fiber.new do | |
each do |result| | |
grouper.process_result(result) | |
end |
View gist:806490
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContactDetails | |
def initialize | |
@hash = Hash.new{ |h,k| h[k] = Array.new } | |
end | |
def history(key) | |
@hash[key] | |
end | |
def method_missing(method_name, *args, &block) |
NewerOlder