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 | |
if [[ "${1/--help/-h}" == '-h' ]]; then | |
echo 'fan2add [-h | --help]' | |
echo 'fan2add [-i | --immediately] statement...' | |
echo | |
echo '##### Statement Examples ########' | |
cheat fantastical-statements | |
exit | |
fi | |
if [[ "${1/--immediately/-i}" == '-i' ]]; then |
To completely avoid the MacOS python, start with brew or macport. If you start with macports, you will not be using that python version for much (ideally). But we need some, somewhat isolated python to start with.
sudo port install python38
sudo port install py38-pip
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
# duti settings file | |
# src: https://gist.github.com/apfelchips/0073cb3e8d186115f590d318998c1025 | |
# mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/duti/" && curl -L "https://git.io/JRtzH" -o "${XDG_CONFIG_HOME:-$HOME/.config}/duti/default.duti" | |
# duti-apply wrapper: alias duti-apply='duti -v "${XDG_CONFIG_HOME:-$HOME/.config}/duti"' | |
## duti documentation https://web.archive.org/web/20180901095433/http://duti.org/documentation.html | |
## see also: https://github.com/Lord-Kamina/SwiftDefaultApps#readme | |
# List of MIME Types: |
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 | |
alias soffice=/Applications/LibreOffice.app/Contents/MacOS/soffice | |
shopt -s expand_aliases | |
soffice --headless --convert-to pdf arch1.pptx | |
soffice --headless --convert-to pdf arch2.pptx | |
convert -density 150 arch1.pdf -quality 80 'output1.jpg' | |
convert -density 150 arch2.pdf -quality 80 'output2.jpg' | |
i=0 | |
for files in output1-*; do |
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 | |
# | |
# Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+ | |
# This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open. | |
# TODO Add option to close iTerm2 after cmd execs | |
# See also https://www.iterm2.com/documentation-scripting.html | |
# | |
# Usage: |
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 | |
# Use at own risk. License CC0 see https://creativecommons.org/publicdomain/mark/1.0/ | |
# alanberezin.com | |
OPTIND=1 # Reset in case getopts has been used previously in the shell. | |
opt_stripclasspath=false | |
while getopts ":hc" opt; do | |
case "$1" in | |
-h | --help ) | |
cat <<-EOF |
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 | |
# Use python's argparse module in shell scripts | |
# | |
# The function `argparse` parses its arguments using | |
# argparse.ArgumentParser; the parser is defined in the function's | |
# stdin. | |
# | |
# Executing ``argparse.bash`` (as opposed to sourcing it) prints a | |
# script template. |
You can see what path openssl lib uses for certs
openssl version -a
Python packages often use the default cafile
$ python -c "import ssl; print(ssl.get_default_verify_paths())"
But note that there are other places packages could look even just based on the above.
SSL_CERT_DIR
SSL_CERT_FILE
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 https://medium.com/@ripoche.b/using-global-pre-commit-hook-to-prevent-committing-unwanted-code-edbbf957ad12 | |
# | |
# To prevent debug code from being accidentally committed, simply add a comment near your | |
# debug code containing the keyword NO_GITCOMMIT (with underscore gone) and this script will abort the commit. | |
# | |
# I also made this available here | |
# https://gist.github.com/aberezin/7078ec087c7e4f8a078dd518d30a75bf | |
# | |
if git commit -av --dry-run | grep $(echo NO_GITCOMMIT | tr -d _) >/dev/null 2>&1 |
NewerOlder