Edit view:
Code:
This document provides help on getting your macOS development environment up and running with the latest versions of Homebrew, Apache, PHP, etc.
Homebrew is an excellent package manager for macOS; let's install it.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
| # One liner | |
| wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
| # Explained | |
| wget \ | |
| --recursive \ # Download the whole site. | |
| --page-requisites \ # Get all assets/elements (CSS/JS/images). | |
| --adjust-extension \ # Save files with .html on the end. | |
| --span-hosts \ # Include necessary assets from offsite as well. | |
| --convert-links \ # Update links to still work in the static version. |
At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.
git commit --amendThis will open your $EDITOR and let you change the message. Continue with your usual git push origin master.
| // PHP < 5.3.6 | |
| foreach (debug_backtrace() as $trace) | |
| { | |
| echo sprintf("\n%s:%s %s::%s", $trace['file'], $trace['line'], $trace['class'], $trace['function']); | |
| } | |
| die; | |
| // PHP >= 5.3.6 | |
| debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); | |
| die; |
In one of my pet projects, I redirect all requests to index.php, which then decides what to do with it:
This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d