- a task list item
- list syntax required
- normal formatting, @mentions, #1234 refs
- incomplete
- completed
This file contains 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 const parseGraph = s => s | |
.split(',') | |
.map(edge => edge.trim().split('->')) | |
.reduce((adjacency, [a, b]) => { | |
if (!adjacency.has(a)) { | |
adjacency.set(a, new Set()) | |
} | |
if (!adjacency.has(b)) { | |
adjacency.set(b, new Set()) | |
} |
This file contains 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 PriorityQueue = (() => { | |
const parent = i => ((i + 1) >>> 1) - 1 | |
const left = i => (i << 1) + 1 | |
const right = i => (i + 1) << 1 | |
const privateMap = new WeakMap() | |
const $ = privateMap.get.bind(privateMap) | |
const swap = (self, i, j) => { | |
const h = $(self).heap |
This file contains 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
isBalanced = (() => { | |
const braces = { | |
'{': [ 0, 1 ], | |
'}': [ 0, -1 ], | |
'[': [ 1, 1 ], | |
']': [ 1, -1 ], | |
'(': [ 2, 1 ], | |
')': [ 2, -1 ] | |
} | |
return function isBalanced (s) { |
This file contains 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
// With async/await support | |
const fs = require('fs') | |
const jwt = require('jwt-simple') | |
const pem_file = '/path/to/github.pem' // the absolute path to your Application Pem Certificate issued by GitHub | |
const integration_id = 0 // GitHub Application Integration ID | |
const installation_id = 0 // once installed on an organization. The Organization Integration ID | |
const expire_seconds = 60 // number of seconds the jwt token expires (max ~600 but not designated by GitHub) | |
const slug = 'owner/repo' // name of repo for demo purposes | |
const privateKey = fs.readFileSync(pem_file) |
This file contains 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(){ | |
const EE = require('events') | |
const Stream = require('stream') | |
const promise = Symbol('StreamPromise') | |
Stream.prototype.constructor = function () { | |
EE.call(this) | |
this[promise] = new Promise((resolve, reject) => { | |
this.on('error', reject) | |
this.on('end', resolve) |
This file contains 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
a2p addr2line animate appletviewer8 ar as aserver awk base64 bashbug bashbug-64 bdftopcf bdftops berkeley_db_svc bmp2tiff build-classpath build-classpath-directory build-jar-repository bunzip2 bzcat bzcmp bzdiff bzgrep bzip2 bzip2recover bzless bzmore c++filt c2ph ca-legacy cairo-sphinx cal captoinfo catchsegv certutil chcon check-binary-files chrt chvt cksum clean-binary-files clear cmp cmsutil col colcrt colrm column comm compare composite conjure convert create-jar-links crlutil csplit curl cut d8 db_archive db_checkpoint db_codegen db_deadlock db_dump db_dump185 db_hotbackup db_load db_printlog db_recover db_stat db_upgrade db_verify deallocvt diff diff-jars diff3 dir dircolors dirname display du dumphint dvipdf dwp eject elfedit env eps2eps eqn eu-addr2line eu-ar eu-elfcmp eu-elflint eu-findtextrel eu-make-debug-archive eu-nm eu-objdump eu-ranlib eu-readelf eu-size eu-stack eu-strings eu-strip eu-unstrip expand expr extcheck8 factor fallocate fax2ps fax2tiff fc-cache fc-cat fc-list fc-match fc-query fc-s |
This file contains 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 B = require("bluebird/js/main/promise")(); | |
var Bproto = B.prototype; | |
var deferredPrototype = B.pending().constructor.prototype; | |
deferredPrototype.makeNodeResolver = function() { | |
return this.asCallback; | |
}; | |
function bind(fn, ctx) { |
This file contains 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
/* jshint newcap: false */ | |
var B = require("bluebird/js/main/promise")(); | |
var Bproto = B.prototype; | |
var deferredPrototype = B.pending().constructor.prototype; | |
deferredPrototype.makeNodeResolver = function() { | |
return this.asCallback; | |
}; |
This file contains 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 MasterStore() { | |
this.datastore = {}; | |
} | |
MasterStore.prototype.has = function(key, value){ | |
if (value == null) return this.datastore.hasOwnProperty(key); | |
if (Array.isArray(value)) { | |
for (var i = 0; i < value.length; i++) { | |
if (this.datastore[key].indexOf(value[i]) < 0) { | |
return false; |
NewerOlder