This file contains hidden or 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
| function group_or_item(values){ | |
| return (values.length > 1 ? 'group' : 'item'); | |
| } | |
| function get_group_values(key) { | |
| return groups[key]; | |
| } | |
| function getFrom(list) { | |
| return function(key) { |
This file contains hidden or 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 MyProfiler | |
| def self.profile | |
| p = Profiler.new | |
| p.event "Begin" | |
| yield p | |
| p.event "End" | |
| p | |
| end |
This file contains hidden or 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 Acceptance | |
| include ActiveModel::Model | |
| include ActiveModel::Validations | |
| extend ActiveModel::Naming | |
| class Type < Struct.new(:list?, :all?, :individual?); end | |
| attr_accessor :invitation_id | |
| attr_accessor :invitation_ids | |
| attr_accessor :user_id |
This file contains hidden or 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
| https://plus.google.com/hangouts/_/calendar/ZGF2aWRqYmV2ZXJpZGdlQGdtYWlsLmNvbQ.0o6bh4pin9d2d5dol1n35khrcc?authuser=1 |
This file contains hidden or 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
| # put the file into spec/support | |
| shared_examples_for "ActiveModel" do | |
| include ActiveModel::Lint::Tests | |
| # to_s is to support ruby-1.9 | |
| ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m| | |
| example m.gsub('_',' ') do | |
| send m | |
| end | |
| end |
This file contains hidden or 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
| export default FluxStore.extend({ | |
| model: 'store', | |
| events: { | |
| "ASSOCIATE_STORE": 'associate_store' | |
| }, | |
| create(payload) { | |
| return Store.create(payload.data) | |
| }, |
This file contains hidden or 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
| scope :without_removed, -> { where(arel_table[:removed].eq(nil).or(arel_table[:removed].eq(0))) } | |
| scope :only_removed, -> { where(arel_table[:removed].not_eq(nil)).where(arel_table[:removed].not_eq(0)) } | |
| def self.date_range start_date, end_date | |
| includes(:event). | |
| where(Event.arel_table[:event].gteq(start_date)). | |
| where(Event.arel_table[:event].lteq(end_date)) | |
| end |
This file contains hidden or 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
| var survey_responses = [ | |
| { | |
| eyes: { | |
| color: 'blue' | |
| }, | |
| flavors: { | |
| favorite: 'vanilla' | |
| } | |
| } |
This file contains hidden or 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
| var Backbone = require('backbone'); | |
| var _ = require('underscore'); | |
| var MVCObject = function MVCObject() { | |
| if(_.isFunction(this.initialize)) { | |
| this.initialize.apply(this, arguments); | |
| } | |
| }; | |
| _.extend(MVCObject.prototype, Backbone.Events); |
This file contains hidden or 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
| # A sample Gemfile | |
| source "https://rubygems.org" | |
| gem "pry" |