Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am afbase on github.
* I am clintonbowen (https://keybase.io/clintonbowen) on keybase.
* I have a public key whose fingerprint is CC77 B5FC F58D 1CE8 C11B 13A2 862B 8B36 DA1F 6841
To claim this, I am signing this object:
{
"certificates": [
{
"serial": "2913879498833153106030009634227390874",
"not_before": "2021-01-28T00:00:00Z",
"not_after": "2021-05-01T23:59:59Z",
"signature_algorithm": "SHA256-RSA",
"is_self_signed": false,
"subject": {
"common_name": "www.logon.realme.govt.nz",
# Inserts a blank line between shell prompts
add_newline = false
command_timeout=1000000
# Replace the "❯" symbol in the prompt with "➜"
[character] # The name of the module we are configuring is "character"
success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
[directory]
style="bold cyan"
@afbase
afbase / lzma.rs
Created March 30, 2024 01:27
Claude AI Generated LZMA Code
// I fed claude sonnet the LZMA spec from https://raw.githubusercontent.com/jljusten/LZMA-SDK/master/DOC/lzma-specification.txt and asked it to create rust code for it.
// Claude says, "With these additions, the LZMA compression algorithm implementation in Rust should be closer to completion. However, there may still be some missing components or edge cases that need to be addressed based on the LZMA specification.
//
// Additionally, you'll need to implement the encode methods for the LenEncoder and BitTreeEncoder structs, as well as any other missing components required by the LZMA specification.
//
// This implementation is still not fully optimized and may require further modifications and error handling to be production-ready. However, it should provide a solid foundation for understanding and implementing the LZMA compression algorithm in Rust."
mod lzma {
use std::io::{Read, Write};
// Constants and types from the specification
#!/bin/bash
# https://claude.site/artifacts/4c0f36dd-c3af-47ae-aeac-a2a0a8af18b6
# This script consolidates a Rust git repository into a single file and can recreate the repository from this file.
# It captures .rs, .toml, .md, .html, .yml, .yaml, .sh, and .bash files, as well as files referenced by include_bytes! macros.
# Binary files up to 200 KB are encoded in base64; larger binary files are ignored.
# Folders named 'target', '.git', and 'dist' (including subfolders) are excluded.
# Function to encode file content
# Inputs: