find . -name '*.js' -exec sh -c 'mv "$0" "${0%.js}.jsx"' {} \;
for i in *; do convert $i "${i%.*}.webp"; done
import { | |
CognitoIdentityProviderClient, | |
ListUsersCommand, | |
AdminDeleteUserCommand, | |
} from "@aws-sdk/client-cognito-identity-provider"; | |
const USER_POOL_ID = "your-pool-id"; | |
const client = new CognitoIdentityProviderClient({ region: "us-east-1" }); |
import http from "node:http" | |
const hostname = '0.0.0.0'; | |
const port = 80; | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader("Content-Type", "text/html"); | |
res.end("<h1>Hello from LearnAWS.io</h1>\n"); | |
}); |
{ | |
"Version": "2008-10-17", | |
"Id": "PolicyForCloudFrontPrivateContent", | |
"Statement": [ | |
{ | |
"Sid": "AllowCloudFrontServicePrincipal", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "cloudfront.amazonaws.com" | |
}, |
const sleep = (duration) => { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
resolve(); | |
}, duration); | |
}); | |
}; |
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: "cool@guy.com" |
[ | |
{ | |
"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." | |
}, | |
{ |
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/"); |