Skip to content

Instantly share code, notes, and snippets.

View svex99's full-sized avatar
🐛
Bugin' Around

Enmanuel Verdesia Suárez svex99

🐛
Bugin' Around
View GitHub Profile
@svex99
svex99 / data-table.svelte
Created April 20, 2024 08:23
Svelte data-table with generics and back-end pagination (shadcn-svelte)
<script context="module" lang="ts">
export type Column<T> = {
accessor: keyof T;
header: string;
format?(item: T): string;
cell?: (item: T) => any;
};
</script>
<script lang="ts" generics="T extends { id: string }">
@svex99
svex99 / context.py
Last active June 27, 2022 23:36
Allows you to import your main package folder (or other) from any part of your project.
import sys
import os
sys.path.append(os.getcwd())