Skip to content

Instantly share code, notes, and snippets.

View lukaszradziak's full-sized avatar
👨‍💻

Łukasz Radziak lukaszradziak

👨‍💻
View GitHub Profile
#include <Arduino.h>
#include <ESP32CAN.h>
#include <CAN_config.h>
CAN_device_t CAN_cfg; // CAN Config
const int rx_queue_size = 10; // Receive Queue size
void setup() {
Serial.begin(115200);
Serial.println("Basic Demo - ESP32-Arduino-CAN");
const input = `<test><data>123</data></test>`;
const unescapeString = (s) => {
return s.replace(/&amp;/g, "&")
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&#39;/g, "'")
.replace(/&quot;/g, '"');
}
@lukaszradziak
lukaszradziak / app.js
Last active February 1, 2022 13:24
tablica wyników
const SerialPort = require('serialport');
const Readline = require('@serialport/parser-readline');
const port = new SerialPort('/dev/tty.usbserial-A1071ZRT', {
baudRate: 57600
});
const parser = new Readline();
port.pipe(parser);
const result = {};
parser.on('data', function (data) {
@lukaszradziak
lukaszradziak / query.sql
Created January 16, 2022 21:20
VIDA Volvo CEM get configuration table SQL
select
b.id,
isnull(b.name,'') as ppename,
b.fkT142_BlockType as fkBlockTypeId,
isnull(td.data,'') as asname ,
b.offset,
bv.CompareValue,
td2.data
from T141_Block b
left outer join T190_Text t
@lukaszradziak
lukaszradziak / regularPolygon.js
Created January 10, 2022 23:38 — forked from AntonMacias/regularPolygon.js
Regular Polygon
function regularPolygon(sides, radius, initialRotation, initialPosition) {
if (initialRotation == undefined) initialRotation = 0;
if (initialPosition == undefined) initialPosition = { x: 0, y: 0 };
var center = {x:radius + initialPosition.x, y:radius + initialPosition.y};
var points = Array();
for (i = 0; i < sides; i++) {
var angle = (i * 2 * Math.PI) / sides;
points[i] = {
@lukaszradziak
lukaszradziak / libvirtd.log
Created October 19, 2021 15:52
/var/log/libvirt/libvirtd.log
2021-10-19 15:50:18.759+0000: 813: debug : qemuDomainObjBeginJobInternal:9416 : Starting job: job=none agentJob=none asyncJob=start (vm=0x7f95882a84e0 name=win10, current job=none agentJob=none async=none)
2021-10-19 15:50:18.760+0000: 813: debug : qemuDomainObjBeginJobInternal:9479 : Started async job: start (vm=0x7f95882a84e0 name=win10)
2021-10-19 15:50:18.760+0000: 813: debug : qemuProcessStart:7070 : conn=0x7f95b0031e90 driver=0x7f9588032750 vm=0x7f95882a84e0 name=win10 id=-1 asyncJob=start migrateFrom=<null> migrateFd=-1 migratePath=<null> snapshot=(nil) vmop=0 flags=0x1
2021-10-19 15:50:18.760+0000: 813: debug : qemuProcessInit:5524 : vm=0x7f95882a84e0 name=win10 id=-1 migration=0
2021-10-19 15:50:18.760+0000: 813: debug : qemuProcessInit:5527 : Beginning VM startup process
2021-10-19 15:50:18.760+0000: 813: debug : qemuProcessInit:5545 : Determining emulator version
2021-10-19 15:50:18.779+0000: 813: debug : virQEMUCapsKVMUsable:4641 : /dev/kvm has changed (1634658414 vs 1634657115)
2021-10-19 15:50:1
@lukaszradziak
lukaszradziak / custom_hooks.log
Created October 19, 2021 15:51
/var/log/libvirt/custom_hooks.log
+ long_delay=10
+ medium_delay=5
+ short_delay=1
+ echo 'Beginning of startup!'
Beginning of startup!
+ test -e /tmp/vfio-store-display-manager
+ rm -f /tmp/vfio-store-display-manager
+ stop_display_manager_if_running sddm
+ command -v systemctl
/usr/bin/systemctl
@lukaszradziak
lukaszradziak / win10.log
Created October 19, 2021 15:50
/var/log/libvirt/qemu/win10.log
2021-10-19 15:50:20.459+0000: starting up libvirt version: 6.0.0, package: 0ubuntu8.14 (Matthew Ruffell <matthew.ruffell@canonical.com> Tue, 14 Sep 2021 14:00:49 +1200), qemu version: 4.2.1Debian 1:4.2-3ubuntu6.18, kernel: 5.11.0-38-generic, hostname: lukasz-All-Series
LC_ALL=C \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
HOME=/var/lib/libvirt/qemu/domain-5-win10 \
XDG_DATA_HOME=/var/lib/libvirt/qemu/domain-5-win10/.local/share \
XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain-5-win10/.cache \
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain-5-win10/.config \
QEMU_AUDIO_DRV=none \
/usr/bin/qemu-system-x86_64 \
-name guest=win10,debug-threads=on \
function facetedBox(w, h, d, f) {
let hw = w * 0.5,
hh = h * 0.5,
hd = d * 0.5;
let vertices = [
// px
hw,
hh - f,
-hd + f, // 0
hw,
@lukaszradziak
lukaszradziak / bottomCabinetBody.js
Created September 27, 2021 10:16
bottomCabinetBody.js
let cabinet = {
config: {
height: {
value: 820,
},
width: {
value: 600,
},
depth: {
value: 510,