Skip to content

Instantly share code, notes, and snippets.

@ImSingee
ImSingee / building-sync-systems.md
Created August 26, 2025 06:06 — forked from pesterhazy/building-sync-systems.md
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@ImSingee
ImSingee / building-sync-systems.md
Created August 26, 2025 06:06 — forked from pesterhazy/building-sync-systems.md
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@ImSingee
ImSingee / useBroadcastChannel.ts
Created June 11, 2024 02:41 — forked from KristofferEriksson/useBroadcastChannel.ts
A React hook that allows you to send and receive messages between browser tabs or windows
import { useCallback, useEffect, useRef, useState } from "react";
interface UseBroadcastChannelOptions {
name: string;
onMessage?: (event: MessageEvent) => void;
onMessageError?: (event: MessageEvent) => void;
}
interface UseBroadcastChannelReturn<D, P> {
isSupported: boolean;
@ImSingee
ImSingee / audit.yml
Created November 15, 2023 12:36 — forked from LukeMathWalker/audit.yml
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@ImSingee
ImSingee / viewtree.py
Created October 19, 2023 03:04 — forked from avielg/viewtree.py
SwiftUI View Tree Graph
#!/opt/homebrew/bin/python3
import re
import glob
import os
import graphviz
##################################################################################
######### USAGE #########
@ImSingee
ImSingee / go-embed-data-and-gen-new.go
Created April 24, 2023 12:24
Embed data in a Go program and generate new executable (just a demo, not optimized for production)
package main
import (
"bytes"
"fmt"
"io"
"os"
)
const flagStart = `-----{% start %}-----`
@ImSingee
ImSingee / raindrop_clear.py
Last active May 22, 2024 10:11
Clear large Raindrop collections via API
collection_id = '...' # -99 to empty trash
token = '...'
from requests import Session
session = Session()
session.headers = {
'Authorization': f'Bearer {token}'
}
@ImSingee
ImSingee / KM_LeetCode_ID.py
Last active August 11, 2022 05:57
LeetCode id -> title slug
#!/opt/bin/python3
import os
import requests
question_id = os.environ.get('KMVAR_LeetCodeID', 'add-two-numbers').strip()
cookies={
"LEETCODE_SESSION": ''
}
#!/opt/bin/python3
# pip install markdownify
import os
import requests
question_id = os.environ.get('KMVAR_LeetCodeID', 'add-two-numbers').strip()
cookies={
#!/opt/bin/python3
# pip install markdownify
import os
import requests
import markdownify
question_id = os.environ.get('KMVAR_LeetCodeID', 'add-two-numbers')