Skip to content

Instantly share code, notes, and snippets.

View Justintime50's full-sized avatar

Justin Hammond Justintime50

View GitHub Profile
@Justintime50
Justintime50 / the-homebrew-guide.md
Last active February 19, 2020 20:14
The ultimate Homebrew setup and usage guide.

The Homebrew Guide

The ultimate Homebrew setup and usage guide.

What is Homebrew?

Homebrew is the missing package manager for macOS. It allows you to install command line tools brew install ... as well as GUI desktop apps brew cask install ... all through the command line.

Install Homebrew

@Justintime50
Justintime50 / working-with-ssh-keys.md
Last active January 31, 2022 23:15
Run the following commands to generate and copy an SSH key.

Working with SSH Keys

Follow this guide to generate an SSH private/public key pair, retrieve it, or send it to a client machine.

Usage

# 1) Generate an SSH Key
ssh-keygen -t rsa
@Justintime50
Justintime50 / remove-latest-git-commit.md
Last active July 14, 2020 22:38
Reset your latest Git commit as if it never happened.

Remove Latest Git Commit

Have you ever pushed something you wish you hadn't? There is a simple solution to this problem. You can reset your latest commit and then push that to remote as if the commit never happened.

Warning: Doing so will remove that commit. This is detremental to repos that have collaborators on them. Only use these on branches only you have access to (feature branches) or on private repos. Using this method on the master/develop branch is highly discouraged.

Usage

# Roll us back to the last commit
@Justintime50
Justintime50 / hash-password.md
Last active March 10, 2020 03:18
Run the following to hash a password using PHP.

Hash a Password

Run the following to hash a password using PHP. Replace mypass with the password you'd like to hash.

php -r '$hash = password_hash("mypass", PASSWORD_DEFAULT); echo $hash."\n";'
@Justintime50
Justintime50 / standard-user-owned-brew.md
Last active January 12, 2024 16:41
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 / laravel-nested-subfolder-nginx.conf
Last active March 28, 2022 10:24
Host Laravel in a Nested Subfolder/Directory - Nginx Configuration
server {
listen 80;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/site;
location / {
try_files $uri $uri/ /index.php;