Skip to content

Instantly share code, notes, and snippets.

View datagutt's full-sized avatar
🐱

Thomas Lekanger datagutt

🐱
View GitHub Profile
@TimonLukas
TimonLukas / ws-client.ts
Created August 12, 2023 19:06
TRPC custom message encoding in WebSocket
export class WsClient {
#socket: WebSocket
#listeners: {
open: ((event: Event) => any)[]
close: ((event: CloseEvent) => any)[]
error: ((event: Event) => any)[]
message: ((event: MessageEvent) => any)[]
} = {
open: [],
close: [],
@Digital39999
Digital39999 / kickPusherTypes.ts
Last active March 19, 2025 18:03
Keep in mind that some of those might also be partial.
export type PusherEvents = {
// 'channel.id';
channel: {
FollowersUpdated: {
followersCount: string | number
channel_id: number
username: unknown
created_at: number
followed: boolean
}
@jluyau
jluyau / lockCheck.js
Last active March 19, 2025 16:31
This script will report packages under the react-spectrum (v3) umbrella which have multiple versions in a project repo by looking at either the package-lock.json or yarn.lock file. Any packages that are reported by this script should be fixed to only have 1 imported version so that react-spectrum works correctly in the project repo.
/*
* This script will report packages under the react-spectrum (v3) umbrella which have multiple versions in a project repo
* by looking at either the package-lock.json or yarn.lock file. Any packages that are reported by this script should be
* fixed to only have 1 imported version so that react-spectrum works correctly in the project repo.
*
* To run this script, temporarily copy it to the root directory of your project and run with node:
* `node lockCheck.cjs`
*
* Please feel free to report any errors/issues.
*/
#!/bin/bash
# run this script by executing:
# wget https://gist.githubusercontent.com/rationalsa/803859153892a9278ad826aabb4276fe/raw/jetson_nano_flash_bootloader.sh
# bash jetson_nano_flash_bootloader.sh
BSP=https://developer.nvidia.com/downloads/remetpack-463r32releasev73t210jetson-210linur3273aarch64tbz2
VER=32.7.3
SHA256=3e7c304b56c2c9f2ca865d560d22e8ab3d99d2e79d782342fb0fb1c4a5e7946e
import { Router } from 'next/router';
import { useEffect } from 'react';
import { publicConfig } from '~/shared/config';
import { trpc } from '~/utils/trpc';
let initVersion = publicConfig.GIT_COMMIT;
function useDetectVersionChange() {
const healthQuery = trpc.health.useQuery(undefined, {
refetchInterval: 10_000,
@jamiepine
jamiepine / settings.json
Last active December 12, 2024 16:30
VSCode Settings
{
"editor.fontSize": 13,
"editor.lineHeight": 1.8,
"editor.fontWeight": "normal",
"debug.console.fontFamily": "dank mono, monaco, monospace",
"editor.fontFamily": "dank mono, monaco, monospace",
"workbench.iconTheme": "bearded-icons",
"editor.fontLigatures": true,
// "workbench.colorCustomizations": {
// "editorGutter.background": "#131521",
@pbadenski
pbadenski / Dockerfile
Last active June 28, 2024 15:58
Node 18.X layer for AWS lambda
FROM public.ecr.aws/amazonlinux/amazonlinux:2
RUN yum groupinstall -y development
RUN yum install -y tar xz python3
RUN yum install -y which clang cmake
RUN mkdir -p /build /opt
WORKDIR /build
RUN curl -fsL https://ftp.gnu.org/gnu/make/make-4.3.tar.gz | tar xzf -
@mislav
mislav / config.json
Last active January 7, 2025 20:51
Experiment in using GitHub CLI to authenticate fetching docker images from GitHub Package Registry
// ~/docker/config.json
{
"credsStore": "desktop",
"credHelpers": {
"docker.pkg.github.com": "gh",
"ghcr.io": "gh"
}
}
@zomars
zomars / modularized-nextjs-project-strucutre.md
Last active May 28, 2024 18:19
Reusable Next.js project structure

File structure

The main file structure is organized as follows:

├── __test__
├── assets
├── configs
├── modules
│   ├── common (Here is what is reused in various modules)
@BestPig
BestPig / analogue-pocket-game-patches.md
Last active November 1, 2024 07:59
Patches to convert GameBoy ROM to `.pocket` (Analogue Pocket ROM)

Patches

Those patches are to convert GameBoy ROM to .pocket ROM. This allows you to play games from the SD Card on your Analogue Pocket.
Feature like RTC and Link cable seems to be unsupported by the Analogue Pocket in GB Studio mode.

Legend of Zelda, The - Link's Awakening DX

GitHub: https://github.com/BestPig/LADX-Disassembly-Pocket

Zelda no Densetsu - Yume o Miru Shima DX