Skip to content

Instantly share code, notes, and snippets.

View renestalder's full-sized avatar

René Stalder renestalder

View GitHub Profile
@renestalder
renestalder / twig-add-namespace-regex.md
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.

Search:

(\{%|\{\{)\s*(import|embed|include|source|extends|from)(\s*)(\(?['|"])(.*)(['|"]\)?)([\s\S]*?)(%\}|\}\})
@renestalder
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" ["notifications@tasks.clickup.com", "notes-reply@email.zeplin.io"])
{
fileinto "Issues";
} elsif anyof(exists "X-Gitlab-Pipeline-Status", address :is "from" "status@notify.gitlab.com")
{

Example of a similar email triaging system like HEY.com, but with a manual Sieve-Filter. For example, protonmail.com 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
renestalder / storybook-6-twig.md
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.

    main.js:

    module.exports = {
     stories: [
@renestalder
renestalder / gulp-patternlab.js
Created June 7, 2017 16:42
Patternlab Gulp 4
/******************************************************
* PATTERN LAB NODE
* EDITION-NODE-GULP
* 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
renestalder / Brewfile
Last active September 13, 2022 13:14
Brew / Cask packages for Interaction Designers. Use https://github.com/Homebrew/homebrew-bundle 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
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
renestalder / _wordpress-theme-child-translate.md
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
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
:search
for /r "tokens=* delims=;" %%F in ("%fileDir%\..") do if not exist "%fileDir%\config.rb" (
if "%fileDir%" neq "%%~fF" (
set "fileDir=%%~fF"