Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

82 total results found

Troubleshooting

Godot

A connected event is not receiving the emitted signal Make sure the handler is accepting the same number of arguments. For example if the emitted signal adds a context argument, then the connected handler must also accept the context argument, otherwise it is ...

Curl commands

HTTP

Time to first byte curl -s -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" "https://brain.vandragt.com/"

Backup and Restore Ubuntu based systems

Linux

Use apt-clone, deja-dup and some shell scripts to backup and restore ubuntu based systems: Requirements: Deja-Dup duplicity as a terminal command, if you want to restore that way. Backup sudo apt install apt-clone mkdir ~/backup cd ~/backup sudo apt-clone cl...

Installing wp-env

WordPress

wp-env is pretty nice and the .wp-env.json file makes me think it's most of the way there as a generic local wp setup. of course it doesn't have redis / composer / support for multiple php versions, caching plugins, and dev tools installed with it. Requirement...

Cheatsheet

React

Intermediate React useState container for state within component (instance props). Use a store for data. useEffect Update render callback; update when something happens - async events. It's scheduled and you don't know when its going to run useContext gl...

Building PHP

PHP

OpenSUSE Ended up aborting this, but the notes might be handy for reference # Install phpenv curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer | bash # setup opensuse tumbleweed, php compiling required packages sudo...

Elementary OS Configuration and Setup

Linux

ElementaryOS 7 Horus Same wifi issue as [[OpenSUSE Tumbleweed]]. Same fix Mouse battery is seen as laptop battery, so battery power options apply. Zoom is fixed and keeps settings! Grub has no timeout $ sudo nano /etc/default/grub GRUB_TIMEOUT=5 PHPenv Use ...

LG TV

Media

LG Slow program guide The best solution, as there seems to be nothing from LG , to create a Favourite channel,list with just the few needed, mine has 6 channels, once selected, the TV  guide will use this and populate fairly quickly. This storage device cannot...

Local WagTail install on MultiPass

WagTail

WAGTAIL INSTALL on multipass # Host multipass launch -n wagtail multipass shell wagtail # Guest sudo apt update sudo apt install python3.10-venv python3 -m venv mysite/env source mysite/env/bin/activate pip install wagtail wagtail start mysite mysite cd mysi...

WordPress Importer Plugin

WordPress

It has support for: deduplication (see below), mapping image urls All imported posts haven import_id meta which is the ID they had in the import WXR. Post processing: Example /** * Usage: IMPORT_POST_TYPES=blogpost,attachment wp import ... */ WP_CLI::add_...

BookStack

Code Snippets Web

Get / Post / Delete options works roughly like this: # Import all markdown files into a book find . -name '*.md' -print0 | while IFS= read -r -d '' file; do python bookstack-api.py markdown_inport "$file" done # Trash all pages containing a search query: ...

Docker

Code Snippets Web

Mount a volume as the host user This allows writing to the volume. Dockerfile: COPY .docker/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh", "docker-php-entrypoint", "php-fpm"] entrypoint.sh: #!/usr/bin/env bash echo "C...

Flatpak

Code Snippets Shell

Flatpak Runner Example: fr handbrake #!/usr/bin/env bash # Quickly run flatpak installed cli apps by going a grep insensitive search. # Example: `fr handbrake --help` would run `flatpak run fr.handbrake.HandBrakeCLI --help` FLATPAK_ID=$(flatpak list --app | gr...

Importing and Migrations

WordPress Knowledge

Using the WordPress Importer plugin Imported posts have their guid set to the source url, but imported media (wp media import) attachment posts do not. This can be fixed as follows: Code snippet: WordPress Import

Per Repo hooks

Git

This is a little helper script that enables version controlled hooks, and per project hooks: Examples are: .hooks/pre-push # version controlled repo hook .hooks/pre-push.local # overrides the previous hook .hooks.local/pre-push # will be run af...

New Page

WordPress

Performance Strategy

WordPress Knowledge

CDN for assets Full page cache such as Batcache Fragment caching for menus Longcache for lower traffic sites.

Types of tests

Testing

Unit Tests: Test individual code components in isolation. Functional Tests: Validate overall functionality of modules or systems. Acceptance Tests: Verify software meets stakeholder requirements for deployment.

Time Since Last Resume

Linux

This has been moved to https://github.com/svandragt/break-aware

Performance

WordPress Knowledge

When migrating content, suspend cache invalidation and flush the cache afterwards. With that in mind, the following optimisation reduces the number of database queries to 1: - $post_data = [ - 'ID' => $post_id, - 'post_content' => $content, - ]; - - $up...

performance