Dev log
Git warning: LF will be replaced by CRLF, and how to fix it
Git is converting line endings, usually because core.autocrlf is true on Windows. It's harmless, and a .gitattributes file fixes it for the whole team.
5 min read
Dev
Technical notes on WordPress, Shopify, PHP, JavaScript and the other tools I build with every day.
Dev log
Git warning: LF will be replaced by CRLF, and how to fix it
Git is converting line endings, usually because core.autocrlf is true on Windows. It's harmless, and a .gitattributes file fixes it for the whole team.
5 min read
Dev log
How to find the WordPress version of any site
Six ways to find which WordPress version a site runs, from the dashboard and WP-CLI to the page source and feed. Plus why hiding the version is not real security.
4 min read
Dev log
Gulp for Sass and JavaScript: a modern gulpfile
A Gulp 5 setup that compiles Sass, bundles and minifies JavaScript, adds source maps and watches for changes. Copy it into a WordPress theme or any project.
4 min read
Dev log
Git stash: how to save work and switch branches
git stash -u saves your uncommitted changes, including new files, and gives you a clean working tree. git stash pop brings them back.
4 min read
Dev log
Git cherry-pick: copy a commit to another branch
Switch to the branch that needs the change, find the commit hash, and run git cherry-pick . Git copies that one commit and merges nothing else.
4 min read
Dev log
Compile Sass (SCSS) with PHP using scssphp
Compile SCSS to CSS from PHP with scssphp. Install it with Composer, compile a file, pass in variables, cache the result, and know when I'd use Dart Sass.
4 min read
Advertisement
Dev log
Manage WordPress with Composer
Install WordPress plugins and themes with Composer. I cover composer/installers, WPackagist, installer paths, autoloading your own code, and what to commit.
4 min read
Dev log
Run WordPress across local, staging and live environments
One codebase, three environments. I cover per-environment settings in wp-config.php, WP_ENVIRONMENT_TYPE, keeping secrets out of Git, and moving content.
4 min read
Dev log
Create a custom log function in PHP
A small PHP function that writes timestamped messages and arrays to a log file you choose. Plus where I keep that file, and what never to log.
4 min read
Dev log
Password-protect a folder with .htaccess and .htpasswd
Put a username and password on any folder with Apache basic auth. Create the .htpasswd file with bcrypt, add four lines to .htaccess, or use the Nginx version.
3 min read
Dev log
Magento & WordPress password hash generator
Make a password hash for WordPress (bcrypt, phpass or MD5) or Magento 1 and 2, and set it in the database when you're locked out. Or use WP-CLI or bin/magento.
4 min read