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 function stub(obj, method, callback=_.noop, { as:name, returns }) { | |
| beforeEach(function() { | |
| const stub = this.sinon.stub(obj, 'method', (...args) => { | |
| callback.call(this, ...args); | |
| }); | |
| if (returns) stub.returns(returns); | |
| if (name) _.set(this, name, stub); | |
| }); |
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 IndexService | |
| class IndexServiceOptions | |
| def date_range start_date, end_date | |
| new @host, @values.merge(date_range: [start_date, end_date]) | |
| end | |
| def hide_removed hide_removed=true | |
| new @host, @values.merge hide_removed: hide_removed | |
| 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
| const dblTouchTapMaxDelay = 300 | |
| let latestTouchTap = { | |
| time: 0, | |
| target: null, | |
| } | |
| export default function isDblTouchTap(event) { | |
| const touchTap = { | |
| time: new Date().getTime(), | |
| target: event.currentTarget, |
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
| @mixin no-select { | |
| -webkit-touch-callout: none; | |
| -webkit-user-select: none; | |
| -khtml-user-select: none; | |
| -moz-user-select: none; | |
| -ms-user-select: none; | |
| user-select: none; | |
| -webkit-touch-callout: none; | |
| -ms-text-size-adjust: none; |
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
| // redux starts with the store.- ish | |
| const store = Redux.createStore(function(state, action) { | |
| return rootReducer(state, action); | |
| }); | |
| // next, components and other kinds of (what I'll call) mappers dispatch actions to the store | |
| store.dispatch({ | |
| type: 'THIS_IS_A_TYPE_OF_ACTION' | |
| }); |
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
| 375 x Fusion Thruster | |
| 863 x Radar Sensor Cluster | |
| 6,000 x Nanoelectrical Microprocessor | |
| 37,500 x Tungsten Carbide Armor Plate | |
| 225 x Antimatter Reactor Unit | |
| 3,000 x Tesseract Capacitor Unit | |
| 3,795 x Linear Shield Emitter | |
| 975 x Morphite | |
| 450 x Construction Blocks | |
| 1 x Apocalypse |
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 function recordTime(target, state, action) { | |
| if (action.type === target) return new Date().toDateTimeString(); | |
| if (action.type === target) return moment().format('iso9660'); // is this a thing? | |
| return state; | |
| } |
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 |