Skip to content

Instantly share code, notes, and snippets.

@unkn-one
unkn-one / chapters.py
Created July 25, 2023 00:32
Convert youtube timestamps to ffmpeg chapters
#!/usr/bin/env python3
from datetime import time
import fileinput
import re
time_re = re.compile(
r'((?P<hour>\d+):)?(?P<minute>\d+):(?P<second>\d+)(.(?P<microsecond>\d+))?')
ini_start = '''\
;FFMETADATA1
@unkn-one
unkn-one / live_view.py
Last active February 8, 2024 22:14
Live view from FLIR Blackfly camera using OpenCV
import logging
import cv2
import PySpin
logger = logging.getLogger(__name__)
class Camera(object):
def __init__(self, cam):
@unkn-one
unkn-one / TaskbarAutoMove.ahk
Last active May 29, 2019 10:47
Automatically move taskbar when monitor orientation changes
#NoEnv
#SingleInstance force
#Persistent
OnMessage(0x7E, "WM_DISPLAYCHANGE")
return
WM_DISPLAYCHANGE(wParam, lParam) {
x := lParam & 0xffff ;new horizontal res
@unkn-one
unkn-one / locking-test.rst
Last active August 29, 2015 14:23
Cinter locking tests

Cinter locking tests

General setup

Controller node

  • Redis server
@unkn-one
unkn-one / spy.py
Last active August 29, 2015 14:20
Function for augmenting object to print stack trace whenever watched attributes are accessed, changed or removed.
def patch(obj, attrs):
import traceback
class o(object): pass
class Spy(o):
def __getattribute__(self, a):
if a in attrs:
traceback.print_stack()
return object.__getattribute__(obj, a)
def __setattr__(self, a, value):
@unkn-one
unkn-one / common-types.xsd
Created October 10, 2012 16:52 — forked from anonymous/common-types.xsd
Common Types
unit st
currency ct
person ct
address ct
@unkn-one
unkn-one / SellCube.md
Created June 27, 2012 23:39
SellCube future features