Create a tiddler with the following content to list posts by date and time in a table (latest first)…
AKA How to override the “created” date/time.
This is part of my AutoHotkey script to allow me to quickly reload the script after making changes.
Gives tags in Nirvana a solid background colour instead of a small coloured dot that is difficult to see.
This is based on lessons 3 (LED), 4 (RGB LED) and 5 (Buttons) of the Elegoo UNO Project Super Starter Kit. I set up a multi-colour LED to fade through various colours, and a button to toggle it on or…
This is only marginally more advanced than the blinking light example in my first Arduino post, but perhaps a little more interesting! Again it uses the built-in LED, so no connections are required.
Fix bold styles in the new (Aug 2018) version of WorkFlowy. Titles aren’t forced to be bold #tags aren’t forced to be non-bold
This is a user style to make #Tags and @Tags be the same colour as the other text in WorkFlowy instead of greyed out.
Using Jens Segers’ Blade package to render Blade templates in a standalone PHP application.
A script that creates a Standard_D2_v3 VM (2 vCPU, 8 GiB RAM, 50GB SSD temporary storage, supports nested virtualisation) in the North Europe (Ireland) region.
Ansible has various ways of looking up data from outside sources, including plain text password files, CSV files and INI files. But it doesn’t seem to have a lookup for .env files, as used in Laravel projects, also available for…
Continuing my exploration of Prolog, I decided to write a program to generate a schedule for peer reviews.
Today I decided to learn a bit about Prolog. Here is how to start using it…
This week I have been learning about Docker… Here is what I’ve learned so far.
I had a command line (CLI) script written in PHP that I wanted to be able to run via the web, to save having to open a terminal and SSH connection each time.
This adds an @ifSection() Blade tag to Laravel that can be used to determine whether a particular @section() is defined.
Fades out completed items in WorkFlowy, until you hover over it or focus them, to make it easier to see the remaining list items yet still see your progress.
This finds MySQL users with no global or database privileges.
Useful for finding users who had permission to access databases that have since been deleted…
Automatically log into the Wi-Fi network on Oxford Bus Company buses.
HipChat uses “(thumbsup)” and “(thumbsdown)” instead of the easier to type “(Y)” and “(N)” of MSN Messenger, so I remapped them using AutoHotKey.
This code creates a shortcode, [gists], which displays a list of all Gists by a user, grouped into categories then listed alphabetically.
Find files created today or recently modified…
Run this to replace URLs in the database when moving a WordPress blog from one URL to another.
This is a user style I wrote for a friend. It removes the “Ask Anna” box that appears in the corner of the FedEx website.
Remove “ – WorkFlowy” from the end of the tab title on WorkFlowy. Makes it cleaner and easier to bookmark.
Changes the WorkFlowy starred pages popup so it looks like a regular list, instead of trying to mimic the look of pages going across the screen, to make them easier to skim-read to find the one you’re looking for.
Moves the WorkFlowy starred pages list to the top of the screen, reducing the distance the mouse has to travel from the button.
Fades out the notes field in WorkFlowy until you hover over it or focus it, to make it easier to see the main list items.
This was useful when fighting a DDoS attack on one of our web servers.
This is a script I use on a lot of sites to copy the database (MySQL) and any uploaded files to the development site, and modify the database as required.
This script makes it easy to upgrade phpMyAdmin on one or multiple servers at the same time.
rename -v s/OLD/NEW/ FILENAMES
How to write to STDOUT and STDERR in PHP.
function copy_dir($src, $dst)
I use this to split my theme’s functions.php into multiple smaller files on particularly complex sites, and to autoload those files (instead of having to manually require each one).
icotool -x -o . favicon.ico
This is a filter to take Gravity Forms format dates (dd/mm/yyyy) and convert them to WP-Types format dates (integer).
In this example the event start & end dates are entered as timestamps using WP-Types. It could also be modified for Advanced Custom Fields which uses strings.
This allows you to indent lists/paragraphs in the TinyMCE WYSIWYG editor using Tab, and outdent using Shift+Tab. I wrote it because I write a lot of nested lists, it’s tedious using the keyboard to indent and outdent, and I couldn’t find any…
With wp_insert_post() and wp_set_post_terms()…
Makes a HTTP request and read the Location header(s) to determine the redirect destination.
While entering several back-dated posts into a WordPress blog, I got annoyed at the date fields being in American month-day-year format and decided to fix it.
Copied from this style and modified to also hide the folder icon and show an arrow instead. /* ==UserStyle== @name Hide blank icons in bookmarks toolbar in Firefox @namespace djm.me @version 1.0.0 @author Dave James Miller (https://djm.me/) @homepageURL https://djm.me/code-snippets/2012/08/hide-blank-icons-in-bookmarks-toolbar-in-firefox @license…
This script takes an image and resizes it to the given dimensions, then saves that version on the filesystem so Apache can serve it directly in the future.
WordPress saves post password cookies for 10 days, and there is no setting or filter to change that, but you can use this code to replace the form action entirely.
Most instructions for using Capistrano tell you how to make it restart Phusion Passenger by touching the restart.txt file, but this doesn’t immediately restart the app – instead the first person to try to use the application will cause it to be…
// Generate the contents of the file somehow $content = ‘…’; // Zip the file $zipFile = tempnam(sys_get_temp_dir(), ‘zipfile’); $zip = new ZipArchive; $zip->open($zipFile, ZipArchive::OVERWRITE); $zip->addFromString(‘sample.txt’, $content); $zip->close(); // Do something with the file (e.g. attach it to an email)…
This is what I used to get CanCan to allow users on the local network to access parts of our intranet without having to log in.