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
@kadir014
kadir014 / pygbag_build_custom_wheel.md
Created April 5, 2025 21:32
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.)

@davidpendergast
davidpendergast / differences.txt
Last active August 22, 2023 13:53
Pygame vs. Pygame-CE API Differences
Pygame vs. Pygame-CE API Differences
------------------------------------
This document is meant to serve as a reference for pygame developers that use
both pygame and pygame-ce. It is not an endorsement of one over the other.
Last updated: April 26, 2023
Info was compiled from the repos' release pages and their respective docs:
@pradyunsg
pradyunsg / find-top-level-from-wheel-file.py
Last active December 4, 2023 13:15
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
...
@dabeaz
dabeaz / README.txt
Created October 15, 2019 20:10
PyCon India 2019, Code from Keynote Presentation by @dabeaz
Code from PyCon India 2019 Keynote Talk
David Beazley (https://www.dabeaz.com)
======================================
This code is presented "as is" and represents what was live-coded
during my closing keynote presentation at PyCon India, Chennai,
October 13, 2009. I have made no changes to the files.
Requires: Python 3.6+, numpy, pygame
@x-magic
x-magic / usbotg2host.dts
Created August 10, 2019 11:36
Device Tree overlay to enable OTG host on Orange Pi Zero
/*
* Device Tree overlay to enable OTG host on Orange Pi Zero
* Tested on Armbian Buster latest
* Run 'armbian-add-overley usbotg2host.dts' in root to use
*/
/dts-v1/;
/plugin/;
/ {
@shawwwn
shawwwn / uping.py
Last active March 24, 2025 09:43
µPing: Ping library for MicroPython
# µPing (MicroPing) for MicroPython
# copyright (c) 2018 Shawwwn <[email protected]>
# License: MIT
# Internet Checksum Algorithm
# Author: Olav Morken
# https://github.com/olavmrk/python-ping/blob/master/ping.py
# @data: bytes
def checksum(data):
if len(data) & 0x1: # Odd number of bytes
@joni
joni / toUTF8Array.js
Last active May 14, 2024 09:23
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) {
@hubertgrzeskowiak
hubertgrzeskowiak / Panda3D hosted by wxPython as Subprocess.py
Last active October 28, 2020 11:24
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