Skip to content

Instantly share code, notes, and snippets.

View patrislav1's full-sized avatar

Patrick Huesmann patrislav1

View GitHub Profile
patrislav1 /
Created April 5, 2024 13:23
go.mod to static bitbake recipe
#!/usr/bin/env python3
import re
import sys
import subprocess
def get_commit_hash(repo_url, version_tag):
command = ["git", "ls-remote", "--tags", "--refs", repo_url]
result =, capture_output=True, text=True)
patrislav1 /
Last active March 29, 2024 11:28
Save video file of a Zoom recording

Save zoom recording with a bookmarklet

  1. Create bookmarklet

Add bookmark with this URL:

javascript: (() => { vid = document.querySelector('.vjs-tech'); console.log(vid.src);, '_blank'); })();
  1. Open Zoom recording link
  2. Click on the bookmark
patrislav1 / gist:97577dcd4b8743129dd72ec0fd16c4f0
Created February 5, 2024 16:00
Update author/committer email address in git history
git filter-branch --env-filter '
patrislav1 / ikea-rodret_E2201_ZHA-Z2M_control-light.yaml
Last active April 4, 2024 09:27 — forked from damru/ikea-rodret_E2201_ZHA-Z2M_control-light.yaml
IKEA RODRET Dimmer Remote (E2201) - ZHA/Z2M - Control Light
name: IKEA Rodret Dimmer Light Control (ZHA/Z2M)
description: "## Control Light with IKEA RODRET Dimmer remote (v1.0)
Only for use with [ZHA](
or Zigbee2MQTT (cf [MQTT](
+ [Z2M addon](
patrislav1 / simple-factory.cpp
Created November 13, 2022 13:05
Simple factory
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <string>
struct Base {
virtual std::string blub() = 0;
patrislav1 /
Created February 18, 2022 17:40
Show GitLab project tree as markdown
#!/usr/bin/env python3
import requests
import sys
from sortedcontainers import SortedDict, SortedList
class GitlabApi:
API_LINK = 'api/v4'
patrislav1 / miniprof.hpp
Last active January 31, 2022 17:06
#pragma once
#include <chrono>
#include <string>
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
namespace blg = boost::log::trivial;
patrislav1 / terminal.html
Created January 28, 2022 16:37
HTML template for terminal clipboard ('Copy as HTML') copy
<pre style="background-color: #0f0800;color: #bbbbbb;">
...insert copied message here...
patrislav1 / .clang-format
Last active April 2, 2024 09:08
clang-format configuration
BasedOnStyle: Chromium
IndentWidth: 4
- Regex: '<[a-zA-Z0-9_]+>' # standard headers (no extension)
Priority: 2
- Regex: '<[a-zA-Z0-9/]+\.(h|hpp)>' # library headers (with extension)
Priority: 3
patrislav1 /
Created September 11, 2021 14:57
Lossless conversion from .avi to .mkv (for Smart TV compatibility)
FILES=$(find . -name "*.avi")
while read FILE; do
DESTFILE=$(echo ${FILE} | sed 's/\.avi$/\.mkv/g')
rm -f "${DESTFILE}"
ffmpeg -fflags +genpts -nostdin -i "${FILE}" -c:v copy -c:a copy "${DESTFILE}"
ls -lh "$FILE"
ls -lh "$DESTFILE"
done <<< $FILES