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
Field notes
Blog
Notes from the Riksi studio in Melbourne. Plain guides on WordPress, Shopify, front-end code, speed and the tools I use every day.
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
Lesson
Add a README.md to every project (with a template)
A good README tells the next developer what a project is, how to run it and how to deploy it. What I put in mine, a template to copy and the Markdown you need.
3 min read
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
Trick
How to copy a remote folder to your computer with rsync
Run rsync -avz user@server:/path/to/folder/ ./folder/ to pull a folder over SSH. After the first copy, rsync only sends what has changed.
4 min read
Lesson
Shopify theme development: get started with Shopify CLI
Build Shopify themes on your own computer with Shopify CLI. I install it, start from the Skeleton theme, preview with theme dev, then push and pull.
4 min read
Advertisement
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
Trick
How to create a symlink to a folder on Linux and Mac
Run ln -s /real/folder link-name to make a folder appear in a second place. I cover argument order, relative links, repointing with -sfn and safe removal.
5 min read
Lesson
Set up Git on your server and deploy with a push
Install Git on a Linux server, connect with SSH keys, and deploy with git push. I use a bare repository and a hook, or let the server pull from GitHub or GitLab.
3 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
Lesson
Flexbox cheat sheet: every property, value and default
Every flexbox property on one page, with its values and defaults. Plus gap, the layouts I build every week, and why the old -webkit-box prefixes can go.
5 min read