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);
@max-verem
max-verem / fontconfig.c
Created December 2, 2024 06:11 — forked from CallumDev/fontconfig.c
FontConfig sample in C
//compiled gcc fonttest.c -o fonttest -lfontconfig
//Sample output: /usr/share/fonts/steam-fonts/arial.ttf
#include <stdio.h>
#include <stdlib.h>
#include <fontconfig/fontconfig.h>
int main()
{
FcConfig* config = FcInitLoadConfigAndFonts();
//make pattern from font name
FcPattern* pat = FcNameParse((const FcChar8*)"Arial");
@max-verem
max-verem / serial_arbitrary_baudrate.c
Created November 27, 2025 07:32
CRSF [EE 18 16] => [C8 18 16]
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <asm/termbits.h>
#include <fcntl.h>
#include <sys/ioctl.h>
int serial_arbitrary_baudrate(int fd, int baudrate)
@max-verem
max-verem / lab8_fdm_proxy_async.c
Created December 10, 2025 18:05
lab #8 proxy
#define DEFAULT_OUTPUT_PWM_FRAME_RATE 1000
#define DEFAULT_ATTITUDE 120.0
/*
will listen for UDP packets:
9001 - Betaflight's PwmOut UDP link to RF9
9002 - Betaflight's PwmOut UDP link to gazebo
will send
From d53ba04c85c85c81dc8bdeec38bcfb8f41ebb471 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <maks.verem@gmail.com>
Date: Wed, 10 Dec 2025 17:09:41 +0200
Subject: [PATCH 1/6] Impelement real serial support for SITL.
---
src/main/drivers/serial_sitl.c | 504 +++++++++++++++++++++++++++++++++
src/main/drivers/serial_sitl.h | 5 +
src/main/io/serial.c | 8 +
src/main/main.c | 11 +
@max-verem
max-verem / sim2_A.m
Created April 3, 2026 16:13
[METEORIT] pre PID analisas
sim_duration = 20; # simulation duration, seconds
sim_freq = 150; # simulation step frequency
target_position_A = 1200; # initial positoin of target, DILEC
target_position_B = 5700; # initial positoin of target, DILEC
head_position_current = 4000; # initial head position, DILEC
head_speed_current = 0;
PARAM_K_SPEED = 170 / 1000;
INTEGRATOR_SPEED = (1.0 / 0.016); # 16 [mV] = 1 [dc / s]
output_voltage_MIN = -10;