Skip to content

Instantly share code, notes, and snippets.

Andrew Timberlake andrewtimberlake

Block or report user

Report or block andrewtimberlake

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View controllers.application.js
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
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
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
View application.controller.js
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
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
# -*- 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
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)
You can’t perform that action at this time.