| API | Status Codes |
|---|---|
| [Twitter][tw] | 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504 |
| [Stripe][stripe] | 200, 400, 401, 402, 404, 429, 500, 502, 503, 504 |
| [Github][gh] | 200, 400, 422, 301, 302, 304, 307, 401, 403 |
| [Pagerduty][pd] | 200, 201, 204, 400, 401, 403, 404, 408, 500 |
| [NewRelic Plugins][nr] | 200, 400, 403, 404, 405, 413, 500, 502, 503, 503 |
| [Etsy][etsy] | 200, 201, 400, 403, 404, 500, 503 |
| [Dropbox][db] | 200, 400, 401, 403, 404, 405, 429, 503, 507 |
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
| import Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| classNames: [ 'delete-blog' ], | |
| sudoDeferred: null, | |
| isDone: false, | |
| isWorking: false, | |
| message: null, | |
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
| #!/bin/bash | |
| target_branch="production" | |
| working_tree="PATH_TO_DEPLOY" | |
| while read oldrev newrev refname | |
| do | |
| branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
| if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then | |
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
| Object.defineProperty(window, Symbol.for('registry'), { | |
| value: new Map(), | |
| }); | |
| window.importScript = src => { | |
| const registry = window[Symbol.for('registry')]; | |
| if (registry.has(src)) { | |
| return registry.get(src).promise; | |
| } |
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
| /** | |
| * Size of one chunk when requesting with Range | |
| * @type {Number} | |
| * @private | |
| */ | |
| const CHUNK_SIZE = 204800; | |
| /** | |
| * Concat two ArrayBuffers | |
| * @param {ArrayBuffer} ab1 |
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
| ffmpeg -framerate 25 -f image2 -pattern_type glob -i "*.JPG" -s:v 1920x1440 -c:v libx264 -r 25 ../timelapse.mp4 |
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
| // Observable is an Union Type, with the following variants | |
| const Empty = () => ['EMPTY'] | |
| const Cons = (head, tail) => ['CONS', head, tail] | |
| const Future = promise => ['FUTURE', promise] | |
| // race between 2 promises; each promise will resolve to a lazy value | |
| const lazyRace = (p1, p2) => Promise.race([p1,p2]).then(lazy => lazy()) | |
| // function composition | |
| const compose = (...fns) => (arg) => fns.reduceRight((res, f) => f(res), arg) |
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
| Iterators = (function() { | |
| var each, map, filter, reduce, toArray, toObject; | |
| function _map(iter, f) { | |
| return { | |
| hasNext: iter.hasNext, | |
| next: function() { return f(iter.next()); } | |
| }; | |
| } | |
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
| /*\ | |
| title: $:/plugins/sukima/dombuilder/dombuilder.js | |
| type: application/javascript | |
| module-type: library | |
| Micro DSL for DOM creation and stringification. | |
| \*/ | |
| /** |
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
| // see http://d.hatena.ne.jp/ashigeru/20090113/1231855642 | |
| var calc = { | |
| add: function (node) { | |
| return visit(this, node.l) + visit(this, node.r); | |
| }, | |
| sub: function (node) { | |
| return visit(this, node.l) - visit(this, node.r); | |
| }, | |
| val: function (node) { |