Skip to content

Instantly share code, notes, and snippets.

View iilei's full-sized avatar
🤓

iilei • jochen preusche iilei

🤓
  • Hamburg • Germany
View GitHub Profile
@iilei
iilei / props_to_init.py
Created March 27, 2024 04:28
Make dataclass props initializable
from dataclasses import field, dataclass
import datetime
from functools import wraps
def props_to_init(additional_kwargs):
def decorator(cls):
def modify_init(init):
@wraps(init)
def __init__(self, **kwargs):
@iilei
iilei / https_uri.sh
Last active February 18, 2024 10:14
get git repo https uri
git remote --v | grep "origin" | head -1 | sed -r 's:.*\s+(\S+)\s+.*$:\1:g' | sed -r 's:git@([^/]+)\:(.*\.git):https\://\1/\2:g'
@iilei
iilei / keybase.md
Created December 13, 2021 02:44
Proof of `whoami` for Keybase

Keybase proof

I hereby claim:

  • I am iilei on github.
  • I am iilei (https://keybase.io/iilei) on keybase.
  • I have a public key ASB0eA1gkWTXKSC7cmdBSgcOpXLsOdv-1wzHJI8WbVa0Lgo

To claim this, I am signing this object:

@iilei
iilei / rnd_tokens.sh
Last active February 20, 2021 17:00
Generate Distinguishable Random Tokens
for ((i=0;i<20;i++)); do uuidgen; done | \
tr -dc 'AC-HJ-NP-RTZ2-46-79' | \
fold -w 10 | \
head -n 20 | \
sed 's/^\(.\{4\}\)/\1-/'
@iilei
iilei / example.sql
Created March 4, 2020 05:38 — forked from jcushman/example.sql
Store JSON history with the fast-json-patch library and Postgresql triggers
-- Enable pl/v8:
CREATE EXTENSION plv8;
-- Create json history table:
CREATE TABLE json_history (id BIGSERIAL PRIMARY KEY, tstamp timestamp DEFAULT now(), table_name text, column_name text, target_id bigint, transform json);
-- Create test table:
CREATE TABLE test_json (id BIGSERIAL PRIMARY KEY, data JSON);
-- Enable history tracking on test_json.data:
@iilei
iilei / Dockerfile
Last active February 23, 2020 09:16
[WIP] attempt to get argon2 password hashing into keycloak 9.0.0
FROM jboss/keycloak:9.0.0
ENV HASH_PROVIDER_NAME=argon2-password-hash-provider
ENV HASH_PROVIDER_REF=9.0.0
ENV MAVEN_REF=3.5.4
USER root
RUN microdnf install wget yum
@iilei
iilei / crash_log.txt
Created December 28, 2019 11:40
Frescobaldi 3.1 Crash on Mac OS
Process: Frescobaldi [64507]
Path: /Applications/Frescobaldi.app/Contents/MacOS/Frescobaldi
Identifier: org.frescobaldi.frescobaldi
Version: 3.1 (3.1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Frescobaldi [64507]
User ID: 501
Date/Time: 2019-12-28 12:36:00.991 +0100
@iilei
iilei / .remove-tiles.ps1
Created August 2, 2019 05:40
Drop Tiles frowm Windows start menu
Add-Type -AssemblyName System.Windows.Forms
# show the MsgBox:
$result = [System.Windows.Forms.MessageBox]::Show('Do you want to clean up all tiles?', 'Warning', 'YesNo', 'Warning')
# check the result:
if ($result -eq 'Yes')
{
(New-Object -Com Shell.Application).
NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').
@iilei
iilei / mov2gif.sh
Last active July 21, 2019 06:36
Convert quicktime movies to gif on a mac
#!/usr/bin/env sh
while [ "$#" -gt 0 ]; do
case "$1" in
-f) file="$2"; shift 2;;
-o) output="$2"; shift 2;;
--file=*) file="${1#*=}"; shift 1;;
--output=*) output="${1#*=}"; shift 1;;
--file|--output) echo "$1 requires an argument" >&2; exit 1;;
@iilei
iilei / mov2gif.sh
Created July 21, 2019 06:27
Convert quicktime movies to gif on a mac
#!/usr/bin/env sh
while [ "$#" -gt 0 ]; do
case "$1" in
-f) file="$2"; shift 2;;
-o) output="$2"; shift 2;;
--file=*) file="${1#*=}"; shift 1;;
--output=*) output="${1#*=}"; shift 1;;
--file|--output) echo "$1 requires an argument" >&2; exit 1;;