Skip to content

Instantly share code, notes, and snippets.

View caspark's full-sized avatar

Caspar Krieger caspark

View GitHub Profile
@caspark
caspark / textfetch.py
Created May 28, 2020 03:12
Python UI Automation text fetching from a Windows contro sample
import uiautomation as auto
# move mouse cursor over a text box with some text in it first
c = auto.ControlFromCursor()
v = c.GetValuePattern()
print(v.Value) # should print the contents of the text box
# now select some text in that same control
t = c.GetTextPattern()
@caspark
caspark / cloning_world.rs
Created May 17, 2024 05:48
Example of how to clone world in hecs
use hecs::{ColumnBatchBuilder, ColumnBatchType, Component, TypeUnknownToCloner, World};
fn try_add_type_to_batch<T: Component>(
archetype: &hecs::Archetype,
batch_type: &mut ColumnBatchType,
) {
if archetype.has::<T>() {
batch_type.add::<T>();
}
}