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 fs = require("fs"); | |
const pageUrl = "https://imgflip.com/memetemplates"; | |
const viewport = { | |
width: 1600, | |
height: 1200, | |
}; | |
const MEME_LIST_SELECTOR = ".mt-boxes"; |
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
// allcolors.js | |
// https://github.com/bgrins/devtools-snippets | |
// Print out CSS colors used in elements on the page. | |
(function () { | |
// Should include colors from elements that have a border color but have a zero width? | |
var includeBorderColorsWithZeroWidth = false; | |
var allColors = {}; | |
var props = ["background-color", "color", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color"]; |
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() { | |
var elements = document.body.getElementsByTagName('*'); | |
var items = []; | |
for (var i = 0; i < elements.length; i++) { | |
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { | |
items.push(elements[i]); | |
} | |
} | |
if (items.length > 0) { | |
for (var i = 0; i < items.length; i++) { |
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
/** | |
* Write a program that prints the numbers from 1 to 100. | |
* But for multiples of three print “Fizz” instead of the | |
* number and for the multiples of five print “Buzz”. | |
* For numbers which are multiples of both three and five print “FizzBuzz”. | |
*/ | |
function fizzBuzz(num) { | |
var i = 0; | |
while(i <= num) { | |
var output = ""; |
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 getInSequence(array, asyncFunc) { | |
return array.reduce((previous, current) => ( | |
previous.then(accumulator => ( | |
asyncFunc(current).then(result => accumulator.concat(result)) | |
)) | |
), Promise.resolve([])); | |
} | |
/** | |
example of use: |