Skip to content

Instantly share code, notes, and snippets.

View CypherpunkSamurai's full-sized avatar
😶
Currently Busy 🌻🐢

Cypherpunk Samurai CypherpunkSamurai

😶
Currently Busy 🌻🐢
View GitHub Profile

Stop using JWTs!

TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.

If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)

A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/

The reason to avoid JWTs comes down to a couple different points:

  • The JWT specification is specifically designed only for very short-live tokens (~5 minute or less). Sessions
@CypherpunkSamurai
CypherpunkSamurai / index.html
Created August 13, 2026 04:43 — forked from smontlouis/index.html
please don't sue me
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<link
rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 64%22><circle cx=%2232%22 cy=%2232%22 r=%2230%22 fill=%22%235b7fe5%22/><circle cx=%2224%22 cy=%2228%22 r=%225%22/><circle cx=%2240%22 cy=%2228%22 r=%225%22/></svg>"
/>
@CypherpunkSamurai
CypherpunkSamurai / README.md
Created August 10, 2026 15:04
How to Fix "Can't Find the Specified File" Folder Rename Bug in Windows 11

Resolving the "Can't Find the Specified File" Folder Rename Bug in Windows 11

It is a notoriously frustrating system bug: you create a new folder in File Explorer, type out a new name, hit Enter, and immediately get slammed with a prompt stating, "Can't find the specified file. Make sure you specify the correct path and file name."

Ironically, executing the exact same rename operation via cmd or your terminal works flawlessly. The underlying file system is perfectly intact, but the graphical shell's directory rename handler is completely broken.

Here is a breakdown of exactly why this happens and the surgical PowerShell fix to resolve it.


#!/usr/bin/env python3
"""Source-based Unity NSISBI extractor for legacy and Unity 6000 installers.
Supported layouts discovered from Unity installers:
* Legacy 2020-2022: 4-byte flagged raw-LZMA1 chunks. The decoded NSIS
instruction table starts at 0x1b74, uses 36-byte records with opcode in
field 0, and field 3 is the compressed data-chunk offset. Each data chunk
expands directly to one file; there is no extra record-size word.
* Unity 6000: 3-byte raw-LZMA1 chunks, an eight-byte declared-size header
# =========================================================================
# Kimi K3 - minimal implementation
# =========================================================================
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.manual_seed(0)
device = 'cuda' if torch.cuda.is_available() else 'cpu'
@CypherpunkSamurai
CypherpunkSamurai / README.md
Created August 7, 2026 08:11 — forked from Maciejdziuba/README.md
The Software Factory Playbook — Dex Horthy's 4-gate workflow (Product → Architecture → Program Design → Vertical Slices) as an installable Claude Code skill. From the Dex Horthy episode on David Ondrej's podcast.

The Software Factory Playbook — Dex Horthy's 4-gate workflow as a skill

A Claude Code Agent Skill built from Dex Horthy's (HumanLayer) playbook on David Ondrej's podcast.

"Once the model has written thousands of lines of code, it is harder to change. The sessions that generate design docs are context-light — you get the most model intelligence when you do the hard thinking early."

By default, agents build horizontally: all the backend, then all the frontend, then a 2,000-line diff lands in your lap and reviewing it is your problem. This skill flips that. Every decision that matters gets made before the code exists — where changing your mind costs a sentence, not a rewrite.

What it does

@CypherpunkSamurai
CypherpunkSamurai / gist:94a2cab8ae871d13e7be2b1f9ccdfdfc
Created August 4, 2026 18:35 — forked from diyan/gist:2850866
Python with PowerShell Remoting (Windows equivalent for Unix ssh sessions)
# Note that target_env.login and target_env.password is global variables
# Maybe I should add this into Fabric project (http://docs.fabfile.org/en/1.4.2/index.html).
# This is complicated task for sure but it would be nice if Fabric could use ssh under Linux and PowerShell Remoting under Windows.
def remote_sh(target_host, command_text, ignore_error=False):
print('run PowerShell script block at {0}: {1}'.format(target_host, command_text))
command_text = command_text.replace('"', '\'')
@CypherpunkSamurai
CypherpunkSamurai / fabric_monkey_patch.py
Created August 4, 2026 18:35 — forked from diyan/fabric_monkey_patch.py
Fabric monkey patch for replacing SSH transport with WinRM
import sys
import time
import subprocess
import types
from tempfile import TemporaryFile
def remote_sh(target_host, login, password, command_text, stdout=None, stderr=None):
winrs_text = 'winrs -remote:{0} -username:{1} -password:{2} -noprofile {3}'.format(
target_host, login, password, command_text)
#print('winrs text: {0}\n'.format(winrs_text))
@CypherpunkSamurai
CypherpunkSamurai / RUST_to_ODIN.md
Last active July 19, 2026 10:04
RUST to ODIN Porting

Rust → Odin porting guide

You are translating one Rust file to Odin. Read this whole document before writing any code. The goal of Phase A is a draft .odin next to the .rs that captures the logic faithfully — it does not need to compile. Phase B makes it compile package-by-package.

This guide is project-agnostic. If you are porting a specific codebase, fill in the "Package map" table below with your crate→package layout before starting — everything else applies generally.