Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alexmarkley
alexmarkley / renameFontFile.sh
Last active January 28, 2024 02:58
A little script for renaming font files if the filename has been obfuscated for some reason.
#!/bin/bash
### renameFontFile.sh - A little script for renaming font files if the filename has been obfuscated for some reason.
###
### Reasons you might want this tool:
### - If you notice that you have a lot of fonts on hand, say that you have legally downloaded via a subscription to some service like Adobe Cloud.
### - And you find those OTF files in a location on your system (for example): "~/Library/Application Support/Adobe/CoreSync/plugins/livetype/.r/"
### - But you are dismayed because all of the font filenames have been obfuscated with useless names like: ".12345678.otf"
### - You could just copy them somewhere else and run this tool on each OTF file to de-obfuscate the names. (Or not. It's a free country.)
@alexmarkley
alexmarkley / generateImageDerivatives.sh
Last active September 1, 2020 18:48
generateImageDerivatives.sh -- That Feeling When You Realize You Should Have Used A Higher-Level Language But You've Already Written Too Much Bash And You Can't Stop Now...
#!/bin/bash
set -o pipefail
# Requested image sizes describes the size breakpoints we will resize down to. Sizes larger than the input image are ignored.
REQUESTED_IMAGE_SIZES=(3840 2880 1920 1440 1280 1024 640 320 128 64)
# Manifest format version should be incremented only if the format changes enough that a client should not try to parse it.
MANIFEST_FORMAT_VERSION=1
# Manifest generation version should be incremented every time the derivative generation rules change (for example if REQUESTED_IMAGE_SIZES is updated or if the resampling algorithm changes) to force a regeneration of the derivatives even if the source image has not changed.
MANIFEST_GENERATION_VERSION=1
@alexmarkley
alexmarkley / keybase.md
Created December 18, 2017 21:15
Keybase Identity

Keybase proof

I hereby claim:

  • I am alexmarkley on github.
  • I am alexmarkley (https://keybase.io/alexmarkley) on keybase.
  • I have a public key ASCt7eou3beka-TE0R2Ii-3-dQMVF9Y6pQjQhq1h7dzLCQo

To claim this, I am signing this object:

@alexmarkley
alexmarkley / s3dl
Last active January 27, 2022 17:36
A minimal authenticated S3 download script using only Bash, Curl, and OpenSSL.
#!/bin/bash
# s3dl
# by Alex Markley; released under CC0 Public Domain
# https://creativecommons.org/publicdomain/zero/1.0/
# Hosted at: https://gist.github.com/alexmarkley/0b45af17fdc805756ac710aeaceb77be
# Example script demonstrating how to fetch a private AWS S3 Object using only basic shell scripting techniques.
#################