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
{} |
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
/* eslint eqeqeq: 0 */ | |
import React from 'react'; | |
function computeHeight(node) { | |
const totalHeight = parseInt(getComputedStyle(node).height, 10); | |
const padding = | |
parseInt(getComputedStyle(node).paddingTop, 10) + | |
parseInt(getComputedStyle(node).paddingBottom, 10); | |
return totalHeight - padding; | |
} |
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 fs = require("fs"); | |
const path = require("path"); | |
const walk = function(dir, done) { | |
let results = []; | |
fs.readdir(dir, function(err, list) { | |
if (err) return done(err); | |
let pending = list.length; | |
if (!pending) return done(null, results); | |
list.forEach(function(file) { |
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 isObject = obj => obj === Object(obj); | |
const merge = (obj1, obj2) => { | |
Object.keys(obj1).forEach(key => { | |
if (Array.isArray(obj1[key])) { | |
if (obj2[key]) obj1[key] = [...obj1[key], ...obj2[key]]; | |
} else if (isObject(obj1[key])) { | |
if (obj2[key]) obj1[key] = { ...obj1[key], ...obj2[key] }; | |
} else { | |
if (obj2[key] !== undefined) { |
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
/** | |
* Return a timestamp with the format "m-d-yy" | |
* @type {Date} | |
*/ | |
function timeStamp() { | |
// Create a date object with the current time | |
let now = new Date(); | |
// Create an array with the current month, day and time |
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 arr1 = [1, 2, 3, 4, 5]; | |
if (arr1.indexOf(1) !== -1) { | |
console.log("Arr1 HAS the integer 1!"); | |
} | |
if (arr1.includes(1)) { | |
console.log("Arr1 HAS the integer 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
find . -name "node_modules" -exec rm -rf '{}' + |
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 iterateObject = (obj, executeOnValue) => { | |
Object.keys(obj).forEach(name=> { | |
let val = obj[name]; | |
if (typeof val === "object") { | |
return iterateObject(val, executeOnValue); | |
} else if (val === undefined) { | |
obj[name] = ""; | |
} else { | |
obj[name] = executeOnValue(val); | |
} |
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 "@blueprintjs/icons/lib/css/blueprint-icons.css"; | |
import "@blueprintjs/core/lib/css/blueprint.css"; |
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
module.exports = { | |
plugins: ["react","markdown"], | |
globals: { | |
importScripts: true | |
}, | |
env: { | |
browser: true, | |
node: true, | |
es6: true | |
}, |