Skip to content

Instantly share code, notes, and snippets.


Justin Hammond Justintime50

View GitHub Profile
Justintime50 /
Last active October 3, 2022 16:58
Learn about various operations of a Git branch

Working with Git Branches

This document contains various operations you can use when working with Git branches such as moving commits, updating branch names, creating branches from a tag, etc.

Move a Commit to Another Branch

New Branch

git branch newbranch

ZPL Commands

Command Format Description
^A ^Afo,h,w,d:f.x Use Scalable/Bitmapped Font
^A@ ^A@o,h,w,d:f.x Use Font Name to Call Font
^B0 ^B0a,b,c,d,e,f,g Aztec Bar Code Parameters
^B1 ^B1o,e,h,f,g Code 11 Bar Code
^B2 ^B2o,h,f,g,e,j Interleaved 2 of 5 Bar Code
^B3 ^B3o,e,h,f,g Code 39 Bar Code
Justintime50 /
Created June 20, 2022 17:56
Use iMovie on a NAS.

Use iMovie on a NAS

iMovie only works when run on a filesystem supported by Apple (APFS or macOS Extended). Your NAS most likely isn't running this file system for drives. Follow this guide to be able to run your iMovie library off a NAS.


  1. Open Disk Utility
  2. File -> New Image -> Blank Image
  3. Use the following settings:
Justintime50 /
Last active May 23, 2022 15:43
This guide will help you setup various programming languages on macOS.

Setting Up Programming Languages

Setting up programming languages can take some time and differs per language. Here are some guides on each one to get you up and running in no time. NOTE: This guide is intended for macOS development.

M1 Macs & Homebrew: You will need to add the following to your path: /opt/homebrew/bin and /opt/homebrew/sbin


Run brew install --cask dotnet-sdk to get started. This will install the SDK along with Mono. See the C# page for more information:

Justintime50 /
Created April 21, 2022 21:18
Invert a dictionaries keys and values
import json
import os
# Invert a dictionary's keys and values
# USAGE: FILE=myfile.json venv/bin/python
FILE = os.getenv('FILE')
def main():
Justintime50 /
Created April 14, 2022 22:08
Quickly setup multiple websites via Docker containers on a single server.

Multisite Docker Server via Traefik

Quickly setup multiple websites via Docker containers on a single server via Traefik.

Edit the email found in the traefik.toml file and run docker compose up -d to get started in production (LetsEncrypt will generate SSL certs for all your sites).

If you'd like to use Traefik during development, you'll want to comment out the lines that have SSL/HTTPS/443 comments/code in the docker-compose.yml file.

Hosts: You'll need to add each site url to your /etc/hosts file before it can be visited.

Justintime50 /
Created March 24, 2022 18:46
Reset your MySQL Replication

Resetting MySQL Replication

If you have a master/slave replication setup that comes across something similar to error 1236 where the binlogs get out of sync, you can run the following commands to get things back on track.

# On the master node

# On the slave node
Justintime50 /
Created February 16, 2022 06:52
Fix the insecure mixed content error in a Laravel production instance.

Insecure or Mixed Content Production Laravel

Make sure your AppServiceProvider.php file has a boot function that looks like this to avoid the was not allowed to run insecure content error in production:

use Illuminate\Support\Facades\URL;

 * Bootstrap any application services.
Justintime50 /
Created September 23, 2021 16:43
Learn how to package non-Python assets into your Python Package

Package non-Python Assets into your Python Package

There are times where you may need to include non-Python assets in your Python package for distribution. This may include data files or JSON assets from a submodule for example that your Python package needs to reference. By default, Python will not include these assets in the bdist/sdist. You can either include an empty file in that submodule (even if the project isn't Python) and rely on the magic of packages=setuptools.find_packages() in or you can explicitly include those non-Python assets by using the following steps.

  1. In, include an array of locations to include. These are glob matching patterns. An example of this looks like the following:
    'top_level_package': [
Justintime50 /
Created September 1, 2021 15:45
Gets the complete list of AWS IP ranges and parses the results
import requests
# Gets the complete list of AWS IP ranges and parses the results
# Usage: venv/bin/python