Note:
<example>
is meant to denote text replaced by you (including brackets).
// global dependencies
npm install -g knex
import asyncio | |
import cv2 | |
from aiohttp import web, MultipartWriter | |
async def mjpeg_handler(request): | |
boundary = "boundarydonotcross" | |
response = web.StreamResponse(status=200, reason='OK', headers={ | |
'Content-Type': 'multipart/x-mixed-replace; ' | |
'boundary=--%s' % boundary, |
#!/bin/bash | |
# References: | |
# https://www.isticktoit.net/?p=1383 | |
# http://irq5.io/2016/12/22/raspberry-pi-zero-as-multiple-usb-gadgets/ | |
# After running this, use hid_gadget_test.c <https://github.com/aagallag/hid_gadget_test/blob/master/hid_gadget_test.c> | |
cd /sys/kernel/config/usb_gadget/ |
# nim c -r --threads:on --gc:orc | |
import cpuinfo, os, random, locks, deques | |
type | |
WorkReq = ref object | |
id: int | |
WorkRes = ref object | |
id: int |
#include "Touch.h" | |
#if defined(_USING_HID) | |
#define CONTACT_COUNT_MAXIMUM 10 | |
#define REPORTID_TOUCH 0x04 | |
#define LSB(v) ((v >> 8) & 0xff) | |
#define MSB(v) (v & 0xff) |
All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker
. This will install the whole docker suite, left only Tini to be compiled manually.
// Leaflet JS - note the *className* attribute
// [...]
L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
className: 'map-tiles'
}).addTo(map);
// [...]
import usb_hid | |
# https://stackoverflow.com/questions/36750287/two-byte-report-count-for-hid-report-descriptor | |
absolute_mouse = usb_hid.Device( | |
report_descriptor=bytes( | |
# Absolute mouse | |
(0x05, 0x01) # Usage Page (Generic Desktop) | |
+ (0x09, 0x02) # Usage (Mouse) | |
+ (0xA1, 0x01) # Collection (Application) | |
+ (0x09, 0x01) # Usage (Pointer) |