vtu_TestSupportmain.tsx19 matches
6const SkipIndicator = '⏭️ [SKIP]: '
78let beforeEachFns:Function[] = []
9let afterEachFns:Function[] = []
10let beforeAllFns:Function[] = []
11let afterAllFns:Function[] = []
1213/**** describe ****/
1415export async function describe (
16CollectionName:string, Collection:Function
17):Promise<void> {
18const outerBeforeEachFns = beforeEachFns; beforeEachFns = []
41/**** xdescribe ****/
4243export async function xdescribe (
44CollectionName:string, Collection:Function
45):Promise<void> {
46console.log(SkipIndicator + CollectionName)
49/**** it ****/
5051export async function it (
52SpecName:string, Spec:Function, Timeout:number = 2000
53) {
54try {
73/**** xit ****/
7475export function xit (
76SpecName:string, Spec:Function, Timeout:number = 2000
77) {
78console.log(SkipIndicator + SpecName)
81/**** fail ****/
8283export function fail (Message:string):void {
84throw new Error(Message)
85}
87/**** before/afterAll/Each ****/
8889export function beforeAll (Handler:Function):void { beforeAllFns.push(Handler) }
90export function afterAll (Handler:Function):void { afterAllFns.push(Handler) }
91export function beforeEach(Handler:Function):void { beforeEachFns.push(Handler) }
92export function afterEach (Handler:Function):void { afterEachFns.push(Handler) }
93
94/**** runWithTimeout ****/
9596async function runWithTimeout(
97Handler:Function, Timeout:number
98):Promise<void> {
99return Promise.race([
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
2import crypto from "node:crypto"
34export default async function vtu_generateJWTKeyPair ():Promise<void> {
5const { privateKey, publicKey } = crypto.generateKeyPairSync('ec', {
6namedCurve:'P-384',
vtu_JWTisValidmain.tsx1 match
8import { blob } from "https://esm.town/v/std/blob"
910export default async function JWTisValid (JWT:string):Promise<boolean> {
11expectNonEmptyString('JWT',JWT)
12
vtu_JWTformain.tsx1 match
8import { blob } from "https://esm.town/v/std/blob"
910export default async function JWTfor (
11User:string, Roles:string, Expiration:number = 3600
12) {
6const HashPattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?:\d+:(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
78export default async function PBKDF2HashMatches (
9PBKDF2Hash:string, Password:string
10):Promise<boolean> {
vtu_PBKDF2Hashmain.tsx1 match
5} from 'npm:javascript-interface-library'
67export default async function PBKDF2Hash (
8Password:string, Salt?:string, Iterations:number=10000
9):Promise<string> {
7const numPointsPerCircle = 200; // Set number of points per circle
89function gcd(a: number, b: number): number {
10return b === 0 ? a : gcd(b, a % b);
11}
1213function lcm(a: number, b: number): number {
14return (a * b) / gcd(a, b);
15}
1617function App() {
18const chartRef = useRef(null);
19const chartInstanceRef = useRef(null);
130}
131132function complexExp(t) {
133return { re: Math.cos(t), im: Math.sin(t) };
134}
135136function complexMult(a, b) {
137if (typeof b === "number") {
138return { re: a.re * b, im: a.im * b };
144}
145146function complexAdd(a, b) {
147return { re: a.re + b.re, im: a.im + b.im };
148}
149150function client() {
151createRoot(document.getElementById("root")).render(<App />);
152}
153if (typeof document !== "undefined") { client(); }
154155export default async function server(request: Request): Promise<Response> {
156return new Response(
157`
webcamEffectsmain.tsx5 matches
10import { createRoot } from "https://esm.sh/react-dom/client";
1112function App() {
13const videoRef = useRef<HTMLVideoElement>(null);
14const canvasRef = useRef<HTMLCanvasElement>(null);
2526useEffect(() => {
27async function setupWebcam() {
28try {
29audioContextRef.current = new (window.AudioContext || (window as any).webkitAudioContext)();
30
31// Function to create and play continuous audio effect
32const playContinuousAudio = (baseFreq: number, modFreq: number) => {
33if (!audioContextRef.current) return;
306307// client-side only code
308function client() {
309createRoot(document.getElementById("root")!).render(<App />);
310}
312313// server-side only code
314export default async function server(request: Request): Promise<Response> {
315return new Response(
316`
shySapphireLeopardmain.tsx3 matches
5import { createRoot } from "https://esm.sh/react-dom/client";
67function App() {
8const links = [
9{ name: "Twitter", url: "https://x.com/MO_warsi786" },
30}
3132function client() {
33createRoot(document.getElementById("root")).render(<App />);
34}
36if (typeof document !== "undefined") { client(); }
3738async function server(request: Request): Promise<Response> {
39return new Response(
40`