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 { JSDOM } = require('jsdom'); | |
const got = require('got').default; | |
const WIKIPEDIA_URL = 'https://en.wikipedia.org/wiki'; | |
/** | |
* Check if the person with `firstName` and `lastName` is currently alive. | |
* | |
* @param {string} firstName | |
* @param {string} lastName |
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 http = require('http') | |
const server = http.createServer((req, res) => { | |
console.log('%s - %s', req.method, req.url) | |
if (req.url === '/frame') { | |
setTimeout(() => { | |
res.setHeader('Content-Type', 'text/html') | |
res.write(` | |
<!DOCTYPE html> |
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 chromium = require('chrome-aws-lambda'); | |
const puppeteer = require('puppeteer'); | |
const axeCore = require('axe-core'); | |
const { createServer } = require('http'); | |
const { parse: parseURL } = require('url'); | |
const { PORT = 3000 } = process.env; | |
const analyze = async url => { | |
let browser; |
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 fillBucket(remainingWeight, piles, n) { | |
if (n === 0 || remainingWeight === 0) { | |
return 0; | |
} | |
const pile = piles[n - 1]; | |
if (pile.weight > remainingWeight) { | |
return fillBucket(remainingWeight, piles, n - 1); | |
} |
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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.jacoco</groupId> | |
<artifactId>jacoco-maven-plugin</artifactId> | |
<version>0.8.1</version> | |
<executions> | |
<execution> | |
<goals> |
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
∴ npm search slugify | |
npm WARN Building the local index for the first time, please be patient | |
⸨░░░░░░░░░░░░░░░░░░⸩ ⠹ : WARN Building the local index for the first time, please be patient | |
<--- Last few GCs ---> | |
33486 ms: Scavenge 1020.6 (1434.2) -> 1020.5 (1434.2) MB, 3.9 / 0 ms (+ 0.0 ms in 2 steps since last GC) [allocation failure]. | |
33490 ms: Scavenge 1020.5 (1434.2) -> 1020.5 (1434.2) MB, 3.9 / 0 ms [allocation failure]. | |
34443 ms: Mark-sweep 1020.5 (1434.2) -> 1020.4 (1434.2) MB, 952.7 / 0 ms (+ 738.6 ms in 3969 steps since start of marking, biggest step 6.6 ms) [last resort gc]. | |
35417 ms: Mark-sweep 1020.4 (1434.2) -> 1020.4 (1434.2) MB, 974.3 / 0 ms [last resort gc]. |
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
var fs = require('fs'); | |
var read = fs.readFileSync; | |
var write = fs.writeFileSync; | |
var jade = require('jade'); | |
var people = require('./people.json'); | |
var template = jade.compile(read('./person.jade', 'utf8')); | |
people.forEach(function (person) { |
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
$ gyp --depth=. --generator-output=output -f make -D "library=shared_library" | |
$ make -C output | |
CC(target) out/Release/obj.target/str-ends-with/deps/str-ends-with/str-ends-with.o | |
LIBTOOL-STATIC out/Release/libstr-ends-with.a | |
CC(target) out/Release/obj.target/sphia/src/clear.o | |
CC(target) out/Release/obj.target/sphia/src/count.o | |
CC(target) out/Release/obj.target/sphia/src/error.o | |
CC(target) out/Release/obj.target/sphia/src/free.o | |
CC(target) out/Release/obj.target/sphia/src/get.o | |
CC(target) out/Release/obj.target/sphia/src/new.o |
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
var http = require('http'); | |
http | |
.createServer(function (req, res) { | |
// some trivial computation | |
var message = 'Hello world!'; | |
res.writeHead(200, { | |
'content-type': 'text/plain' | |
}); |
NewerOlder