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); |
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
| 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 { 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
| 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 { 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
| // Source: https://twitter.com/calebporzio/status/1151876736931549185 | |
| <div class="flex"> | |
| <aside class="h-screen sticky top-0"> | |
| // Fixed Sidebar | |
| </aside> | |
| <main> | |
| // Content | |
| </main> |
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 { array, object, string } from 'yup'; | |
| import { validate } from './validate'; | |
| import { Router, json, error } from 'itty-router'; | |
| export default { | |
| async fetch( | |
| request: Request, | |
| env: Env, | |
| ctx: ExecutionContext, | |
| ): Promise<Response> { |
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
| Scaffold( | |
| snackbarHost = { SnackbarHost(snackbarHostState) }, | |
| bottomBar = { | |
| NavigationBar { | |
| val navBackStackEntry by navController.currentBackStackEntryFlow.collectAsState(null) | |
| val currentDestination = navBackStackEntry?.destination | |
| NavigationBarItem( | |
| selected = currentDestination?.route == Routes.HOME, | |
| onClick = { | |
| navController.navigate(Routes.HOME) { |
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
| package site.chientrm.youwave.services.youwave | |
| import com.google.firebase.auth.FirebaseAuth | |
| import com.squareup.moshi.Moshi | |
| import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory | |
| import kotlinx.coroutines.runBlocking | |
| import kotlinx.coroutines.tasks.await | |
| import okhttp3.OkHttpClient | |
| import retrofit2.Retrofit | |
| import retrofit2.converter.moshi.MoshiConverterFactory |
NewerOlder