Skip to content

Instantly share code, notes, and snippets.

View pmp-p's full-sized avatar
🚜
coding or farming

Paul m. p. Peny pmp-p

🚜
coding or farming
View GitHub Profile
@pmp-p
pmp-p / Comparison Espressif ESP MCUs.md
Created August 14, 2024 09:59 — forked from sekcompsci/Comparison Espressif ESP MCUs.md
Comparison chips (SoCs) table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6. Forked from @fabianoriccardi

Comparison chips (SoCs) table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

A minimal table to compare the Espressif's MCU families.

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September 2019, September 2020, December
@pmp-p
pmp-p / nginx.conf
Created March 10, 2024 07:22 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@pmp-p
pmp-p / mocap.py
Created January 2, 2023 20:29 — forked from rdb/mocap.py
Motion capture animation recording in Panda3D
from panda3d.core import CharacterJoint, CharacterSlider, CharacterVertexSlider
from panda3d.core import AnimBundle, AnimGroup, AnimChannelScalarDynamic
from panda3d.core import AnimChannelMatrixXfmTable, AnimChannelScalarTable
from panda3d.core import PTA_float
class MotionCapture:
def __init__(self, actor, part_name="modelRoot", lod_name="lodRoot"):
self.part_bundle = actor.get_part_bundle(part_name, lod_name)
self.joint_tables = {}
@pmp-p
pmp-p / find-top-level-from-wheel-file.py
Created October 2, 2022 00:11 — forked from pradyunsg/find-top-level-from-wheel-file.py
Figuring out the top-level importable names from a wheel
"""Takes a .whl file and figures out the top-level importable names in that wheel.
Usage:
$ python find-top-level-from-wheel-file.py ./setuptools-65.4.1-py3-none-any.whl
['_distutils_hack', 'pkg_resources', 'setuptools']
Testing:
$ pytest find-top-level-from-wheel-file.py
...
@pmp-p
pmp-p / webrtc-editor.md
Created May 24, 2022 12:12 — forked from aoloe/webrtc-editor.md
webrtc collaborative document editing

specification:

  • php server storing a server.
  • the first person opening a file becomes the master and is in charge to save to the server
  • all other users open webrtc connection to the master and keep the document in sync with him
  • if it makes things easier, only allow one user at a time to edit a block (paragraph, list, section)

todo:

  • check if and how to get webrtc to work without a node server.
  • try to convert a chat example in a text editor.
@pmp-p
pmp-p / Panda3D hosted by wxPython as Subprocess.py
Created October 28, 2020 11:24 — forked from hubertgrzeskowiak/Panda3D hosted by wxPython as Subprocess.py
This is an example on how to create a Panda3d instance in a subprocess, which window is hosted in a wxPython panel. This approach has the advantage of scope separation (both libraries define globals) and framerate independence. The disadvantage is the more complex communication between the processes.
import sys
import os
from multiprocessing import Process, Pipe
import wx
from direct.task import Task
from pandac.PandaModules import WindowProperties
from pandac.PandaModules import loadPrcFileData
from direct.showbase.ShowBase import ShowBase
@pmp-p
pmp-p / create_btusb_patch.sh
Created June 10, 2020 16:30 — forked from nevack/archived.md
Fix for CSR Dongle 0a12:0001 ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
#!/usr/bin/env sh
version="${1:-$(uname -r | cut -d'-' -f1)}"
extra="${2:-$(uname -r | cut -d'-' -f2-)}"
fullversion="$version-$extra"
echo Making patch for kernel $fullversion
name="linux-$version"
@pmp-p
pmp-p / Private-pypi-howto
Created April 12, 2020 19:54 — forked from Jaza/Private-pypi-howto
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@pmp-p
pmp-p / toUTF8Array.js
Created June 17, 2019 15:51 — forked from joni/toUTF8Array.js
toUTF8Array: Javascript function for encoding a string in UTF8.
function toUTF8Array(str) {
var utf8 = [];
for (var i=0; i < str.length; i++) {
var charcode = str.charCodeAt(i);
if (charcode < 0x80) utf8.push(charcode);
else if (charcode < 0x800) {
utf8.push(0xc0 | (charcode >> 6),
0x80 | (charcode & 0x3f));
}
else if (charcode < 0xd800 || charcode >= 0xe000) {