Skip to content

Instantly share code, notes, and snippets.

Markdown Snippets

Hint: GitHub does not allow css except inside SVGs.

Side by side code blocks

CSS
SCSS

Reset NTFS file permissions with icacls and takeown

  1. Save file permissions in a txt file to be able to restore them if something went wrong:

    > icacls <path> /save <txtFilePath> [/t] [/c] [/l]

    Permissions can be restored with /restore:

Python Development Essentials

Managing multiple python versions

Important: Under windows the default python interpreter must be listed before all other python versions in the Path Environment Variable.

Running a specific python version

Example for python version 3.10 under Windows:

import pikepdf
pdf_loc = input("PDF location: ")
pdf_pass = input("PDF password: ")
pdf = pikepdf.open(pdf_loc, password=pdf_pass)
pdf_loc2 = input("Save PDF file under: ")
pdf.save(pdf_loc2)
@MarcHeiden
MarcHeiden / terminal-setup.md
Last active August 3, 2023 20:36
Setting up a decent looking Windows Terminal with Oh-my-Posh that works with WSL and integrate it in VSCode and IntelliJ

Setting up a decent looking Windows Terminal with Oh-my-Posh that works with WSL and integrate it in VSCode and IntelliJ

This is a briefly summary of what I did to set up my Windows Terminal for Powershell on the Windows side and Zsh on the WSL(Ubuntu) side and integrate it in VSCode and IntelliJ.

powershell         zsh

@MarcHeiden
MarcHeiden / !minimal.md
Created September 11, 2022 21:07
My current oh-my-posh theme

minimal

oh-my-posh-theme

@MarcHeiden
MarcHeiden / checkout-all-remote-branches-locally.ps1
Last active August 25, 2022 18:22
Checkout all remote git branches locally
$localBranches = [System.Collections.ArrayList]@()
$remoteBranches = [System.Collections.ArrayList]@()
git branch -r | % { if (!($_.split("/")[1].contains("HEAD")) -and !($_.split("/")[1].contains("main"))) {
$localBranches.Add($_.split("/")[1])
$remoteBranches.Add($_)
} }
$index = 0
foreach ($branch in $localBranches) {

Docker Essentials

> docker

> docker [COMMAND]

Comands

Print linux shell colors

for code in {000..255}
do
    print -P -- "$code: %F{$code}Color%f"
done