Skip to content

Instantly share code, notes, and snippets.

@KoljaL
KoljaL / copilot-wordpress-optimierung.md
Created July 14, 2026 10:57
Dieses Dokument enthält strukturierte Maßnahmen, um den Token-Verbrauch bei der WordPress-Entwicklung (Themes, Custom Plugins, Gutenberg-Blöcke) mit GitHub Copilot drastisch zu senken.

GitHub Copilot Token-Optimierung für WordPress-Entwicklung


1. Filterung über .copilotignore (Die wichtigste Maßnahme)

WordPress-Installationen enthalten zehntausende Zeilen Core-Code, fremde Plugins und generierte Assets. Wenn diese nicht blockiert werden, liest Copilot bei @workspace-Anfragen riesige Mengen irrelevanten Codes ein.

Konfigurations-Beispiel:

Erstellen Sie eine Datei namens .copilotignore im Hauptverzeichnis Ihres Entwicklungsordners (oder direkt im Theme-/Plugin-Ordner):

@KoljaL
KoljaL / visualAgent.md
Created April 21, 2026 17:14
Fully autonomous visual agent

You can get close to a “fully autonomous” loop by combining (1) Playwright visual regression + (2) a Copilot-capable agent that can run commands and edit files. Copilot in VS Code by itself won’t continuously run/inspect screenshots and iterate without you, but if you use an agent runner (GitHub Copilot coding agent via PRs, or a local agent like Cursor/Cline) and make “tests must pass” include visual snapshots, you effectively get an autonomous feedback loop.

Below is a brief, practical setup using WordPress + Playwright. (Works for any web app.)


1) Run WordPress in a stable local environment

Use Docker so screenshots are repeatable.

docker-compose.yml

@KoljaL
KoljaL / gist:af7bf982e658024359446db2923d67d4
Created January 22, 2026 12:03
The bookmarklet allows users to quickly access speed reading functionality directly from their web browser
javascript:(function(){const DEFAULT_WPM=300,RAMP_ENABLED=!0,RAMP_START_WPM=120,RAMP_DURATION=2e3;let words=[],index=0,wpm=DEFAULT_WPM,rampStartTime=null,state="PAUSED",timer=null,overlay=document.createElement("div");overlay.id="rsvpOverlay",Object.assign(overlay.style,{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.9)",display:"flex",justifyContent:"space-around",alignItems:"center",flexDirection:"column",zIndex:9999,color:"#fff",fontSize:"3em",textAlign:"center"}),document.body.appendChild(overlay);const wordEl=document.createElement("div");overlay.appendChild(wordEl);const controls=document.createElement("div");controls.style.marginTop="20px",controls.style.display="flex",controls.style.alignItems="center",controls.style.flexDirection="column",controls.style.gap="10px",overlay.appendChild(controls);const speedInput=document.createElement("input");speedInput.type="range",speedInput.min=100,speedInput.max=1e3,speedInput.value=DEFAULT_WPM,speedInput.style.margin="0 10px",co
@KoljaL
KoljaL / nextcloud-menu.css
Created April 21, 2025 07:59
little hack for an old nextcloud
#appmenu:hover li svg, #appmenu:hover li .icon-more, #appmenu:hover li .icon-more-white, #appmenu:hover li .icon-loading-small, #appmenu:hover li .icon-loading-small-dark {
transform: translateY(7px);
}
#appmenu:hover li span {
opacity: 0.6;
top: 2px;
z-index: -1;
}
#appmenu li {
(function () {
'use strict';
function categorizeAndRankColorsWithRanksOnWebsite() {
const isExcludedElement = (element) => element.tagName !== 'STYLE' && element.tagName !== 'SCRIPT';
const allElements = Array.from(document.body.getElementsByTagName('*')).filter(isExcludedElement);
const colorCategories = {
font: [],
@KoljaL
KoljaL / pan-zoom-touch-and-trackpad.js
Created January 14, 2025 13:04 — forked from Martin-Pitt/pan-zoom-touch-and-trackpad.js
Panning and Pinch-Zoom gesture handler for both touchscreens and trackpads; Works really well on a MacBook trackpad
// Target state
var tx = 0;
var ty = 0;
var scale = 1;
function visualiseTargetState() {
box.style.transform = `translate(${tx}px, ${ty}px) scale(${scale})`;
}
[
{
"name": "SofleKeyboard",
"author": "Josef Adamcik",
"switchMount": "cherry"
},
[
{
"y": 0.2,
"x": 3,
@KoljaL
KoljaL / comparison-between-methods-of-applying-the-goo-filter.markdown
Created February 26, 2024 17:12
comparison between methods of applying the goo filter
@KoljaL
KoljaL / Roles_in_Laravel.md
Created October 26, 2023 15:42
Multiple User groups in Laravel

For my Laravel App, I need two types of Users: Staff & Member. Some Staff-User has an "is_admin" flag for more rights.

My first attempt was to create two new User-like Models. But as I found out, and it was recommended to me, that is not the common way.

So now I use the User-Model only for the Login (email, name, password & role) and to divide the User-Types by a role field. That worked very well for the login procedure.
But if it's necessary to edit some fields of one of the User-Type, it is getting complicated, because there are always two Models to handle.
This is my code to create a new Member, for example:

// Shows all font and background colors on an table,
// use with Greasemonkes or as a browser bookmark
(function () {
'use strict';
function categorizeAndRankColorsWithRanksOnWebsite() {
// let allElements = document.getElementsByTagName('*');
const allElements = Array.from(document.body.getElementsByTagName('*')).filter((element) => element.tagName !== 'STYLE' && element.tagName !== 'SCRIPT');
// console.log('allElements', allElements);
const colorCategories = {