Skip to content

Instantly share code, notes, and snippets.

'use client'
import { Button } from '@/components/ui/button'
import { Card } from '@/components/ui/card'
import { ArrowUpRight, CheckCircle2, X } from 'lucide-react'
import { useEffect, useMemo, useState } from 'react'
type PlanKey = 'monthly' | 'yearly'
const PLAN_CONFIG: Record<
#!/usr/bin/env node
// Get the token from command line argument or environment variable
const PRODUCT_AMOUNT = process.env.PRODUCT_AMOUNT || 4900;
const CUSTOMER_NAME = process.env.CUSTOMER_NAME || 'Jane Doe';
const USER_TOKEN = process.env.POLAR_TOKEN || 'polar_oat_...';
const CUSTOMER_EMAIL = process.env.CUSTOMER_EMAIL || '[email protected]';
const PRODUCT_ID = process.env.PRODUCT_ID || 'fd44360d-490d-497c-b412-e0eaa932cc27';
async function runCheckoutFlow() {
#!/bin/bash
# PostgreSQL Pre-Check Script
# This script collects information about a PostgreSQL instance and generates a summary report.
set -e
# Default values
PGHOST="your-rds-endpoint.region.rds.amazonaws.com"
PGPORT="5432"
@rishi-raj-jain
rishi-raj-jain / index.ts
Last active December 9, 2025 07:26
Google OAuth 2.0 on the Edge with Hono and Cloudflare Workers
// Do enable nodejs_compat
// https://developers.cloudflare.com/workers/runtime-apis/nodejs/
import crypto from 'node:crypto'
import { Context, Hono } from 'hono'
const app = new Hono()
function generateJWT(payload, secret, expiresIn) {
const header = { alg: 'HS256', typ: 'JWT' }
const encodedHeader = base64UrlEncode(JSON.stringify(header))
const fs = require("fs");
const path = require("path");
const https = require("https");
var ImageKit = require("imagekit");
const projectId = "";
var imagekit = new ImageKit({
publicKey: "",
privateKey: "",
import os, re, requests, shutil, asyncio, time, aiohttp
root = next(os.walk('.'))[1]
root.remove('.git')
pattern = r'https?://(?:[^\s()<>{}\[\]]+\.(?:jpg|jpeg|gif|png))(?![^\s]*\))'
async def get(url, session):
try:
async with session.get(url=url) as response:
const { data } = require("./data");
const StoryblokClient = require("storyblok-js-client");
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const Storyblok = new StoryblokClient({
oauthToken: "",
});
const spaceId = 164462;
// This file was added by layer0 init.
// You should commit this file to source control.
require('dotenv').config()
const { Router, CustomCacheKey } = require('@layer0/core/router')
const { nuxtRoutes } = require('@layer0/nuxt')
const homeRedirect = require('./faas/home-redirect.js')
const clearCache = require('./faas/clear-cache.js')
const sitemap = require('./faas/sitemap.js')
<script>
// Check that service workers are supported
if ('serviceWorker' in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener('load', () => {
navigator.serviceWorker.register('/service-worker.js');
});
}
</script>
npx workbox-cli injectManifest && node compile_sw.js