Skip to content

Instantly share code, notes, and snippets.

View Ganbin's full-sized avatar
🌱
Building

Ganbin Ganbin

🌱
Building
  • Switzerland
  • 06:26 (UTC +01:00)
View GitHub Profile
@mfrancis107
mfrancis107 / use-debounced-search-param.ts
Created November 6, 2025 15:20
Tanstack Search Param Debouncer
// src/routes/search/useDebouncedSearchParam.ts
import { useEffect, useMemo, useRef, useState } from 'react'
import { useDebouncedValue } from '@tanstack/react-pacer' // React adapter re-exports
// Alternative import also works in examples: '@tanstack/react-pacer/debouncer'.
// See Pacer React adapter docs. :contentReference[oaicite:5]{index=5}
type RouteSearchFrom<RouteApi> = RouteApi extends { types: { fullSearchSchema: infer TSchema } }
? TSchema extends Record<string, unknown>
? TSchema
: Record<string, unknown>
@gpichot
gpichot / example.ts
Created September 25, 2024 16:28
Tanstack React Query pattern matching
export default function SessionsList() {
const sessionsQuery = useSessionsListQuery();
return (
<PageLayout title="My sessions">
{matchQueryStatus(sessionsQuery, {
Loading: (
<>
<Skeleton height={70} mt={6} />
<Skeleton height={70} mt={6} />
@greimela
greimela / index.html
Created January 19, 2024 11:39
Minimal Chia WalletConnect implementation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chia WalletConnect Demo</title>
</head>
<body>
<div>
<button id="connect-button">Connect Wallet</button>
@SlowestTimelord
SlowestTimelord / chia-gpu-cpu-plotting-options.md
Last active April 3, 2023 17:34
Chia GPU and CPU plotting options
@ludwigdn
ludwigdn / git-worktrees.md
Last active September 4, 2025 12:47
Git worktrees cheatsheet

Git worktrees cheatsheet

Create new worktree from existing branch

git worktree add <WORKTREE-PATH> <BRANCH>

Create new branch and its worktree

@ziplex
ziplex / fix-ubuntu-with-kernal-boot-options.sh
Created August 28, 2020 18:49 — forked from donrestarone/fix-ubuntu-with-kernal-boot-options.sh
fixing ubuntu system lockups with Ryzen CPU's
# open the boot parameters file for the linux kernal
sudo nano /etc/default/grub
# we will be editing the 'GRUB_CMDLINE_LINUX_DEFAULT' key
#set it to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash processor.max_cstate=1 rcu_nocbs=0-11"
# test for a while and then set it to 5 if all is well
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash processor.max_cstate=5 rcu_nocbs=0-11"
@johnwgillis
johnwgillis / How to setup GPG for git.md
Last active October 9, 2025 12:16
How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

  1. Install GPG tools
    1. Install GPG tools and setup pin entry by running:
    brew install gnupg pinentry-mac
    mkdir -m 700 -p ~/.gnupg
    echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
    killall gpg-agent
    
@Brainiarc7
Brainiarc7 / C-states.md
Created July 14, 2018 00:20 — forked from wmealing/C-states.md
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

@Bilka2
Bilka2 / webhook.py
Last active October 23, 2025 05:37
Simple discord webhook with python
import requests # dependency
url = "<your url>" # webhook url, from here: https://i.imgur.com/f9XnAew.png
# for all params, see https://discordapp.com/developers/docs/resources/webhook#execute-webhook
data = {
"content" : "message content",
"username" : "custom username"
}
@eneko
eneko / list-of-curl-options.txt
Last active November 28, 2025 16:04
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password