Skip to content

Instantly share code, notes, and snippets.

@M-Mueller
M-Mueller / nc_cookbook_import.py
Last active April 23, 2021 20:25
Convert recipes from vollcorner.de to Nextcloud Cookbook format
import argparse
import re
import json
import os
import shutil
import requests
import datetime
from urllib.parse import urljoin
from urllib.request import urlopen
from bs4 import BeautifulSoup
@M-Mueller
M-Mueller / fsharp_cheatsheet.md
Last active December 26, 2021 19:18
F# Cheatsheet

Syntax

Discriminated Unions / Union Types / ADTs

type Color =
  | Red
  | Green
  | Blue
  
type BinaryTree =
@M-Mueller
M-Mueller / CMakeLists.txt
Created March 13, 2018 16:31
Example of CMake export target
cmake_minimum_required(VERSION 3.0)
project(MyProject)
set(Sources
...
)
set(Headers
...
)
import sys
import subprocess
# http://dicom.nema.org/medical/dicom/current/output/chtml/part15/chapter_E.html
confidential_tags = [
((0x0008, 0x0050), 'Z'),
((0x0018, 0x4000), 'X'),
((0x0040, 0x0555), 'X'),
((0x0008, 0x0022), 'X/Z'),
((0x0008, 0x002A), 'X/D'),
@M-Mueller
M-Mueller / lineedit.cpp
Created July 5, 2017 12:39
QLineEdit with icon (or button)
// depending on the stylesheet:
const int defaultPadding = 10;
const int border = 3;
const int iconSize = lineedit->fontMetrics().xHeight()*4; // or whatever size looks good
auto lineedit = QLineEdit();
lineedit->setStyleSheet(QString(R"CSS(
QLineEdit {
padding-left: %1px;
}

Search files in current directory for "string" recursively:

grep -r "string" .
@M-Mueller
M-Mueller / Skype.desktop
Created November 10, 2016 16:00
Desktop entry that launches Skype as a standalone webapp
[Desktop Entry]
Type=Application
Exec=/usr/bin/chromium-browser --app=https://web.skype.com
Name=Skype
GenericName=Skype
Icon=Skype
Terminal=false
StartupWMClass=web.skype.com
Categories=Audio;Video;
@M-Mueller
M-Mueller / Deezer.desktop
Created October 22, 2016 09:47
Desktop entry that launches Deezer as a standalone webapp
[Desktop Entry]
Type=Application
Exec=/usr/bin/chromium --app=https://www.deezer.com
Name=Deezer
GenericName=Deezer
Icon=Deezer
Terminal=false
StartupWMClass=www.deezer.com
Categories=Audio;
@M-Mueller
M-Mueller / vimfu.md
Last active March 13, 2018 14:37
vim fu

Visual Mode

vib - Select everything inside parenthesis
vab - Select everything inside parenthesis (including parenthesis) vi" - Select everything inside double/single quotes
viB vi{ - Select curly brace block
gv - Select last visual block
VISUALo - Move cursor to other end of the selection

Movement