Skip to content

Instantly share code, notes, and snippets.

View kdevo's full-sized avatar
🚀
git.io/kdevo

Kai Dinghofer kdevo

🚀
git.io/kdevo
View GitHub Profile
@kdevo
kdevo / loop0_to.py
Last active April 15, 2019 13:14
Transform LOOP0 language to Python code and execute it.
import re
class Loop0Transformer:
rules = {
r'(?P<indent>\s*)(?P<var1>\w+)\s*=\s*0': '{indent}{var1} = 0\n', # v = 0
r'(?P<indent>\s*)(?P<var1>\w+)\s*=\s*(?P<var2>\w+)\s*\+\s*1': '{indent}{var1} = {var2} + 1\n', # v = w + 1
r'(?P<indent>\s*)loop\s+(?P<var>\w+)(\s+begin)*': '{indent}for _ in range({var}):\n', # loop v begin a
r'(?P<indent>\s*)end': '{indent}# end for\n' # This "transformation" is not really needed results in a comment
}
@kdevo
kdevo / Vagrantfile
Created June 24, 2019 18:42
[ISE] [EIT] Vagrantfile for automatic VM provisioning
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'json'
VM_NAME = "ise-eit-vm"
VM_CONFIG_FILE = "#{VM_NAME}.json"
DEFAULTS = {'cpus' => 4, 'memory' => 4092, 'headless' => true,
'additional_disk_size' => 0, 'additional_disk_path' => "./additional-disk.vdi",
'private_network_ip' => "192.168.42.42"}
@kdevo
kdevo / gitmoji-subset.md
Last active September 11, 2022 03:19
Personal subset of the gitmoji standard for better collaborative work!

Personal gitmoji subset

Intro

The idea to use semantic symbols in Git commit messages is not exactly new. A while ago, I used the following three basic ASCII symbols at the beginning of my commit messages and my changelog entries:

Symbol Meaning/Commit type
[+] Add new feature
@kdevo
kdevo / IntelliJ + Maven - Unresolved Plugin.md
Last active July 19, 2024 18:57
IntelliJ IDEA and Maven - "Unresolved Plugin" notes
@kdevo
kdevo / i3wm-tricks.md
Last active September 25, 2024 13:00
i3wm: Tricks to assign "problematic" applications to a specific workspace/layout.

i3 Window Manager Tips and Tricks

...to assign applications to a specific workspace/layout.

i3wm makes it easy to assign applications to workspaces and save and restore layouts - which is e.g. useful for auto-starting always needed software. To make these assignments, you need specific window properties so that you can tell i3 to assign [class="Your-app"] → 1 (in this example, Your-app will be assigned to workspace 1).

In many cases this just works. However, there are also many popular programs that do not initially set the correct window class or other properties on startup, which can be frustrating. This cheat sheet aims to show the problems and possible resolutions (or worse: workarounds) for more or less problematic applications.