Skip to content

Instantly share code, notes, and snippets.

View Quaese's full-sized avatar

Quaese

  • Javascript and Frontend Developer
  • Jena (Germany, Thuringia)
View GitHub Profile
@Quaese
Quaese / live-event.js
Created December 27, 2025 15:03
Javascript - Live Event
/**
* Attach a live event listener to the given selector.
* @param {string} eventType - The type of event to listen for.
* @param {string} selector - The CSS selector to match.
* @param {function} callback - The callback function to execute when the event is triggered.
* @param {Element} [context] - The element to listen for events on. Defaults to document if not provided.
*/
const live = function (eventType, selector, callback, context) {
/*
* Get nearest parent element matching selector.
@Quaese
Quaese / kartoffelsuppe.md
Created December 25, 2025 19:22
Rezept - Kartoffelsuppe

Kartoffelsuppe

Zutaten

  • festkochende Kartoffeln
  • Karotten (optional Suppengrün oder Gemüse nach Belieben)
  • Zwiebeln (optional)
  • Butter oder Magerine
  • Salz
  • Kümmel
@Quaese
Quaese / event_namespaces.js
Last active December 27, 2025 15:08
Event Namespaces with Live Events in JavaScript (Modern Style) (.on, .off, .live)
const events = {
on(event, callback, options) {
if (!event || !callback) {
throw new Error("Event and callback must be defined");
}
const [type, name] = event.split(":");
const el = this;
// set options
@Quaese
Quaese / express-handlebars-cheatsheet.md
Created November 15, 2025 07:41
NodeJS - express-handlebars CheatSheet

Express-Handlebars CheatSheet

Installation

npm install express-handlebars

Grundlegende Einrichtung

@Quaese
Quaese / format_textarea_with_prettier.html
Created March 1, 2025 08:44
Format HTML textarea with prettier (on key combination or on the fly)
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Live HTML Code Formatter</title>
<!-- Prettier Standalone und den HTML Parser einbinden -->
<script src="https://unpkg.com/prettier@2.8.8/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/parser-html.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/parser-babel.js"></script>
@Quaese
Quaese / modulo.js
Created February 7, 2025 15:58
JavaScript modulo
/*
* As method on Number prototype
* (slower, see: https://jsperf.app/negative-modulo/2)
*
* Code:
Number.prototype.mod = function (n) {
"use strict";
return ((this % n) + n) % n;
};
*
@Quaese
Quaese / deactivate-automatic-starting-of-browser_react-scripts.md
Last active August 27, 2023 11:47
Create React App - react-scripts start - Deacctivate automatic starting of browser

To deactivate the automatic starting of the browser, using npx react-scripts start, see the following steps:

  1. open the file node_modules/react-scripts/scripts/start.js in your react project.
  2. search for openBrowser at the bottom of the file
  3. add comments to this line
  4. save file and check => quiet .. no starting :-)
@Quaese
Quaese / calculator_with_upn.md
Created October 23, 2022 14:17
Einfacher Taschenrechner mit umgekehrt ponischer Notation (UPN) / Simple calculator with reverse Polish notation (RPN)

Einfacher Taschenrechner mit umgekehrt ponischer Notation (UPN) / Simple calculator with reverse Polish notation (RPN)

Quellen

HTML

<!DOCTYPE html>
<html>
@Quaese
Quaese / memoize.js
Created October 15, 2022 14:04
Memoize function for various arguments
const memoize = function (func) {
const hashCode = function (value) {
var hash = 0,
i,
chr,
len;
try {
value = JSON.stringify(value);
} catch (e) {

RPi 4 von USB booten

RPi 4 unterstützt derzeit kein komplettes Booten von USB-Geräten. Möglich ist jedoch, dass die Boot-Partition auf der SD-Card liegt, das System auf einem USB-Gerät.

Vorbereitung

  1. SD-Karte flashen
  2. USB-Laufwerk flashen

Zum Flashen kann zum Beispiel Etcher verwendet werden.