Skip to content

Instantly share code, notes, and snippets.

@o0101
o0101 / vanity.c
Created March 28, 2025 10:53
gcc -O2 -o vanity vanity.c -lssl -lcrypto
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <openssl/sha.h>
#define TARGET_PREFIX "20250327"
#define MAX_WORDS 256
#define MAX_TEXT 2048
#define MAX_ATTEMPTS (1ULL << 32) // 2^32 attempts (~4.3B, enough for 8-char prefix)
@o0101
o0101 / shorthash.txt
Created March 28, 2025 03:44
sha1sum 20250327eb45be9541447896f819d43e50cbd1be
they're not Particularly Rare, But I think they're more pleasing to See.
For instance This "2822302" Makes me Especially Happy: https://github.com/BrowserBox/BrowserBox/commit/2822302387c4cb7ff71c4239da3dc5fa4c07e165
It Even Extends up to 10 digits! That's Not Particularly rare - Roughly 1% chance (10^10/16^10 i think) - But i just think they look nice.
Are there any other people out there who are particularly pleased when they hit that? sorta like hitting 7777 on the odometer, or whatever.
I'm also a fan of the purely Numeric Identifiers Twitter/X Uses (and has for ages).
- After making changes, ALWAYS make sure to start up a new server so I can test it.
- Always look for existing code to iterate on instead of creating new code.
- Do not drastically change the patterns before trying to iterate on existing patterns.
- Always kill all existing related servers that may have been created in previous testing before trying to start a new server.
- Always prefer simple solutions
- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality
- Write code that takes into account the different environments: dev, test, and prod
- You are careful to only make changes that are requested or you are confident are well understood and related to the change being requested
- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we d
@karpathy
karpathy / add_to_zshrc.sh
Created August 25, 2024 20:43
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@smx-smx
smx-smx / XZ Backdoor Analysis
Last active February 26, 2025 01:17
[WIP] XZ Backdoor Analysis and symbol mapping
XZ Backdoor symbol deobfuscation. Updated as i make progress
@slintak
slintak / _README.md
Last active February 26, 2025 05:32
Meshtastic AI Chat Assistant Integration

This gist contains a proof of concept project (hacked together during one evening) aimed at connecting an AI chat assistant to the Meshtastic network, enhancing its capabilities. The assistant is designed to provide concise and helpful responses within the constraints of the Meshtastic environment.

Project Overview:

This project brings together two favorite elements: the Meshtastic network and an AI chat assistant. The assistant is based on the "FuseChat-7B-VaRM-Q5_K_M" model, and the code is written in Python.

@WolframRavenwolf
WolframRavenwolf / aliases
Created December 21, 2023 22:09
ShellGPT Aliases/Functions for Bash and Zsh
# ==============================================================================
# ShellGPT
# ==============================================================================
# ------------------------------------------------------------------------------
if which sgpt >/dev/null 2>&1; then
# ------------------------------------------------------------------------------
alias sgpt-chat="sgpt --repl chat"
alias sgpt-code="sgpt --repl code --code"
@jart
jart / rename-pictures.sh
Created December 12, 2023 15:24
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <[email protected]>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@yzdbg
yzdbg / auto-dr.md
Last active November 3, 2023 17:11

Automating Daily Reports, because fuck it, really...

Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.

So now, there's a scribe for that :

auto-dr-

Code