find . -name '*.js' -exec sh -c 'mv "$0" "${0%.js}.jsx"' {} \;for i in *; do convert $i "${i%.*}.webp"; done | import puppeteer from "puppeteer-extra"; | |
| import StealthPlugin from "puppeteer-extra-plugin-stealth"; | |
| puppeteer.use(StealthPlugin()); | |
| (async () => { | |
| const browser = await puppeteer.launch({ headless: false }); | |
| const page = await browser.newPage(); | |
| const navigationPromise = page.waitForNavigation(); | |
| await page.goto("https://accounts.google.com/"); |
| ❯ autocannon -c 5 -a 5 --timeout 1000000 'http://143.110.241.172/stream?limit=100000' | |
| Running 5 requests test @ http://143.110.241.172/stream?limit=100000 | |
| 5 connections | |
| ┌─────────┬──────────┬──────────┬──────────┬──────────┬────────────┬──────────┬──────────┐ | |
| │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │ | |
| ├─────────┼──────────┼──────────┼──────────┼──────────┼────────────┼──────────┼──────────┤ | |
| │ Latency │ 14475 ms │ 14588 ms │ 15197 ms │ 15197 ms │ 14666.8 ms │ 270.1 ms │ 15197 ms │ |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <title>Split vs Slice #jsbench #jsperf</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
| <script src="./suite.js"></script> | |
| </head> | |
| <body> | |
| <h1>Open the console to view the results</h1> |
| import { randomBytes, scryptSync } from 'crypto'; | |
| // Pass the password string and get hashed password back | |
| // ( and store only the hashed string in your database) | |
| const encryptPassowrd = (password: string, salt: string) => { | |
| return scryptSync(password, salt, 32).toString('hex'); | |
| }; | |
| /** | |
| * Hash password with random salt |
| import { TextEncoder } from "util"; | |
| import { SignJWT, jwtVerify } from "jose"; | |
| const secret = process.env.JWT_SECRET ?? "I like bananas"; | |
| const textEncoder = new TextEncoder(); | |
| const keyToSignWith = textEncoder.encode(secret); | |
| const jwt = await new SignJWT({ | |
| email: "[email protected]" |
| [ | |
| "US East (N. Virginia) us-east-1", | |
| "US East (Ohio) us-east-2", | |
| "US West (N. California) us-west-1", | |
| "US West (Oregon) us-west-2", | |
| "Africa (Cape Town) af-south-1", | |
| "Asia Pacific (Hong Kong) ap-east-1", | |
| "Asia Pacific (Jakarta) ap-southeast-3", | |
| "Asia Pacific (Mumbai) ap-south-1", | |
| "Asia Pacific (Osaka) ap-northeast-3", |
| [ | |
| { | |
| "id": "0189hNRf2g", | |
| "joke": "I'm tired of following my dreams. I'm just going to ask them where they are going and meet up with them later." | |
| }, | |
| { | |
| "id": "08EQZ8EQukb", | |
| "joke": "Did you hear about the guy whose whole left side was cut off? He's all right now." | |
| }, | |
| { |