This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Based on https://gist.github.com/eduncan911/68775dba9d3c028181e4 | |
# but improved to use the `go` command so it never goes out of date. | |
type setopt >/dev/null 2>&1 | |
contains() { | |
# Source: https://stackoverflow.com/a/8063398/7361270 | |
[[ $1 =~ (^|[[:space:]])$2($|[[:space:]]) ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is the original elf.h file from the GNU C Library; I only removed | |
the inclusion of feature.h and added definitions of __BEGIN_DECLS and | |
__END_DECLS as documented in | |
https://cmd.inp.nsk.su/old/cmd2/manuals/gnudocs/gnudocs/libtool/libtool_36.html | |
On macOS, simply copy the file to /usr/local/include/. | |
Mathias Lafeldt <[email protected]> */ | |
/* This file defines standard ELF types, structures, and macros. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# | |
# This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs | |
# I use them for software release naming conventions and I like choices | |
# You can get it for yourself with curl | |
# curl -Lo menmonic_wordlist.txt http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt | |
# | |
# | |
MNEMONIC_FILE="$HOME/Documents/mnemonic_wordlist.txt" | |
function random_word { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Foundation import NSKeyedUnarchiver | |
from struct import unpack | |
# This entire function is black magic of the highest order and I'll blog about it later | |
def extract_share(bookmark_data): | |
content_offset, = unpack('I', bookmark_data[12:16]) | |
first_TOC, = unpack('I', bookmark_data[content_offset:content_offset+4]) | |
first_TOC += content_offset | |
TOC_len, rec_type, level, next_TOC, record_count = unpack('IIIII', bookmark_data[first_TOC:first_TOC+20]) | |
TOC_cursor = first_TOC + 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Universal wallpaper script for 10.6 and up | |
from AppKit import NSWorkspace, NSScreen | |
from Foundation import NSURL | |
from platform import mac_ver | |
from subprocess import call | |
from os import system | |
# Set path here for 10.9 | |
picture_path = "/Library/Desktop Pictures/Custom.jpg" |