Skip to content

Instantly share code, notes, and snippets.

View renestalder's full-sized avatar

René Stalder renestalder

View GitHub Profile
renestalder /
Created May 13, 2022 09:28
Search and replace regex to add a namespace to all references in Twig

The regex is made for JavaScript regex engines.

It can, for example, be used in node, or pasted into search field of Visual Studio Code and used for a search/replace.


renestalder / sieve.txt
Last active March 31, 2022 11:07
Personal Sieve Triaging
require ["fileinto", "extlists"];
if anyof(header :contains "subject" "online purchase", header :contains "subject" "rechnung", header :contains "subject" "order", header :contains "subject" "artikel verschickt", header :contains "subject" "auftragsbestätigung", header :contains "subject" "sendung", header :contains "subject" "Bankdokumente")
fileinto "Paper trail";
} elsif anyof(exists "X-Gitlab-Issue-Id", address :is "from" ["", ""])
fileinto "Issues";
} elsif anyof(exists "X-Gitlab-Pipeline-Status", address :is "from" "")

Example of a similar email triaging system like, but with a manual Sieve-Filter. For example, supports Sieve-Filters. See for other email clients in the info below.

The individual sections can be changed and extended by your liking.

require ["fileinto", "extlists"];  

if anyof(header :contains "subject" "online purchase", header :contains "subject" "invoice", header :contains "subject" "order", header :contains "subject" "order")
  # Everything related to orders, invoices and so on, goes to "Paper trail"
renestalder /
Last active August 4, 2023 11:25
Storybook 6 Twig Setup
  1. Install twigjs-loader via npm.

    $ npm i -D twigjs-loader
  2. Extend Storybook's Webpack config to use the Twig loader.


    module.exports = {
     stories: [
renestalder / gulp-patternlab.js
Created June 7, 2017 16:42
Patternlab Gulp 4
* The gulp wrapper around patternlab-node core, providing tasks to
* interact with the core library and move supporting frontend assets.
import gulp from 'gulp';
import path from 'path';
import browserSyncLib from 'browser-sync';
import minimist from 'minimist';
renestalder / Brewfile
Last active September 13, 2022 13:14
Brew / Cask packages for Interaction Designers. Use to install.
cask_args appdir: '~/Applications'
tap 'caskroom/cask'
tap 'homebrew/bundle'
tap 'homebrew/core'
tap 'homebrew/dupes'
tap 'homebrew/php'
tap 'homebrew/versions'
brew 'curl', args: ['with-libssh2']
brew 'gcc'
brew 'git'
renestalder / keybindings.json
Created August 22, 2016 11:43
Visual Studio Code Keybindings
"key": "cmd+s",
"command": "workbench.action.files.saveAll"
"key": "cmd+shift+i",
"command": "editor.action.format",
"when": "editorTextFocus"
renestalder /
Last active September 30, 2015 13:45
Translate WordPress theme via child theme
  1. Paste the code snipped in the functions.php of the child theme
  2. Add languagesfolder to your child theme and add translated language files
renestalder / wp_gallery_style.css
Created August 25, 2015 15:53
WordPress Gallery Default Style
@echo off
setlocal EnableDelayedExpansion
set fileDir=%~f1
if exist "%fileDir%\config.rb" goto :build
for /r "tokens=* delims=;" %%F in ("%fileDir%\..") do if not exist "%fileDir%\config.rb" (
if "%fileDir%" neq "%%~fF" (
set "fileDir=%%~fF"