Skip to content

Instantly share code, notes, and snippets.

View atelierbram's full-sized avatar

Bram de Haan atelierbram

View GitHub Profile
@atelierbram
atelierbram / default-wordpress-accordion-block-enhanced.js
Last active November 8, 2026 08:38
Default WordPress Accordion Block Enhanced
// Here is a clean and efficient JavaScript solution.
// Since this accordion utilizes the WordPress Interactivity API,
// the most reliable way to close other items—without disrupting
// the internal state—is to listen for a click and automatically
// close any other open items by triggering their respective toggle buttons.
// ## How it works
// 1. Listens for clicks: The code scans all WordPress accordion blocks
// on the page and attaches an event listener to each toggle button.
@atelierbram
atelierbram / evaluate-conditional-statement-processwire-php.md
Created August 29, 2026 15:31
Evaluate conditional statement in ProcessWire / PHP

Evaluate conditional statement in ProcessWire / PHP

In ProcessWire, this conditional statement:

<?php if($page->contactpersoon->contactpersoon_name): ?>
    <!-- do something -->
<?php endif; ?>
@atelierbram
atelierbram / generate-pdf-file-from-images-with-imagemagick.md
Created July 29, 2026 11:56
Generate a PDF file from a folder of images with imagemagick from the commandline
  magick *.jpg booklet.pdf
@atelierbram
atelierbram / fix-apache-ownership-and-permissions.sh
Created July 10, 2026 11:32
Fix Apache ownership and permissions
sudo chown -R www-data:www-data .
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;
@atelierbram
atelierbram / remove-old-node_modules.md
Last active June 24, 2026 14:57
remove old node_modules folders
  npx npkill
@atelierbram
atelierbram / fix-luasnip-jsregexp-not-found-in-neovim.md
Last active July 29, 2026 11:46
Neovim symbol not found: luaopen_jsregexp

Fix: LuaSnip jsregexp "Symbol Not Found" in Neovim

When you receive the warning jsregexp library required for Placeholder-transformations in :checkhealth luasnip, the jsregexp C library needs to be compiled. On modern systems (such as Apple Silicon), this often goes wrong because the library is built for the wrong Lua version.

The Problem

Neovim uses LuaJIT, which is compatible with Lua 5.1. When you install jsregexp via a standard package manager, it is often built for Lua 5.4 or higher. This results in the error message: dlsym(... luaopen_jsregexp): symbol not found.

The Solution (Step-by-step)

  1. Compile for Lua 5.1 Use LuaRocks to build the module specifically for the Lua 5.1 ABI. This ensures that the binary symbols are compatible with Neovim.
@atelierbram
atelierbram / let-remote-server-recognise-ghostty-terminal-using-ssh.md
Created April 3, 2026 15:28
Let remote server recognise ghostty terminal using SSH

Let remote server recognise ghostty terminal using SSH

From the remote server:

  infocmp -a xterm-ghostty

On local machine:

 infocmp -x | ssh remote-server-user@ip "tic -x -"
@atelierbram
atelierbram / _elements.scss
Created April 3, 2026 11:24
CSS reset / starter (in SCSS)
@use "sass:color";
@use "../mq/mq" as *;
// @use "../settings/settings" as *;
@use "../settings/variables" as *;
html {
cursor: auto;
font-size: 16px;
line-height: 1.5;
-moz-tab-size: 2;
@atelierbram
atelierbram / convert-hsl-to-hex-colors-in-batch.md
Created March 10, 2026 08:55
How to convert a range of HSL color values to HEX in batch with color-convert and write to file
@atelierbram
atelierbram / functions.php
Created February 16, 2026 15:03
Colophon section which can be edited in WordPress customizer (GeneratePress child-theme)
<?php // colophon section which can be edited in WordPress customizer (GeneratePress child-theme)
add_action( 'customize_register', function( $wp_customize ) {
$wp_customize->add_section( 'fia_colophon_section', array(
'title' => __( 'Colofon Informatie', 'fia-theme' ),
'priority' => 120,
) );
// Velden configuratie
$fields = array(