Snippets!

I've compiled a bunch of little things I've written over the past decade into one collection. There is a myriad of 6502 assembly code, batch files, C helper functions, and shell scripts at your disposal. Go check out the "snippets" project on GitHub. Happy hacking!

***** DESCRIPTION OF SOME SNIPPETS *****

6502 CPU assembly code (in ACME Cross-Assembler format)
-------------------------------------------------------
6502/byte2bin: convert a byte to an 8-character string of binary digits
6502/blockmove: move a block of memory (including sizes over >256 bytes)
6502/detect6502: detect what variant of 6502/65816 CPU is in use
6502/divide_16-8-8: divide 16-bit number by 8-bit number
6502/divide_8-8-8: divide 8-bit number by 8-bit number
6502/multiply_8-8-16: multiply two 8-bit numbers
6502/pagefill: fill a 1-256 byte area of memory with a value
6502/pagemove: move a block of memory (256 bytes or less)

6502/nes: bootstrapping code for a basic Nintendo Entertainment System ROM

Batch files for Windows Command Prompt
--------------------------------------
batch_files/extract_audio_to_wav:
    use ffmpeg to pull the first audio track out of a video file (to WAV)
batch_files/companionlink_revival_kit:
    script to watch-and-restart CompanionLink (or anything you edit it for)

C functions (and header files to use them)
------------------------------------------
c/byteplane_xfrm: byte-plane transform from lzjody (see byteplane_xfrm.png)
c/jody_cacheinfo: get cpu0 cache sizes from standard sysfs path on Linux
c/jody_endian: endianness detection and conversion (untested)
c/jody_paths: pathname processing functions used in jdupes for link names
c/jody_sort: numerically correct file name compare function (for sorting)
c/jody_string: str[n][case]cmp that returns only equality (faster)
c/jody_strstr: two-way strstr() that is relatively fast and quite small
c/jody_strtoepoch: convert datetime string to seconds since the epoch
c/jody_win_unicode: Windows Unicode helpers for aiding portability
c/strcat_fixed: a faster strcat() for when string length is already known
c/string_malloc: a simple, fast memory allocator for small pieces  of data
c/win_stat: Windows stat() and NT-to-UNIX epoch portability helper code
c/xorpipe: XORs the data in a pipeline by a 32-bit key

Shell scripts (POSIX sh and/or GNU Bash)
----------------------------------------
shell_scripts/ansicolors:
    ANSI color escape sequences for shell script echo
shell_scripts/change_hplj_status:
    change READY message on old HP LaserJet printer displays
shell_scripts/clean_mpchc_thumbnail_names:
    remove some of the junk in MPC-HC thumbnail image file names
shell_scripts/convert_all_to_xz:
    convert all .tar.* packages to .tar.xz and report saved space
shell_scripts/count_total_files_in_directory:
    shows how many files are under each subdirectory of the current one
shell_scripts/gather_file_dir_statistics:
    shows various file/directory stats, including avg/min/max file size