Skip to content

Instantly share code, notes, and snippets.

View frstycodes's full-sized avatar

Sandesh frstycodes

  • Nepal
View GitHub Profile
@frstycodes
frstycodes / settings.json
Last active January 7, 2025 04:00
VS Code settings for Miniamal Look
/* Make sure to add following extensions:
****************************************
* 1. APC Customization UI++
* 2. Symbols Icon Theme
* 3. AbelFubu theme -> AbelFubu Contrast variant *Note: theme is only for syntax highlighting, ui colors are included in this file.
* 4. Make sure to change a few settings like font, font size to your liking.
****************************************
*/
{
@frstycodes
frstycodes / midnight.css
Last active March 27, 2025 08:07
Midnight discord theme
@import url("https://fonts.googleapis.com/css2?family=figtree:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
:root {
container-name: root;
--custom-guild-list-padding: 12px;
--panel-backdrop-filter: none;
--background-base-lower: --bg-4;
--custom-app-top-bar-height: 24px;
@frstycodes
frstycodes / custom-use-mutation.ts
Last active November 9, 2025 19:16
Custom useMutation implementation
import {
type MutationOptions as RQ_MutationOptions,
type InvalidateOptions,
useMutation as RQ_useMutation,
} from "@tanstack/react-query"
type ValOrFunc<Value, Args extends any[]> = Value | ((...args: Args[]) => Value)
function extractFromValOrFunc<Value, Args extends any[]>(
item: ValOrFunc<Value, Args>,
...args: Args
@frstycodes
frstycodes / tanstack-router-start-data-fetching.tsx
Last active May 10, 2026 09:33
Ideal data fetching strategy for Tanstack router/start with Tanstack query. You can omit the waitIfSSR function if you're not using SSR but make sure to not await the ensureQueryData function in the loader or navigation will feel slow.
async function waitIfSSR(...promises: Promise<any>[]) {
if (typeof window === "undefined") await Promise.all(promises)
}
export const Route = createFileRoute("/_authed/dashboard/$id/accounts/")({
component: RouteComponent,
validateSearch,
beforeLoad: ({ search, params }) => ({ search, params }),
/*
Pass a promise to waitIfSSR function so it waits for the data to load if it's SSR so the users get the full page