This file contains hidden or 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
import { zValidator } from '@hono/zod-validator'; | |
import { Hono } from 'hono'; | |
import { z } from 'zod'; | |
const app = new Hono<{ Bindings: { DKIM_PRIVATE_KEY: string } }>(); | |
app.get('/', (c) => c.text('Hello Hono!')); | |
app.post( | |
'/send_email', | |
zValidator( |
This file contains hidden or 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
import type { PlayerController } from '@chientrm/game'; | |
import type { GameScene } from './scene'; | |
export class Player { | |
ship: Phaser.GameObjects.Sprite; | |
flame: Phaser.GameObjects.Sprite; | |
controller: PlayerController; | |
anim: string; | |
constructor(scene: GameScene, controller: PlayerController, slot: number) { | |
this.controller = controller; |
This file contains hidden or 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
import { CLIENT_SECRET, PAYPAL, WEBHOOK_ID } from '$env/static/private'; | |
import { PUBLIC_CLIENT_ID } from '$env/static/public'; | |
import { Events } from '$lib/schema'; | |
import { forceOk } from '$lib/util.server'; | |
import { Buffer } from 'node:buffer'; | |
const authenticate = () => | |
fetch(`${PAYPAL}/v1/oauth2/token`, { | |
method: 'POST', | |
headers: { |
This file contains hidden or 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
onMount(() => { | |
window.dataLayer = window.dataLayer || []; | |
window.dataLayer.push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); | |
const gtmScript = document.createElement('script'); | |
gtmScript.src = 'https://www.googletagmanager.com/gtm.js?id=' + PUBLIC_TAG_ID; | |
document.head.append(gtmScript); | |
}); |
This file contains hidden or 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
import { PKCS8 } from '$env/static/private'; | |
import { COOKIE_HOST, audience, issuer } from '$lib/constants'; | |
import { SignJWT, importPKCS8, type JWTPayload } from 'jose'; | |
const forPrivateKey = importPKCS8(PKCS8, 'RS512'); | |
export const sign = async <T extends JWTPayload>(data: T) => | |
new SignJWT(data) | |
.setProtectedHeader({ alg: 'RS512' }) | |
.setIssuedAt() |
This file contains hidden or 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
import { PUBLIC_SPKI } from '$env/static/public'; | |
import { audience, issuer } from '$lib/constants'; | |
import { importSPKI, jwtVerify } from 'jose'; | |
const forPublicKey = importSPKI(PUBLIC_SPKI, 'RS512'); | |
export const verify = async <T>(jwt: string) => | |
jwtVerify(jwt, await forPublicKey, { issuer, audience }).then((result) => result.payload as T); |
OlderNewer