Skip to content

Instantly share code, notes, and snippets.

View vielhuber's full-sized avatar
🍐
❹❷

David Vielhuber vielhuber

🍐
❹❷
View GitHub Profile
@vielhuber
vielhuber / install.md
Last active July 20, 2025 12:28
cleanup keepass kdbx #python
sudo apt install python3-lxml
pip install pykeepass
python script.py /path/to/file.kdbx
@vielhuber
vielhuber / README.MD
Last active July 20, 2025 11:38
pipe operator |> #php

old syntax

$value = "hello world";

// short version
$result = function1(function2(function3($value)));

// long version
$result1 = function3($value);
@vielhuber
vielhuber / _v1.MD
Last active June 30, 2025 09:48
object oriented programming multiple classes as singletons #python

/classes/__init__.py

from .foo import Foo
from .bar import Bar

foo = Foo()
bar = Bar()

# this enables "import *"
__all__ = [
@vielhuber
vielhuber / script.py
Last active June 25, 2025 12:16
object oriented programming classes #python
import random
# ...
class Example:
staticVariable = "baz"
def __init__(self):
@vielhuber
vielhuber / README.MD
Last active July 15, 2025 12:55
browser extensions chrome firefox #js

Local installation

Chrome

  • Install local addon: chrome://extensions > Load packed extension > Choose folder with extension files in it
  • Reload local addon: chrome://extensions > Reload icon
  • Addon for fast reload: Extensions Reloader

Firefox

@vielhuber
vielhuber / README.MD
Last active May 25, 2025 17:18
install xampp on linux mint #server
  • https://www.apachefriends.org/de/index.html
  • chmod 755 xampp-linux-*-installer.run
  • sudo ./xampp-linux-*-installer.run
  • sudo /opt/lampp/lampp start
  • sudo /opt/lampp/lampp stop
  • optional
    • sudo /opt/lampp/manager-linux-x64.run
    • sudo /opt/lampp/lampp restart
  • sudo nano /opt/lampp/etc/php.ini
@vielhuber
vielhuber / script.js
Last active May 16, 2025 11:34
ctrl strg ajax links pushState #js
/* this ensures that ctrl+links open in a new window */
var ctrlPressed = false;
window.addEventListener('keydown', e => {
if (e.metaKey || e.ctrlKey || e.key === 'Control' || e.key === 'Meta') {
ctrlPressed = true;
}
});
window.addEventListener('keyup', e => {
if (e.metaKey || e.ctrlKey || e.key === 'Control' || e.key === 'Meta') {
ctrlPressed = false;
@vielhuber
vielhuber / script.php
Last active May 15, 2025 10:22
foreach unset #php
<?php
/* problem */
$array = ['a' => 1, 'b' => 2, 'c' => 3];
foreach ($array as $array__key => $array__value) {
echo 'iterating over '.$array__key."\n";
if ($array__value === 2) {
unset($array['c']);
}
}
// iterating over a
@vielhuber
vielhuber / README.MD
Created May 14, 2025 14:30
nextcloud setup linux #server
  • sudo mv /etc/apt/preferences.d/nosnap.pref ~/Dokumente/nosnap.backup
  • sudo apt update
  • sudo apt install snapd
  • Terminal neustarten
  • sudo snap install snap-store
  • Linux neustarten
  • Snap Store > NextCloud
  • sudo snap set nextcloud ports.http=8081
  • sudo snap set nextcloud ports.https=8443
  • sudo snap restart nextcloud
@vielhuber
vielhuber / ..MD
Last active May 25, 2025 17:16
reveal.js markdown presentation #js

init

  • mkdir test
  • cd test
  • git clone [email protected]:vielhuber/test.git . # clone empty repository
  • create .gitignore, README.MD, index.html, index.md
  • follow README.MD

start

  • cd test