Skip to content

Instantly share code, notes, and snippets.

View haxtibal's full-sized avatar

Tobias Deiminger haxtibal

  • Regensburg, Germany
View GitHub Profile
@haxtibal
haxtibal / output.txt
Last active November 23, 2025 13:22
Find Rust doc comments using tree-sitter and relate them with their associated item. See https://github.com/strictdoc-project/strictdoc/issues/2213.
const_item "MAGIC_NUMBER" at 6,6-6,6: "Some random words: quantum cascade amplifier"
static_item "GLOBAL_STATE" at 10,10-10,10: "Random text: nebula crystalline matrix"
type_item "CustomResult" at 14,14-14,14: "Words: temporal flux capacitor"
struct_item "Container" at 18,18-26,26: "Description: polymorphic data structure"
enum_item "Status" at 30,30-50,50: "Content: enumerated variant collection"
enum_variant "Active" at 33,33-33,33: "Words: active processing node"
enum_variant "Idle" at 37,37-41,41: "Text: suspended animation chamber"
enum_variant "Error" at 45,45-49,49: "Description: error state container"
union_item "FloatOrInt" at 54,54-62,62: "Random: memory-aligned data union"
trait_item "Processor" at 66,66-84,84: "Description: behavioral interface contract"
@haxtibal
haxtibal / testleak.psm1
Created March 22, 2022 14:28
Try to reproduce memory leak as in icinga-powershell-framework
# Add this file as module to your PSModulePath, call Test-Leak in an interactive PS session,
# and watch the managed heap size in a debugger session
$Global:Vars = [hashtable]::Synchronized(@{});
$Global:Vars.Add('WorkerQueues', @{});
function Producer {
param (
$ThreadId = 0
)
@haxtibal
haxtibal / custom_objectify.py
Last active March 8, 2022 00:59
Experiments with lxml: Combine custom class lookup and objectify magic
"""Some experiments on how we can combine custom class lookup with lxml.objectify."""
from enum import Enum
from io import StringIO
from lxml import etree, objectify
from typing import Union
class MyEnum(Enum):
"""Can we associate this pure python type with a specific XML element <myEnumValue>?
@haxtibal
haxtibal / lib.rs
Created January 27, 2019 18:57
Use crate lyon_tessellation to triangulate a 3D volume
extern crate lyon_tessellation;
#[cfg(test)]
mod tests {
use lyon_tessellation::{FillError, FillOptions, FillTessellator, FillVertex};
use lyon_tessellation::path::builder::{FlatPathBuilder,PolygonBuilder};
use lyon_tessellation::path::default::Path;
use lyon_tessellation::geometry_builder::{BuffersBuilder,VertexBuffers};
use lyon_tessellation::geom::euclid::{Point2D, Point3D};
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 15c86a05..8cbeb6a5 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1565,40 +1565,54 @@ void Annot::incRefCnt() {
annotLocker();
refCnt++;
}
void Annot::decRefCnt() {