Skip to content

Instantly share code, notes, and snippets.

# git branch behind & ahead - a shell function
# inspired on https://stackoverflow.com/questions/20433867/git-ahead-behind-info-between-master-and-branch
# usage: gitba branchA...branchB
gitba () {
echo "$(cut -d '.' -f 4 <<<"$1") is compared to $(cut -d '.' -f 1 <<<"$1")"
REVLIST="$(git rev-list --left-right --count $1)"
echo $(cut -f 1 <<<"$REVLIST" | cut -f 1) commits behind.
echo $(cut -f 2 <<<"$REVLIST" | cut -f 2) commits ahead.
}
# Example output:
@th0rgall
th0rgall / shopifyfiles
Last active March 3, 2021 08:12
Download Shopify Admin Files given a comma-separated list text file
#!/bin/bash
# By @th0rgall - Feb. 1 2021
# Tool that loops over Shopify File URLs and downloads them with CURL
# Prerequisites:
# - In you PATH: curl > v7.22, sed
# - A file with shopify file names: use Jason Bowman's script at https://gist.github.com/freakdesign/a1636414cce682c2c444#file-get-all-files-from-shopify-admin-js
# to download a file list (more details on this: https://freakdesign.com.au/blogs/news/113610119-export-a-list-of-all-files-in-the-shopify-admin)
# Usage: ./shopifyfiles shopify-files-list.txt
# The script will make a directory 'files' and download files there
@th0rgall
th0rgall / convert-otter.py
Last active September 15, 2021 20:24
Convert transcripts exported by Otter.ai to a format importable by Atlas TI v8
'''
author: Thor Galle <thorgalle+code@gmail.com>
original version: April 9, 2020
last update: April 9, 2020
A script to convert a .txt transcript exported from https://otter.ai/ to a format importable in Atlas TI v8.
Based on a similar script for oTranscribe I made on April 3, 2020.
USAGE
@th0rgall
th0rgall / convert-otrans.py
Last active April 9, 2020 18:53
Convert a Markdown transcript exported by oTranscribe to a format importable by Atlas TI.
'''
author: Thor Galle <@th0rgall>
original version: April 3, 2020
last updated: April 9, 2020
A script to convert a Markdown transcript exported from https://otranscribe.com/ to something importable in Atlas TI v8.
USAGE: python convert-otrans.py <input_file> [output_file]
[output_file] defaults to out.txt
# one-time fun
echo 'echo "life sucks!"' > ~/ls && chmod u+x ~/ls && PATH=$HOME:$PATH
# a tad more annoying, but still harmless
echo 'echo "life sucks!"' > ~/ls && chmod u+x ~/ls && PATH=$HOME:$PATH && echo '\n# SORRY NOT SORRY\nPATH=$HOME:$PATH' >> ~/.bashrc >> ~/.zshrc