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
Field notes
Journal
Notes from the Riksi studio in Melbourne. Plain guides on WordPress, Shopify, front-end code, speed and the tools I use every day.
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
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
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
Dev log
Migrate a WordPress site from local to live
Move a WordPress site from your computer to a live server. Copy the files, move the database, fix URLs safely (serialized data included) and check everything.
4 min read
Dev log
Redirect logged-out users in PHP and WordPress
Send visitors who are not signed in to the login page. A safe session check in plain PHP, and the WordPress way with is_user_logged_in() and auth_redirect().
3 min read