This is great when testing a local version of something like a client library and you need to test your changes and not import the globally installed version.
import sys
sys.path.insert(0, "/path/to/your/package_or_module")
import my_module
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!"
xcode-select -print-path
After years of trying to setup a mail server on macOS without requiring dependencies or messing with ports to trick my ISP into letting mail out, I figured out a solution.
Note: This guide is opinionated towards a Gmail setup.
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
:
~/.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.$ for i in $(seq 1 5); do time zsh -i -c exit; done
zsh -i -c exit 0.18s user 0.18s system 97% cpu 0.364 total
zsh -i -c exit 0.19s user 0.19s system 98% cpu 0.382 total
zsh -i -c exit 0.18s user 0.19s system 99% cpu 0.372 total
zsh -i -c exit 0.19s user 0.20s system 98% cpu 0.391 total
# Install an executable into your path from a tar archive | |
URL="https://github.com/Justintime50/freedom/releases/download/v0.2.0/freedom_0.2.0_linux_amd64.tar.gz" \ | |
TAR=${URL##*/} \ | |
BINARY="free" \ | |
curl -LJO "$URL" && tar -xf "$TAR" "$BINARY" && mv "$BINARY" "$HOME/bin/$BINARY" && rm "$TAR" |
Follow this guide to learn how to easily slug an HTML field in Laravel. You can also use this guide for other HTML projects with some tweaking.
The following is an example where when text is entered into the title
field, it will dynamically slug it in the slug
field.
Local development requires you to edit your /etc/hosts
file constantly to add custom local domains. Maintaining this file across machines and projects can become taxing. Let's use a service like dnsmasq
to dynamically set any .localhost
domain to point to 127.0.0.1
# Install dnsmasq
brew install dnsmasq
sudo brew services start dnsmasq
# Configure