Skip to content

Instantly share code, notes, and snippets.

@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 = {
@KoljaL
KoljaL / tools.md
Last active August 10, 2023 12:26

Führungsschiene

Idealo 40€

Akku 10,8V

Amazon 37€
oder
Idealo 30€

Stichsäge DJV185

@KoljaL
KoljaL / css-only-parallax-effect.markdown
Created July 2, 2023 08:20
CSS-Only Parallax Effect