Skip to content

Instantly share code, notes, and snippets.

View JulianKahnert's full-sized avatar

Julian Kahnert JulianKahnert

View GitHub Profile
// Source: https://swiftwithmajid.com/2020/07/21/sidebar-navigation-in-swiftui/
@main
struct TestProjectApp: App {
@StateObject var store = MailStore()
@State private var selectedLabel: String? = "Inbox"
@State private var selectedMail: Mail?
var body: some Scene {
WindowGroup {
@JulianKahnert
JulianKahnert / tmux-startup.md
Created January 26, 2020 19:56
Tmux Startup

tmux startup

# create a new session and run command
tmux new -d -s NAME 'echo "DONE1"'

# add a new window to the previous session and run another command
tmux new-window -t NAME 'echo "DONE2"'
@JulianKahnert
JulianKahnert / Install.md
Created January 26, 2020 19:53
Auto (Re-)Start a Service with systemd

Auto (Re-)Start a Service with systemd

Initialize

  • Write service in /etc/systemd/system/SERVICE.service:
[Unit]
Description=My Service
After=network.service
@JulianKahnert
JulianKahnert / add-alarm-to-ics.py
Last active November 23, 2022 11:09
Little script for adding alarms to each event in a ics calendar file.
#!/usr/bin/env python3
calendar_name = 'Abfallkalender.ics'
# set replacement string
replacement = """BEGIN:VALARM
TRIGGER:-PT12H
REPEAT:1
DURATION:PT15M
ACTION:DISPLAY
@JulianKahnert
JulianKahnert / benzin-vs-diesel.py
Created January 5, 2017 18:26
Ab wann lohnt sich ein Dieselmotor?
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
# Allgemein
x = np.arange(7) # Jahre
km = 15000 # Anzahl Kilometer pro Jahr
# Benzin
@JulianKahnert
JulianKahnert / 31c3.sh
Last active August 29, 2015 14:24 — forked from georgehrke/31c3.sh
Download all 31c3 videos in their original language.
for x in `lynx http://cdn.media.ccc.de/congress/31C3/h264-hd-web/ --dump | grep "http" | grep "31c3" | cut -c 7-`; do
wget -nc $x;
done