Skip to content

Instantly share code, notes, and snippets.

View harveyrandall's full-sized avatar
👻

Harvey Randall harveyrandall

👻
View GitHub Profile
@harveyrandall
harveyrandall / XORCipher.js
Created October 29, 2025 11:05 — forked from sukima/XORCipher.js
A Super simple encryption cipher using XOR and Base64 in JavaScript
// XORCipher - Super simple encryption using XOR and Base64
//
// Depends on [Underscore](http://underscorejs.org/).
//
// As a warning, this is **not** a secure encryption algorythm. It uses a very
// simplistic keystore and will be easy to crack.
//
// The Base64 algorythm is a modification of the one used in phpjs.org
// * http://phpjs.org/functions/base64_encode/
// * http://phpjs.org/functions/base64_decode/
@harveyrandall
harveyrandall / zsh-strings.md
Created October 24, 2025 10:06 — forked from mattmc3/zsh-strings.md
Zsh - string utilities

zsh strings

Fish has a utility for [string maniplulation][string].

This is how you can do the same things with Zsh builtins.

References:

  • [Zsh regex][3]
  • [String modifiers][1]
  • [String expansion][2]

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@harveyrandall
harveyrandall / chrome_update_block.sh
Created October 14, 2025 01:41 — forked from sshymko/chrome_update_block.sh
Google Chrome auto-update block for Mac OS
#!/bin/sh
sudo tee -a /etc/hosts << EOF
# Block Google Chrome auto-update
0.0.0.0 update.googleapis.com
EOF
@harveyrandall
harveyrandall / .zshrc
Created October 9, 2025 09:40 — forked from callumlocke/.zshrc
ZSH function to auto-switch to correct Node version
####
# ZSH function to auto-switch to correct Node version
# https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5
#
# - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does.
#
# - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING.
#
# - Works correctly if your .nvmrc file contains something relaxed/generic,
# like "4" or "v12.0" or "stable".
This file has been truncated, but you can view the full file.
spamhaus_drop:1.10.16.0-1.10.31.255
spamhaus_drop:1.19.0.0-1.19.255.255
spamhaus_drop:1.32.128.0-1.32.191.255
spamhaus_drop:2.56.192.0-2.56.195.255
spamhaus_drop:2.57.232.0-2.57.233.255
spamhaus_drop:2.57.234.0-2.57.235.255
spamhaus_drop:2.59.200.0-2.59.203.255
spamhaus_drop:5.42.199.0-5.42.199.255
spamhaus_drop:5.134.128.0-5.134.159.255
spamhaus_drop:5.180.4.0-5.180.7.255
@harveyrandall
harveyrandall / ffmpeg convert mov to mp4.sh
Created July 8, 2022 07:52
One line command to convert Quicktime Movie (.mov) files generated by a MacOS screen recording to .mp4 using ffmpeg.
#!/usr/bin/env zsh
ffmpeg -i my-video.mov -vcodec h264 -acodec mp2 my-video.mp4