Skip to content

Instantly share code, notes, and snippets.

@GeneralFlint
GeneralFlint / cot-types-seen.md
Created October 19, 2023 19:22 — forked from a-f-G-U-C/cot-types-seen.md
CoT object types seen in the wild

The breakdown below is based on a collection of random CoT traffic samples acquired from public TAK servers between March-October 2021. The purpose is to understand the distribution of object types in a diversity of realistic use cases.

type count no_uids min_len max_len
a-.-A-C 71 21 474 500
a-.-G 4 1 462 462
a-.-G-e 2 1 464 464
a-.-G-E-V-C-U 6 2 486 491
a-.-G-p 2 1 464 464
@GeneralFlint
GeneralFlint / lxml example
Created October 2, 2023 15:41 — forked from Artem-Mamchych/lxml example
Пример использования lxml
# coding: utf8
xml = '''<?xml version="1.0" encoding="UTF-8"?>
<soft>
<os>
<item name="linux" dist="ubuntu">
This text about linux
</item>
<item name="mac os">
Apple company
@GeneralFlint
GeneralFlint / postgresql_jsonb_crud.sql
Created October 2, 2023 14:49 — forked from inindev/postgresql_jsonb_crud.sql
Simple PostgreSQL 9.4 functions to manipulate jsonb objects adapted from Matheus de Oliveira's json_manipulator.sql. https://gist.github.com/matheusoliveira/9488951 (Note: performance is not a concern for those functions)
/*
* derivative work of Matheus de Oliveira's json_manipulator.sql
* https://gist.github.com/matheusoliveira/9488951
*
* adapted to support postgresql 9.4 jsonb type
* no warranties or guarantees of any kind are implied or offered
*
* license is as Matheus conferred it on 4/9/2015:
* matheusoliveira commented on Apr 9
* @hannes-landeholm, I'd like to take credit if you share them
@GeneralFlint
GeneralFlint / json_manipulator.sql
Created October 2, 2023 14:49 — forked from matheusoliveira/json_manipulator.sql
Simple PostgreSQL functions to manipulate json objects. (Note: performance is not a concern for those functions)
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
@GeneralFlint
GeneralFlint / LICENSE.txt
Created October 2, 2023 08:19 — forked from Sumbera/LICENSE.txt
Many Polygons with geojson-vt on Leaflet
Licensed under MIT
Copyright (c) 2015 Stanislav Sumbera,
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.