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 gitlog = require('gitlog'); | |
const {resolve} = require('path'); | |
const changesToFiles = (opts = { repoPath: __dirname }) => { | |
const commitMap = gitlog({ | |
repo: opts.repoPath | |
, number: opts.max || 1999999 | |
, execOptions: | |
{ | |
maxBuffer: 99999 * 1024 |
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 log = (i) => { | |
console.log(i); | |
return i; | |
}; | |
const base = v => ({ | |
valueOf: () => v, | |
toString: () => v.toString() | |
}); |
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
# | |
# Development environment | |
# | |
FROM node:10.14.1 | |
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
JSON.stringify([].slice.call(document.querySelectorAll('.js-tweet-text-container')).map((e) => e.textContent)) |
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 sieve(n){ | |
let arr = new Array(n); | |
for(let i = 0; i< arr.length; i++){ | |
arr[i] = true; | |
} | |
arr[0] = null; | |
arr[1] = null; | |
function setToFalseEvery(n){ |
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
/* | |
IOC ... | |
*/ | |
const Bar = () => { | |
return { | |
hello: 'world' | |
}; | |
}; |
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 chai = require('chai'); | |
const expect = chai.expect; | |
describe('An async await test', () => { | |
it(`Should work.`, async () => { | |
const HELLO_WORLD = "Hello World!"; | |
const run = Promise.resolve(HELLO_WORLD); | |
const message = await run; | |
expect(message).to.equal(HELLO_WORLD); |
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 main = async () => console.log(await Promise.resolve("Hello World!")); | |
main(); |
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
console.log('fizzbuzz.js'); | |
const checker = (mod) => (num) => num % mod === 0; | |
const isFizz = (num) => checker(3)(num) ; | |
const isBuzz = (num) => checker(5)(num) ; | |
const isFizzBuzz = (num) => isFizz(num) && isBuzz(num); | |
const fizzBuzzCheck = (num) => { | |
let fizzBuzz = num; | |
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 add = (...args) => { | |
console.log('add ', args) | |
return args.reduce((acc, n) => acc += parseInt(n), 0) | |
} | |
const exec = (fn, ...args) => { | |
console.log('exec ', fn, args) | |
return fn.apply(fn, args) | |
} |