Skip to content

Instantly share code, notes, and snippets.

Avatar
💡
Science 🔬 + FLOSS 🐧 = 💖

Kevin Wittek kiview

💡
Science 🔬 + FLOSS 🐧 = 💖
View GitHub Profile
@kiview
kiview / custom-layouts.json
Created Jul 7, 2022
Pixel perfect layout for Windows PowerToys fancy zones (located in `%LocalAppData%\Microsoft\PowerToys\FancyZones\custom-layouts.json`)
View custom-layouts.json
{
"custom-layouts": [
{
"uuid": "{F58A3E99-18C5-40C0-B496-22C674101D1B}",
"name": "LinkedIn Learning",
"type": "canvas",
"info": {
"ref-width": 2560,
"ref-height": 1392,
"zones": [
@kiview
kiview / CopySyncExperiment.java
Created Apr 27, 2022
Syncing a file between host and container with Testcontainers
View CopySyncExperiment.java
package org.testcontainers;
import com.github.dockerjava.api.command.InspectContainerResponse;
import lombok.NonNull;
import lombok.SneakyThrows;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.utility.MountableFile;
@kiview
kiview / geohashes.csv
Last active Mar 3, 2022
Geohashes CSV
View geohashes.csv
geo_hash count
9q94r 1
dr5rs14 2
@kiview
kiview / tools.md
Last active Mar 21, 2022
Windows Development Tools
View tools.md

Windows Development Tools

This is simply a list of things I chose to install on my Windows development machines. I omit actual links, since googling for them generally gives the best up-to-date results. Maybe I should update this with chocolatey one day, or wait for the the new win-get tool in Windows 11.

  • VSCode
  • Git
  • Windows Terminal
  • Testcontainers Cloud
@kiview
kiview / wsl-git-cred-core.sh
Last active Apr 4, 2022
Connect the Windows Git Credential Manager Core to Git in WSL2
View wsl-git-cred-core.sh
# https://github.com/microsoft/Git-Credential-Manager-Core
git config --global credential.helper "/mnt/c/Program\\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe"
@kiview
kiview / pandas_group.py
Created Apr 1, 2021
Pandas DataFrame Group by Consecutive Certain Values
View pandas_group.py
# Taken from https://towardsdatascience.com/pandas-dataframe-group-by-consecutive-certain-values-a6ed8e5d8cc
df_indexed = df.reset_index(drop=True)
for k, v in df_indexed[df_indexed['behavior'] == 'not_defined'].groupby((df_indexed['behavior'] != 'not_defined').cumsum()):
print(f'[group {k}]')
display(v)
@kiview
kiview / Pipfile
Last active Apr 11, 2021
Installing BindsNET on Windows
View Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
torch = "===1.7.1"
install = "*"
@kiview
kiview / books.md
Last active Jan 27, 2021
Software Engineering Reading List
View books.md

Since I sometimes get asked about what I would recommend as reads to gain a deeper understanding about software engineering, I was thinking to just compile a list of my favourite books in this area, which I consider a very valuable read 🙂

Object Oriented Programming

Design Patterns: Elements of Reusable Object-Oriented Software

By Gamma et. al.

I think this is one of the classics and a very recommended read (but with a pinch of salt), basically, one of the books starting the patterns movement in OOP. While one has to be careful to not blindly force those patterns into your own software design, it is critical knowledge and part of the cultural backbone of the software industry. Knowing those patterns and being able to quickly identify them helps tremendously in understanding unfamiliar code bases and when having architecture discussions with peers.

Code Complete

@kiview
kiview / video_merge.py
Created Jan 21, 2021
Add overlay text to videos and concat them to single video using ffmpeg
View video_merge.py
#!/usr/bin/env python3
import os, glob
def write_text(input, output, text):
cmd = f"ffmpeg -i {input} -vf drawtext=\"fontfile=/path/to/font.ttf: text='{text}': fontcolor=white: fontsize=42: box=1: boxcolor=black@0.5: boxborderw=5: x=(w-text_w)/2: y=100\" -codec:a copy {output}"
print(cmd)
os.system(cmd)
def merge_videos(folder):
with open('./input.txt', 'a') as input_file:
@kiview
kiview / acc_ubuntu_oracle.md
Created Nov 1, 2020
Setup descriptions for acc game server with accweb in Oracle Cloud on Ubuntu
View acc_ubuntu_oracle.md

Create computing instance (e.g. VM.Standard2.1)

Install wine apt install wine

Copy accServer.exe to ~/accServer/accServer.exe

Download accweb release https://github.com/assetto-corsa-web/accweb/releases/download/1.11.2/accweb_1.11.2.zip