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 MAX_RUNNING = 5; | |
const queue = []; | |
let currentlyRunning = 0; | |
async function checkQueue() { | |
if (queue.length === 0 || currentlyRunning >= MAX_RUNNING) return; | |
const [cb, resolve, reject] = queue.shift(); | |
try { | |
currentlyRunning++; |
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
// single-line props | |
<Menu.Items className='absolute right-0 z-20 w-40 mt-1 origin-top-right border rounded | |
bg-neutrals-0 divide-solid border-neutrals-200 focus:outline-none' /> | |
// multi-line props | |
<Menu.Items | |
className='absolute right-0 z-20 w-40 mt-1 origin-top-right border rounded |
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 simpleGit = require('simple-git/promise')(); | |
/* eslint-disable fp/no-mutating-methods, no-console */ | |
const plural = (n, s, p) => `${n} ${n === 1 ? s : p || `${s}s`}`; | |
const ALLOWED_DAYS = 60; | |
async function getUserNames() { | |
const config = await simpleGit.listConfig(); |
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
# This is simple proxy server which is aimed to substitude responses from real | |
# servers with custom data (for debugging). It also handles HTTPS requests by | |
# running one more HTTPS proxy server for each domain you want to fake, as | |
# defined in `HTTPS_PROXIES` variable. This of course will make browser to | |
# notify user that site has changed certificate (which you should generate, by | |
# the way; for example, here: http://www.selfsignedcertificate.com/). | |
# | |
# Dependencies: | |
# | |
# - https://www.npmjs.org/package/send |
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
// pip3 install rxmarbles | |
// marblesgen foo.txt | |
// https://bitbucket.org/achary/rx-marbles/src/762c9519e58f4cb914c9187c0b3019d5c665b933/docs/syntax.md | |
marble foo_example | |
{ | |
source a: +-A-B-- -C-D-- -| | |
source b: +-----X -----Y -| | |
operator foo: +-----{AB,X} -----{CD,Y} -| |
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
module.exports = { | |
env: { | |
browser: true, | |
es2020: true, | |
node: true, | |
}, | |
extends: [ | |
'airbnb-base', | |
], | |
parserOptions: { |
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 edges = [ | |
[0, 6], | |
[17, 5], | |
[2, 7], | |
[4, 14], | |
[12, 9], | |
[15, 5], | |
[11, 1], | |
[14, 8], | |
[16, 6], |
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
// Flows library | |
// README https://gist.github.com/mmavko/e915661ceb235d3706293f2e7a22187a | |
let console; | |
export function setConsole(c) { | |
console = c; | |
} | |
setConsole(global.console); | |
let globalLogging; |
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
import R from "ramda"; | |
// Just like R.zip but can take any number of lists, not only two. | |
export function zip(...lists) { | |
return R.reduce( | |
(a, l) => { | |
if (a) { | |
return R.zipWith((a, b) => R.append(b, a), a, l); | |
} else { | |
return R.map(el => [el], l); |
NewerOlder