Skip to content

Instantly share code, notes, and snippets.

View Theo-Steiner's full-sized avatar
🍣
Learning something new every day!

Theodor Steiner Theo-Steiner

🍣
Learning something new every day!
View GitHub Profile
@Theo-Steiner
Theo-Steiner / #Svelte async store initiation
Last active March 25, 2022 01:05
Svelte async store initiation with fetched results
How to asynchronously set the contents of a store based on a fetch call.
@Theo-Steiner
Theo-Steiner / #SvelteKit show route 'a' at route 'b'
Last active January 23, 2022 08:54
Show page at a different route than its original route
How to show a route 'a' at route 'b' even with running the module script.
@Theo-Steiner
Theo-Steiner / #SvelteKit return image from endpoint
Created January 23, 2022 09:05
Returning a base64 encoded image from a Svelte Kit endpoint
How to return a base64 encoded image from a Svelte Kit endpoint.
This example has the /routes/[slug].png.ts route dynamic but doesn't do anything with the slug.
This is where you could do some fancy image generation based on the slug.
console.log("hey, maybe you shouldn't execute untrusted code from the interwebs?");