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 Component extends React.Component { | |
| onScroll(event) { | |
| this.scrollPosition = getScrollPosition(event); | |
| if (this.scrolling) return; | |
| this.scrolling = true; | |
| const processLongOperation = (beginPosition) => { | |
| longOperation(beginPosition, (completionState) => { | |
| this.setState(completionState, () => { | |
| //rendered |
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
| def func a, c, d | |
| puts "a: " + a.to_s | |
| puts "c: " + c.to_s | |
| puts "d: " + d.to_s | |
| end | |
| def func2 *args | |
| puts args.to_s | |
| 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
| function ParentWidget(properties) { | |
| Object.assign(this, properties); | |
| } | |
| function farewell() { | |
| console.log('Goodbye Cruel ' + this.name); | |
| } | |
| ParentWidget.prototype.farewell = farewell; |
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; | |
| } |