Skip to content

Instantly share code, notes, and snippets.

@max-verem
max-verem / trigger-wheel-event.js
Created June 20, 2022 10:52 — forked from cbeard87/trigger-wheel-event.js
Dispatch a mouse wheel event
const wheelEvt = document.createEvent('MouseEvents');
wheelEvt.initEvent('wheel', true, true);
// Set deltaY depending on wheel up or wheel down
wheelEvt.deltaY = +120;
// wheelEvt.deltaY = -120;
// Pass event to element
element.dispatchEvent(wheelEvt);
%YAML:1.0
---
R_world2cam:
- !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [ 9.7306030138042954e-01, -2.1914187012874764e-01,
-7.1627443301452640e-02, 2.1696984468532077e-01,
9.7548023332915113e-01, -3.6910714993515281e-02,
@max-verem
max-verem / allocterminal.cpp
Created June 13, 2020 11:05 — forked from kingseva/allocterminal.cpp
Example redirecting cout/stdout to allocated terminal in GUI programs.
#include "rang.hpp"
#include <windows.h>
#include <cstdlib>
void BindStdHandlesToConsole()
{
//TODO: Add Error checking.
// Redirect the CRT standard input, output, and error handles to the console
#!/bin/bash
mkdir /var/run/pcscd
while :
do
/usr/bin/socat -d -d -d \
UNIX-LISTEN:/var/run/pcscd/pcscd.comm,reuseaddr,fork \
TCP:10.1.1.151:4001,nodelay,nonblock
@max-verem
max-verem / build-pocketvj.md
Created February 7, 2019 13:07 — forked from baydam/build-pocketvj.md
How to build PocketVJ on Raspberry Pi 3

Documentation for building PocketVJ on raspberry Pi 3

Install Raspbian Lite

Find the instruction in the link below https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Install dependencies

$ sudo apt-get -y install lxde-core lxterminal lxappearance xinit lightdm ntfs-3g python-pexpect vim figlet git-core firmware-ralink hostapd isc-dhcp-server lighttpd samba samba-common-bin php5-common php5-cgi php5 php5-mysql screen fbi ttf-mscorefonts-installer mediainfo gparted php5-cli iptables xtightvncviewer imagemagick dosfstools exfat-utils exfat-fuse hfsplus hfsprogs hfsutils xdotool expect expect-dev avahi-daemon libavahi-compat-libdnssd-dev feh libjpeg8 libjpeg8-dev libao-dev avahi-utils libavahi-compat-libdnssd-dev libva-dev youtube-dl python-smbus mpg321 mpg123 libreoffice-impress rc-gui python-pip iceweasel python-dev python-dbus xpdf x11-xserver-utils libncurses5-dev shellinabox tk okular usbmount libgstreamer0.10-0 libgstreamer0.10-dev gstreamer0.10-tools gstr
#include <stdio.h>
#include <nvidia/gdk/nvml.h>
int main()
{
nvmlReturn_t result;
unsigned int temp;
// First initialize NVML library
result = nvmlInit();
/*
Miranda Animation OXI file to PNG sequence
gcc -g3 -ggdb -O0 demo.c -o demo -lpng
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
From bf64154609b9ac809e7574d6b4f3ac64655413a5 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <verem@m1.tv>
Date: Sat, 20 Jan 2018 10:24:25 +0200
Subject: [PATCH] Disable _XOPEN_SOURCE marco definition
---
src/modules/ndi/factory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/ndi/factory.c b/src/modules/ndi/factory.c
#!/bin/bash
D1="[f=hls:hls_flags=delete_segments:hls_list_size=10:hls_time=20:use_localtime=1:hls_segment_filename='/var/www/html/hls3/%s.ts']/var/www/html/hls3/stream.m3u8"
D2="[f=mpegts]udp://239.1.1.3:10480?localaddr=10.1.5.99&pkt_size=1316&fifo_size=1000000"
D3="[f=dash:window_size=5:extra_window_size=5:remove_at_exit=1]/var/www/html/dash3/stream.mpd"
ffmpeg \
-v verbose \
-f decklink -format_code pal -i "DeckLink Mini Recorder" \
-vf "setdar=dar=16/9" \
#!/bin/bash
D1="[f=hls:hls_flags=delete_segments:hls_list_size=10:hls_time=20:use_localtime=1:hls_segment_filename='/var/www/html/hls2/%s.ts']/var/www/html/hls2/stream.m3u8"
D2="[f=mpegts]udp://239.1.1.2:10480?localaddr=10.1.5.99&pkt_size=1316&fifo_size=1000000"
D3="[f=dash:window_size=5:extra_window_size=5:remove_at_exit=1]/var/www/html/dash2/stream.mpd"
ffmpeg \
-v verbose \
-f decklink -format_code pal -i "DeckLink SDI (2)" \
-vf "setdar=dar=16/9" \