Skip to content

Instantly share code, notes, and snippets.

@divspace
divspace / enable-touch-id-fingerprint-sudo-iterm-terminal-macos.md
Last active August 31, 2023 00:47
Enable Touch ID Fingerprint For `sudo` in iTerm and Terminal (macOS)

Open your sudo file:

sudo vi /etc/pam.d/sudo

Add the following after the first line:

auth sufficient pam_tid.so
@divspace
divspace / .gitignore
Last active September 26, 2020 03:15
Global Git Ignore File
################################################################################
# git config --global core.excludesfile ~/.gitignore
# https://gist.github.com/divspace/5e826b4a055f143b8efb923593ac5550
################################################################################
################################################################################
# Directories
################################################################################
.idea/
.metadata/
@divspace
divspace / lambo.sh
Created November 17, 2017 17:37
lambo
#!/usr/bin/env bash
UNAMEOUT="$(uname -s)"
case "${UNAMEOUT}" in
Linux*) MACHINE=linux;;
Darwin*) MACHINE=mac;;
*_NT-10*) MACHINE=windows;;
*) MACHINE="unknown"
esac
@divspace
divspace / npm-vs-yarn.md
Last active November 21, 2017 16:08
Why you should switch from NPM to Yarn, the differences, and a comparison of commands (with a cheatsheet)

Switching From NPM to Yarn

We've switched to Yarn because it was built in collaboration with Facebook, Google, and others. We're primarily using it for how much faster it is though. Yarn supports emojis, is extremely faster, has automatic shrinkwrapping (hence the yarn.lock file), and much better security.

You can find out why a package is installed (and what's using it):

yarn why <package-name>
@divspace
divspace / node-uninstall.sh
Last active August 16, 2017 19:54
Completely uninstall and remove Node (native, NVM, and Nave) and npm
#!/usr/bin/env bash
BREW=$(command -v brew)
PREFIX="${PREFIX:-/usr/local}"
sudo -v
while true; do
sudo -n true
sleep 60
@divspace
divspace / update.sh
Last active September 26, 2020 03:32
A bash script macOS to keep Homebrew, Mac App Store, Composer, and npm updated (including globally installed packages)
#!/usr/bin/env bash
################################################################################
# Place this script wherever you like and create an alias (.zshrc or .bashrc):
#
# alias update='sh ~/Scripts/update.sh'
#
# Then just run `update` to update:
#
# - Homebrew