Skip to content

Instantly share code, notes, and snippets.

View Justintime50's full-sized avatar

Justin Hammond Justintime50

View GitHub Profile
@Justintime50
Justintime50 / reset-xcode-install.md
Last active January 13, 2026 15:19
Reset Your Xcode Installation on macOS

Reset your Xcode Install on macOS

Having troubles with Xcode or their Command Line Tools? Follow this guide to reset your Xcode instance on macOS and resolve issues such as "No Xcode or CLT version detected!"

1) Check if Xcode is installed

xcode-select -print-path
@Justintime50
Justintime50 / setting-up-programming-languages.md
Last active November 24, 2025 18:59
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

CSharp

Run brew install dotnet to get started. This will install the SDK as well as the CLI runtime.

@Justintime50
Justintime50 / setup-laravel-project.sh
Last active June 10, 2025 20:54
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 / justmakefiles.py
Last active May 11, 2025 05:36
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 / standard-user-owned-brew.md
Last active March 26, 2025 13:42
Use the following commands to setup Hombrew as a standard user getting around needing sudo access for most packages.

Standard User Owned Brew

Use the following commands to setup Hombrew as a standard user getting around needing sudo access for most packages.

NOTE: This still requires an admin to install Homebrew initially. After the ownership change, the standard user can use Homebrew moving forward.

Setup Homebrew for a Standard User

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@Justintime50
Justintime50 / check-db-size.sql
Created November 27, 2024 22:34
Check the size of your database
SELECT
table_name AS `Table`,
table_rows AS `Records`,
ROUND((data_length + index_length) / 1024 / 1024, 2) AS `Size (MB)`
FROM
information_schema.tables
WHERE
table_schema = 'your_db_table'
ORDER BY
`Size (MB)` DESC;
@Justintime50
Justintime50 / colors.scss
Last active November 14, 2024 19:31
Bootstrap 5 Color Palette
// Bootstrap 5 Color Palette
// Docs: https://getbootstrap.com/docs/5.3/customize/color
// Theme colors
$primary: #0d6efd;
$secondary: #6c757d;
$success: #198754;
$info: #0dcaf0;
$warning: #ffc107;
$danger: #dc3545;
@Justintime50
Justintime50 / mass-git-push.sh
Last active October 24, 2024 04:09
Push any changes from each repo in the current directory - great for mass updating repos at once.
#!/bin/bash
# Copy a set of files to each repo in a dir, create a branch, and push to origin
# Requires GitHub CLI: `brew install gh` and must be logged in with `gh auth login`
# GitHub CLI Docs: https://cli.github.com/manual/
MAIN_BRANCH="master"
BRANCH_NAME="ignore_cassette_diffs"
COMMIT_MESSAGE="chore: ignore cassette diffs via gitattributes"
PR_TITLE="$COMMIT_MESSAGE"
@Justintime50
Justintime50 / https-to-ssh-git.sh
Created October 7, 2024 23:07
Replace HTTPS URLs with SSH URLs for your Git repos recursively
#!/bin/bash
# Start from the current directory or specify the root directory as an argument
start_dir="${1:-.}"
process_config() {
local config_file="$1"
echo "Processing $config_file"
sed -i.bak 's|https://github.com/|git@github.com:|g' "$config_file"
}
@Justintime50
Justintime50 / ssh-agent-in-crontab.md
Last active October 4, 2024 05:31
Use Your SSH Agent in a Crontab

Use Your SSH Agent in a Crontab

Getting access to SSH inside a Crontab is often a problem for many as the environment in which your cron runs is not the same as your normal shell. Simply running ssh-add will not allow you to use your SSH Agent inside your crontab. Follow the below guide to setup your crontab to use your ssh-agent:

Usage

  1. Install Keychain.
  2. Add the following to your ~/.zlogin file which will be invoked on each login. This will allow your crontab (and normal shell) to use your ssh keys and bypass needing to punch in your password each time you need SSH. This will also span across multiple sessions and shells.