Skip to content

Instantly share code, notes, and snippets.

View cdeil's full-sized avatar

Christoph Deil cdeil

View GitHub Profile
WARNI [root] DATABASE_URL='postgresql+psycopg://admin:admin@localhost:9876/stocadro_alembic9'
WARNI [root] If this is not the URL that you expect, check if your env variable of the system is not set (echo $POSTGRES_CONNECTION_STRING)
INFO [sqlalchemy.engine.Engine] select pg_catalog.version()
INFO [sqlalchemy.engine.Engine] [raw sql] {}
DEBUG [sqlalchemy.engine.Engine] Col ('version',)
DEBUG [sqlalchemy.engine.Engine] Row ('PostgreSQL 16.8 (Debian 16.8-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit',)
INFO [sqlalchemy.engine.Engine] select current_schema()
INFO [sqlalchemy.engine.Engine] [raw sql] {}
DEBUG [sqlalchemy.engine.Engine] Col ('current_schema',)
DEBUG [sqlalchemy.engine.Engine] Row ('public',)
(memray-crash) (base) cdeil@Kryvoff-MBP memray-crash % lldb -- python -m pytest test_example.py --memray
(lldb) target create "python"
Current executable set to '/Users/cdeil/temp/memray-crash/.venv/bin/python' (arm64).
(lldb) settings set -- target.run-args "-m" "pytest" "test_example.py" "--memray"
(lldb) process handle SIGILL --stop true --pass false --notify true
NAME PASS STOP NOTIFY
=========== ======= ======= =======
SIGILL false true true
(lldb) bt
error: Command requires a current process.
"""Snake in Arcade.
# Learnings
1. Key input handling and update time delta is tricky.
Creating `snake.direction_commands` to keep track works well.
The `time_to_move` solution here works OK.
A simpler alternative could be to use `Window.update_rate` which
is passed to `on_update` as `delta_time` directly.
2. Grid vs pixel coordinates can litter the code.
"""
Solar system simulation. Visualisation with Arcade.
"""
import collections
import dataclasses
import math
import time
import arcade
"""
Solar system simulation. Visualisation with Arcade.
"""
import arcade
class Vec2d:
def __init__(self, x: float, y: float):
self.x = x
@cdeil
cdeil / ms.md
Created January 4, 2025 08:23
asdf

Demo:

version: 5
environments:
default:
channels:
- url: https://conda.anaconda.org/conda-forge/
indexes:
- https://pypi.org/simple
packages:
osx-arm64:
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h99b78c6_7.conda
{
"build": "hf2054a2_0",
"build_number": 0,
"depends": [
"pthread-stubs",
"xorg-libxau >=1.0.11,<2.0a0",
"xorg-libxdmcp"
],
"license": "MIT",
"license_family": "MIT",
reading sources... [100%] upgrade
/Users/cdeil/code/oss/panel/doc/api/panel.__init__.rst:4: WARNING: Could not import class or module '__init__.panel' specified for inheritance diagram
/Users/cdeil/code/oss/panel/doc/api/panel.__init__.rst:5: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/Users/cdeil/code/oss/panel/doc/api/panel.__main__.rst:4: WARNING: Could not import class or module '__main__.panel' specified for inheritance diagram
/Users/cdeil/code/oss/panel/doc/api/panel.__main__.rst:5: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/Users/cdeil/code/oss/panel/doc/api/panel.__version.rst:4: WARNING: Could not import class or module '__version.panel' specified for inheritance diagram
/Users/cdeil/code/oss/panel/doc/api/panel.__version.rst:5: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/Users/cdeil/code/oss/panel/doc/api/panel._param.rst:4: WARNING: Could not import class or module '_param.panel' specified for inheritance di
panel $ pixi run -e test-ui pytest --ui panel/tests/ui/widgets/test_icon.py -v --browser chromium -n logical --dist no -n 0
=============================================================================================== test session starts ================================================================================================
platform darwin -- Python 3.12.5, pytest-7.4.4, pluggy-1.5.0 -- /Users/cdeil/code/oss/panel/.pixi/envs/test-ui/bin/python3.12
cachedir: .pytest_cache
rootdir: /Users/cdeil/code/oss/panel
configfile: pyproject.toml
plugins: asyncio-0.23.8, cov-5.0.0, github-actions-annotate-failures-0.2.0, playwright-0.5.0, rerunfailures-14.0, anyio-4.4.0, base-url-2.1.0, xdist-3.6.1
asyncio: mode=Mode.AUTO
collected 17 items