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 / 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.

Docker Root Directory

Base location of docker images directory

$ docker info | grep Root
Docker Root Dir: /var/lib/docker

Set symlink for /var/lib/docker

Eigener Git-Server

Benutzer git anlegen

sudo useradd -m -d /var/git -c 'Git' git

Legt einen neuen Benutzer ohne eigenes Home-Verzeichnis an (-m). -d legt für den neuen Benutzer das Verzeichnis git an. Mit -c wird dem Benutzer beim Login ein Kommentar Git beigefügt.

Benutzer git

@Quaese
Quaese / useSimpleDebounce.js
Created April 23, 2020 17:31
useSimpleDebounce Hook for React
/**
* Idea from: https://stackoverflow.com/questions/23123138/perform-debounce-in-react-js
*/
import { useState } from "react";
// https://github.com/slorber/react-async-hook
import { useAsync } from "react-async-hook";
// https://github.com/Andarist/use-constant
import useConstant from "use-constant";
@Quaese
Quaese / live-event.js
Last active December 11, 2022 16:07
Live Event for Javascript (Vanilla JS, native JS)
/*
* Get nearest parent element matching selector.
*/
const closest = (function() {
const el = HTMLElement.prototype,
matches =
el.matches ||
el.webkitMatchesSelector ||
el.mozMatchesSelector ||
el.msMatchesSelector;
@Quaese
Quaese / destructuring.js
Created May 14, 2019 10:18
Object Destructuring
const tester = {current: 'didumm'};
const {current: newVar} = tester;
console.log(newVar); // => 'didumm'
@Quaese
Quaese / IntersectionObserverAPI.md
Created May 12, 2019 14:59
Lazy Loading via Intersection Observer API