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)
View gist:600853
Started GET "/" for XXX.XXX.XXX.XXX at Tue Sep 28 11:56:10 +0000 2010
<database lookup>
filter: before calling env: 1285674970
Processing by DefaultController#index as HTML
around_filter in ApplicationController: 1285674991
<database lookup>
DefaultController#index start: 1285674991
Rendered accounts/_sign_up_form.haml (43.2ms)
Rendered shared/_flash.haml (0.2ms)
Rendered default/index.haml within layouts/application (47.7ms)