Skip to content

Instantly share code, notes, and snippets.

View mastilver's full-sized avatar

Thomas Sileghem mastilver

View GitHub Profile

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

const puppeteer = require('puppeteer');
class Webpage {
static async generatePDF(url) {
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode.
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle', networkIdleTimeout: 5000 }); // Adjust network idle as required.
const pdfConfig = {
path: 'url.pdf', // Saves pdf to disk.
format: 'A4',
@jbaiter
jbaiter / 99-powerbank.rules
Last active January 11, 2021 21:38
Small script to inhibit charging when powering a USB-PD Thinkpad with a USB-C powerbank.
ACTION=="change", SUBSYSTEM=="power_supply", RUN+="/usr/local/sbin/powerbank"