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 / raytracing.py
Created August 2, 2025 02:27 — forked from rossant/raytracing.py
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@pmp-p
pmp-p / pygbag_build_custom_wheel.md
Created May 14, 2025 05:57 — forked from kadir014/pygbag_build_custom_wheel.md
Build your own third-party pygbag wheels

Introduction

These are the steps I use to build Nova Physics's Python Binding for pygbag. Hope it helps you build your own third-party pygbag wheels 💕

Prerequisites

  • Ubuntu 22 (or higher) WSL works as well. (glibc 2.35+ is required.)

Building

  • Be in the root directory (we will extract stuff into /opt).

  • Download the latest python-wasm-sdk release from here. (I had to download a slightly older release.)

@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 / repro.sh
Last active February 9, 2024 02:37
gc orc/arc bug
#!/bin/bash
# wasi-sdk from https://github.com/WebAssembly/wasi-sdk/releases
# Nim git
PATH=/opt/wasi-sdk-21.0/bin:$PATH ./Nim/bin/nim \
--exceptions:goto \
--cc:clang -d:wasi --threads:off -d:emscripten --cpu:wasm32 \
--passC="-m32 -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN" \
@pmp-p
pmp-p / wmaltmouse.au3
Created February 7, 2024 02:18
move win32 windows like on most Xwindows desktops (autoit)
#cs ----------------------------------------------------------------------------
move win32 windows like on most Xwindows desktops (autoit)
AutoIt Version: 3.3.8.1
Author: pmp-p
https://github.com/pmp-p
@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.