A Pen by digital-doodle on CodePen.
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 THE SIZE OF A DIRECTORY USING NODE | |
const fs = require('fs'); | |
const path = require('path'); | |
const yargs = require('yargs'); | |
const argv = yargs.argv; | |
const dist = argv.dir; | |
// du -ach ./dist // unix command | |
const walkSync = (dir, filelist = []) => { |
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 puppeteer = require('puppeteer'); | |
const site = process.argv[2]; | |
async function getPic() { | |
const browser = await puppeteer.launch({headless: false}); | |
const page = await browser.newPage(); | |
await page.goto(site, {waitUntil: 'networkidle2'}); |
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 queryStringToJSON = (query) => { | |
const setValue = (root, path, value) => { | |
if (path.length > 1){ | |
const dir = path.shift(); | |
if (typeof root[dir] == 'undefined') { | |
root[dir] = path[0] === '' ? [] : {}; | |
} | |
arguments.callee(root[dir], path, value); | |
} else { | |
if (root instanceof Array) { |
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 loadScript = (() => { | |
const _loadedScripts = {}; | |
return (src) => { | |
if (_loadedScripts[src]) { | |
return _loadedScripts[src]; | |
} | |
return ( // eslint-disable-line no-return-assign | |
_loadedScripts[src] = new Promise(_injectScriptTag) |
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 default function hash(str) { | |
var hash = 0, i, chr; | |
if (str.length === 0) return hash; | |
for (i = 0; i < str.length; i++) { | |
chr = str.charCodeAt(i); | |
hash = ((hash << 5) - hash) + chr; | |
hash |= 0; // Convert to 32bit integer | |
} | |
return hash; | |
} |
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 minimumChromeCompatableVersion = 53; | |
export default function detectIncompatibleBrowser() { | |
/* | |
-- INCOMPATIBLE browsers -- | |
whatsmybrowser.org/b/PC36ZMV | |
whatsmybrowser.org/b/UMYYENJ | |
whatsmybrowser.org/b/QJ96W2C | |
whatsmybrowser.org/b/9PU8664 | |
whatsmybrowser.org/b/NZ7QMK4 |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
.border{ | |
$colour: red; | |
border:{ | |
bottom: 3px solid $colour{ | |
left:{ | |
radius:20px; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
dont overthink it grid by Chris Coyier http://codepen.io/chriscoyier/pen/eGcLw
and ill murray placeholder images http://www.fillmurray.com/
A Pen by digital-doodle on CodePen.
NewerOlder