This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // for https://www.tztstore.com/goods/show-7983.html | |
| // put this in Arduino/libraries/TFT_eSPI/ | |
| #define USER_SETUP_INFO "CYD" | |
| #define ILI9341_2_DRIVER | |
| #define TFT_INVERSION_ON | |
| #define TFT_WIDTH 240 | |
| #define TFT_HEIGHT 320 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone https://github.com/RPi-Distro/pi-gen.git | |
| cd pi-gen | |
| git checkout arm64 | |
| cat << EOF > config | |
| IMG_NAME=nullos-pi-lite-bookworm-aarch64 | |
| PI_GEN_RELEASE="NullOS Pi" | |
| RELEASE=bookworm | |
| TARGET_HOSTNAME=nullos | |
| KEYBOARD_KEYMAP=us |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // stupidly-minimal fs that uses fflate on the zip | |
| // it's just enough to load js carts, and read files, but not much else | |
| import * as fflate from 'fflate' // https://esm.sh/fflate/esm/browser.js | |
| const FILETYPE_REGULAR_FILE = 4 | |
| const FILETYPE_DIRECTORY = 3 | |
| export default async function fflatefs(cartUrl) { | |
| const info = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // stupidly-minimal fs that uses fflate on the zip | |
| // it's just enough to load js carts, and read files, but not much else | |
| import * as fflate from 'fflate' // https://esm.sh/fflate/esm/browser.js | |
| const FILETYPE_REGULAR_FILE = 4 | |
| const FILETYPE_DIRECTORY = 3 | |
| export default async function fflatefs(cartUrl) { | |
| const info = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from docstring_parser import parse | |
| import tools | |
| def tool_parse(tools): | |
| """ | |
| build AI tools-definition from python functions & docs | |
| """ | |
| toolsOut = [] | |
| for fname in dir(tools): | |
| if not fname.startswith('__'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "stdio.h" | |
| // Get more from https://en.wikipedia.org/wiki/List_of_file_signatures | |
| const char* detectMime(unsigned char* bytes) { | |
| if (bytes[0] == 0xFF && bytes[1] == 0xD8 && bytes[2] == 0xFF) { | |
| return "image/jpeg"; | |
| } | |
| if (bytes[0] == 0x89 && bytes[1] == 0x50 && bytes[2] == 0x4E) { | |
| return "image/png"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.js' | |
| import setup from 'https://konsumer.js.org/raylib-python-web/python-raylib-web.js' | |
| class RaylibPythonComponent extends HTMLElement { | |
| constructor () { | |
| super() | |
| this.shadow = this.attachShadow({ mode: 'open' }) | |
| this.canvas = document.createElement('canvas') | |
| this.style.display = 'none' | |
| window.addEventListener('resize', this.onResize.bind(this)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| wget https://github.com/raysan5/raylib/releases/download/4.5.0/raylib-4.5.0_webassembly.zip | |
| unzip raylib-4.5.0_webassembly.zip | |
| cd raylib-4.5.0_webassembly/ | |
| wget https://raw.githubusercontent.com/raysan5/raylib/master/examples/core/core_basic_window.c | |
| emcc -Os -I./include -s USE_GLFW=3 -s ASYNCIFY -DPLATFORM_WEB -o index.html core_basic_window.c lib/libraylib.a | |
| npx -y live-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import getWasmInterface from './get_wasm_interface.js' | |
| // usage | |
| const bytes = await fetch('mine.wasm').then(r => r.arrayBuffer()) | |
| const m = await WebAssembly.compile(bytes) | |
| // imports is minimal stub (empty functions) and exports is a list of things it exports | |
| const { imports } = await getWasmInterface(m) | |
| // now I can inject my own functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .PHONY: help clean | |
| help: ## Show this help | |
| @python tools/help.py "$(MAKEFILE_LIST)" | |
| clean: ## Remove all built files | |
| @rm -f FILES |
NewerOlder