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 { default: axios } = require("axios"); | |
const expect = require('expect') | |
const AUTH_TOKEN = Buffer.from(process.env.API_KEY).toString('base64') | |
axios({ | |
method: 'get', | |
url: 'https://api.stripe.com/v1/customers', | |
headers: { | |
'Authorization': `Basic ${AUTH_TOKEN}`, |
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 { default: axios } = require("axios"); | |
const AUTH_TOKEN = Buffer.from(process.env.API_KEY).toString('base64') | |
axios({ | |
method: 'get', | |
url: 'https://api.stripe.com/v1/customers', | |
headers: { | |
'Authorization': `Basic ${AUTH_TOKEN}`, | |
'content-type': 'application/x-www-form-urlencoded' | |
}, |
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
<html> | |
<head> | |
<style type="text/css"> | |
#header { | |
padding: 0; | |
} | |
.content { | |
width: 100%; | |
background-color: #777; | |
color: white; |
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'); | |
(async () => { | |
const browser = await puppeteer.launch() | |
const page = await browser.newPage() | |
await page.goto('https://theheadless.dev/posts') | |
await page.pdf({ path: 'hd-posts.pdf' }) | |
await browser.close() | |
})() |
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('playwright'); | |
(async () => { | |
const browser = await chromium.launch() | |
const page = await browser.newPage() | |
await page.goto('https://theheadless.dev/posts') | |
await page.pdf({ path: 'hd-posts.pdf' }) | |
await browser.close() | |
})() |
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'); | |
(async () => { | |
const browser = await puppeteer.launch() | |
const page = await browser.newPage() | |
const navigationPromise = page.waitForNavigation() | |
const templateHeader = fs.readFileSync('template-header.html', 'utf-8') |
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('playwright') | |
const fs = require('fs'); | |
(async () => { | |
const browser = await chromium.launch() | |
const page = await browser.newPage() | |
const navigationPromise = page.waitForNavigation() | |
const templateHeader = fs.readFileSync('template-header.html', 'utf-8') |
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("playwright"); | |
const assert = require("chai").assert; | |
const fs = require('fs'); | |
(async () => { | |
const browser = await chromium.launch(); | |
const page = await browser.newPage(); | |
let rawdata = fs.readFileSync('books.json'); | |
const bookList = JSON.parse(rawdata) |
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("playwright"); | |
const assert = require("chai").assert; | |
const fs = require('fs'); | |
(async () => { | |
const browser = await chromium.launch(); | |
const page = await browser.newPage(); | |
let rawdata = fs.readFileSync('books.json'); | |
const bookList = JSON.parse(rawdata) |
NewerOlder