alistairphillips.com

I’m : a web and mobile developer based in the Manning Valley, Australia.


Instapaper Dump

I recently cleared out my Instapaper queue going through years worth of saved items. Some useful bits which will hopefully come in handy.

Regex

GTFS

JavaScript

Database

Docker

PHP

It's taken me over 10 years of PHP development to learn that you can insert an exclamation into the DateTime::createFromFormat method to reset all of the remaining time units 🎉 DateTime::createFormFormat('Y-m-d', '2021-10-12') # 2021-10-12 21:48:07.0 DateTime::createFormFormat('!Y-m-d', '2021-10-12') # 2021-10-12 00:00:00.0 DateTime::createFormFormat('!Y-m-d H', '2021-10-12 16') # 2021-10-12 16:00:00.0 @SteveTheBauman Oct 13, 2021

TIL that I can name a stash in git and also include untracked files:

git stash push -u -m "Why I stashed this set of files"

@akrabat Jun 28, 2021 How to work with Point Data Type in Doctrine 2 and Symfony 5

Windows / WSL / WSL2

Mikrotik RouterOS

Misc

TIL: git checkout <branch|file> was split to git switch <branch> and git restore <file> in some recent version. Much better. @elado Sep 15, 2021

TIL that I can name a stash in git and also include untracked files:

git stash push -u -m "Why I stashed this set of files"

@akrabat Jun 28, 2021

I can't over-emphasize this enough for folks at the earliest stage of building your SaaS. Put the application on a subdomain like app.your-product[dot]com and have your main .com be an easy to use CMS marketing site like Wordpress or Webflow. So annoying to unwind after the fact. @tylertringas Apr 16, 2020

I've come up with a set of rules that describe our reactions to technologies:

  • Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works.

  • Anything that's invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it.

  • Anything invented after you're thirty-five is against the natural order of things.

— Douglas Adams

Did you know that you could use Unix diff to compare directories? (Add -r for recursion) @pragprog Nov 4, 2021

Another useful thing is to diff the contents of files in two different directories.. I've often used the following reasonably memorable form: diff -BurN folder1 folder2 @jwarlander Nov 4, 2021