Skip to content

Instantly share code, notes, and snippets.

View Justintime50's full-sized avatar

Justin Hammond Justintime50

View GitHub Profile
@Justintime50
Justintime50 / resetForm.gs
Created March 1, 2024 00:11
Reset a Google Form's Sheet and Responses
function resetForm() {
deleteAllFormResponses()
resetFormResponseDestination()
}
function resetFormResponseDestination() {
var form = FormApp.getActiveForm();
var formResponsesSheetId = form.getDestinationId();
var spreadsheet = SpreadsheetApp.openById(formResponsesSheetId);
@Justintime50
Justintime50 / diagnose.md
Last active November 17, 2023 22:44
Diagnose Docker on MacOS

Diagnose Docker on MacOS

/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
@Justintime50
Justintime50 / random_int_of_length.py
Created November 2, 2023 16:43
Create a random integer of a specified length`
import random
n = 36
random.randint(pow(10, n - 1), pow(10, n) - 1)
@Justintime50
Justintime50 / setup-laravel-project.sh
Last active May 6, 2024 17:26
Sets up a Laravel project for the first time.
#!/bin/bash
# shellcheck disable=SC2104
# The following script will setup the project for the first time for local dev
# To run the project after setup, use `docker compose up -d`
set -e
REPO_NAME="$1"
@Justintime50
Justintime50 / lldb-debugging.md
Last active July 9, 2023 21:23
Learn how to debug a program with lldb.

Debugging with LLDB

LLDB is a debugger you can attach to a program to do things like capturing stacktraces. Here is some basic usage:

# Attach to a program (waits for future execution in another terminal)
lldb -n php -w

# continue execution
c
@Justintime50
Justintime50 / justmakefiles.py
Last active March 4, 2024 22:46
Make Justfiles out of Makefiles
import os
def main():
makefile_path = os.path.join(os.getcwd(), "Makefile")
with open(makefile_path, "r") as makefile:
content = makefile.readlines()
new_content = ""
@Justintime50
Justintime50 / event_handler_example.py
Last active June 14, 2023 22:03
An example of how to setup event handlers in Python
import requests
class Event:
"""An Event that gets triggered when an HTTP event occurs."""
def __init__(self):
self._event_handlers = []
def __iadd__(self, handler):
@Justintime50
Justintime50 / working-with-branches.md
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
Justintime50 / imovie-on-nas.md
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.

Instructions

  1. Open Disk Utility
  2. File -> New Image -> Blank Image
  3. Use the following settings: