Skip to content

Instantly share code, notes, and snippets.

@nrbnlulu
nrbnlulu / d3d_ANGEL_texture_investigation.md
Last active April 6, 2025 12:01
ANGLE DirectX Interop (textures for flutter)

ANGLE's Mechanism for DirectX Interoperability

Introduction: Bridging Graphics APIs with ANGLE

The Almost Native Graphics Layer Engine (ANGLE) stands as a pivotal open-source project developed by Google, designed to facilitate cross-platform graphics rendering.¹ At its core, ANGLE functions as a graphics engine abstraction layer, adept at translating OpenGL ES 2 and 3 API calls into corresponding calls for a variety of native graphics APIs, including DirectX 9, DirectX 11, OpenGL, Vulkan, and Metal.¹ This translation capability is particularly significant for bringing high-performance OpenGL compatibility to the Microsoft Windows operating system and to web browsers like Chromium. By converting OpenGL calls into Direct3D, ANGLE leverages the often superior driver support available for DirectX on Windows systems.¹ Its utility is underscored by its integration into major web browsers such as Google Chrome, Mozilla Firefox, Microsoft Edge, and Apple's Safari, as well as game engines like Godot and numero

@nrbnlulu
nrbnlulu / keymap.json
Created April 2, 2025 12:44
zed keybindings
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"context": "Workspace",
fdsafads
@nrbnlulu
nrbnlulu / egl_gstreamer.rs
Created February 16, 2025 10:25
impls for gst_egl_sys
pub mod gst_egl_ext {
use glib::{ffi::gpointer, translate::*};
use gst_gl_sys::{GstGLContext, GstGLMemory};
macro_rules! skip_assert_initialized {
() => {};
}
mod ffi {
use glib::ffi::gpointer;
use gst::ffi::GstMiniObject;
@nrbnlulu
nrbnlulu / discord_logger.py
Created December 30, 2024 09:48
discord exceptions logger for servers
import functools
import traceback
from collections.abc import AsyncIterator, Awaitable, Callable
from contextlib import asynccontextmanager
from typing import Concatenate, Protocol
import anyio
import discord
from loguru import logger
@nrbnlulu
nrbnlulu / node.py
Last active September 16, 2024 09:09
Strawberry-GraphQL Node type with support to foreign node fields and custom id types.
from __future__ import annotations
import base64
from dataclasses import dataclass
from functools import cached_property
from typing import TYPE_CHECKING, Annotated, Any, Self
import strawberry
from strawberry.annotation import StrawberryAnnotation
from strawberry.types.field import StrawberryField
@nrbnlulu
nrbnlulu / msgspec_vs_pydanticv2.py
Created June 18, 2024 08:43
Msgspec vs Pydantic v2
from datetime import datetime
import json
import re
import timeit
from contextlib import contextmanager
from dataclasses import dataclass
from typing import Annotated, Any, Callable, Iterator, TypedDict
from pydantic.annotated_handlers import GetJsonSchemaHandler
@nrbnlulu
nrbnlulu / permission_cmd.py
Created June 4, 2024 10:51
Inject parameter for a function using `Concatenate` (for auth purposes)
from collections.abc import Awaitable, Callable
from contextvars import ContextVar
from typing import Concatenate, Protocol
from result.result import Err, Ok, Result
from t5hob_sdk.bases.err import AuthorizationErr
class CheckPermissionCmd:
{"help": "https://data.gov.il/api/3/action/help_show?name=datastore_search", "success": true, "result": {"include_total": true, "limit": 500, "records_format": "objects", "resource_id": "5c78e9fa-c2e2-4771-93ff-7f400a12f7ba", "total_estimation_threshold": null, "records": [{"_id":1,"סמל_ישוב":"0 ","שם_ישוב":"לא רשום ","שם_ישוב_לועזי":" ","סמל_נפה":0,"שם_נפה":"לא ידוע ","סמל_לשכת_מנא":0,"לשכה":" ","סמל_מועצה_איזורית":0,"שם_מועצה":null},{"_id":2,"סמל_ישוב":"3400 ","שם_ישוב":"חברון ","שם_ישוב_לועזי":" ","סמל_נפה":77,"שם_נפה":"חברון ","סמל_לשכת_מנא":11,"לשכה":"ירושלים ","סמל_מועצה_איזורית":0,"שם_מועצה":null},{"_id":3,"סמל_ישוב":"1347 ","שם_ישוב":"קצר א-סר ","שם_ישוב_לועזי":" ","סמל_נפה":62,"שם_נפה":"באר שבע ","סמל_לשכת_מנא":62,"לשכה":"באר שבע ","סמל_מועצה_איזורית":68,"שם_מועצה":"נווה מדבר"},{"_id":4,"סמל_ישוב":"1331 ","שם_ישוב":"כמאנה ","שם_ישוב_לועזי":" ","סמל_נפה":24,"שם_נפה":"עכו ","סמל_לשכת_מנא":20,"לשכה":"כרמיאל ","סמל_מועצה_איזורית":56,"שם_מועצה":"משגב"},{"_id":5,"סמל_ישוב":"3777 ","שם_ישוב":"סנסנה ","שם_יש