This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
</head> | |
<body> | |
<script> | |
window.startClerk = async () => { | |
function formRedirect(){ | |
const form = '<form method="get" action="" name="redirect"></form>'; |
This file contains 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
// src/t3Env.ts | |
import { createEnv, LooseOptions, StrictOptions } from '@t3-oss/env-core'; | |
import { z, ZodType, ZodString } from 'zod'; | |
function validateEnv< | |
TPrefix extends string, | |
TServer extends Record<string, ZodType> = NonNullable<unknown>, | |
TClient extends Record<string, ZodType> = NonNullable<unknown> | |
>(opts: LooseOptions<TPrefix, TServer, TClient> | StrictOptions<TPrefix, TServer, TClient>) { | |
return opts; |
This file contains 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
<LazyFrame | |
loading="lazy" | |
style={{ | |
position: "absolute", | |
top: "0", | |
left: "0", | |
width: "100%", | |
height: "100%", | |
borderRadius: "10px", | |
}} |
This file contains 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 isbot from "isbot"; | |
const isBot = isbot(Astro.request.headers.get("User-Agent")); | |
console.log("isBot", isBot); | |
--- | |
<h1>{isBot ? "bot" : "user"}</h1> |
deno run --watch --allow-net main.ts
curl -d 'test world :)' http://localhost:8085
deno run --allow-net=0.0.0.0:8085 https://gist.githubusercontent.com/JLarky/6a77d9d483b7f0067fd3eea1b785e628/raw/3cf707ae447f8309564b94613a014f9ddf3f972d/main.ts
curl -d 'test world :)' http://localhost:8085
This file contains 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
bbbbbbaaaaaaabbaabaaabaabaaaaabbbbbabaaabaaababaaaabbbaabaababbaaaaabaabbababbaabaaaabaabbbaababbaabbaaabbaabaaabbbbbbaaababaabaaabbbabbbaababbaaaaaaaaabaabaaaaaaaaaaaabbbaaababaabaaabaaaaababaabaaaaabaaaaabaababababaaaababbbabbaababaaabbaaaaaabaaabaaaabaaaaabaabaaaaaababbabbaaaababaabbbaababaabaabaaaaabbbbaabbababaaaaabaabaabbaaabababaaaaabbbbbabaabaabbabaabaabaaaabaaaaabbaaaaabbbaabaabaaabaaabbbaabbbabbaaaaaaaabababbaaaabbaaabaaabababaaaaaabababaabaabbabbbaaabaaaaaabbaabbbabaabaaaaaaaaaaaaaaaabbaaaabaaaabaaaaaabbbaaabbabaaaaaaabbaaababaabaabaabaaaaaabbbaabbaabbaababaaabbbababaaaabbaaaaabbaaabaaaaaaaaabaabbbabaaaabbabaaaababbaaabbabaababbaabaababaabaaabbbbaaabaaaabbbbbaabbbaababbbaaababababbbabbbababbbaaabaaaabaababaaaabaabbabaaabbbaaabaabaababababaaaaaabbaabbaaaaabaaababaabaaababbaabbbaabbbbaaaaababaaaaaabaaaabaaababababaaaaaaababaaabaaababbaaaaaaabababbbabaabaabbbaababababaabbaabaaababaabbabbbaaaababbaaabbbabaaaaaabbabbababaaaaaabaaaaabaaaabaaaabaaaabaaabaaaaaaabbbababaaaabaaaaabaabaabbbabaaababaaabaaaaaba |
This file contains 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
async function listFiles(dir: string) { | |
try { | |
const { readdir } = await import('fs/promises'); | |
const files = await readdir(dir); | |
console.log(files); | |
} catch (err) { | |
throw err; | |
} | |
} | |
console.log(await listFiles('.')); |
This file contains 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
// ~/Library/Application\ Support/Code/User/keybindings.json | |
// https://sharegpt.com/c/jZsUO6C | |
{ | |
"key": "shift+z shift+z", | |
"command": "workbench.action.files.save", | |
"when": "editorTextFocus && amVim.mode == 'NORMAL'" | |
}, | |
{ |
This file contains 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
<template id="copy-button"><CopyButton /></template> | |
<script> | |
// https://www.roboleary.net/2022/01/13/copy-code-to-clipboard-blog.html | |
if (navigator.clipboard) { | |
let copyButton = document.querySelector("#copy-button") as HTMLTemplateElement; | |
let blocks = document.querySelectorAll("pre.astro-code"); | |
blocks.forEach(block => { | |
let button = document.createElement("button"); | |
const icon = copyButton.content.cloneNode(true); | |
button.appendChild(icon); |