Skip to content

Instantly share code, notes, and snippets.

View shyakadavis's full-sized avatar

SHYAKA Davis shyakadavis

View GitHub Profile
@Lure5134
Lure5134 / VirtualList.svelte
Last active October 25, 2025 06:03
A virtual list for svelte 5.
<script lang="ts" generics="T">
import { onMount, tick, type Snippet } from "svelte";
const {
items,
height,
itemHeight,
children,
getKey,
}: {
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
</head>
<body style="height: 300vh">
<svg style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);"
width="655" height="209" viewBox="0 0 655 209" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M653 207V62C653 28.8629 626.228 2 593.091 2C519.318 2 391.639 2 292.675 2C270.583 2 252.717 19.9124 252.717 42.0038C252.717 63.5378 252.717 81.7221 252.717 81.7221C252.717 81.7221 252.717 81.7221 252.717 81.7221V167C252.717 189.091 234.808 207 212.717 207H2"
stroke="#EAECF0" stroke-width="4" stroke-linecap="round"/>
@danielimmke
danielimmke / robots-txt.ts
Created January 23, 2024 22:11
Example of a dynamic robots.txt that is sensitive to .env
// routes/robots.txt/+server.ts
import { env } from "$env/dynamic/private";
export function GET() {
let rules = [
'User-agent: *'
]
if(env.ORIGIN === 'https://example.com') {
rules.push('Disallow: /*.js$')
@phenomen
phenomen / shadcn-flexoki.css
Created October 8, 2023 06:30
Flexoki theme for shadcn/ui and shadcn-svelte
@layer base {
:root {
--flexoki-bg: 48 100% 97%;
--flexoki-bg-2: 51 33% 92%;
--flexoki-ui: 51 21% 88%;
--flexoki-ui-2: 50 14% 83%;
--flexoki-ui-3: 55 10% 79%;
--flexoki-tx: 0 3% 6%;