Skip to content

Instantly share code, notes, and snippets.

View Alxandr's full-sized avatar
⁉️
⁉️

Aleksander Heintz Alxandr

⁉️
⁉️
View GitHub Profile
-- for posterity
with worst as (
select era.to_party, count(*) as sub_unit_count
from register.external_role_assignment era
where era."source" = 'ccr'
and (era.identifier = 'ikke-naeringsdrivende-hovedenhet' OR era.identifier = 'hovedenhet')
group by era.to_party
)
select p.uuid, p."organization_identifier", p.id, w.sub_unit_count
from worst w
I (24) boot: chip revision: v0.1
I (27) boot.esp32c6: SPI Speed : 40MHz
I (32) boot.esp32c6: SPI Mode : DIO
I (36) boot.esp32c6: SPI Flash Size : 4MB
I (41) boot: Enabling RNG early entropy source...
I (47) boot: Partition Table:
I (50) boot: ## Label Usage Type ST Offset Length
I (57) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (72) boot: 2 factory factory app 00 00 00010000 003f0000
@Alxandr
Alxandr / flake.nix
Last active May 25, 2025 18:06
Flake for building esp32 stuffs
{
description = "A very basic flake";
nixConfig = {
extra-substituters = [ "https://om.cachix.org" ];
extra-trusted-public-keys = [ "om.cachix.org-1:ifal/RLZJKN4sbpScyPGqJ2+appCslzu7ZZF/C01f2Q=" ];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
-- include: party,person,org,org.subunits,user
-- filter: party-id,party-uuid,person-identifier,organization-identifier,user-id,multiple
WITH uuids_by_party_uuid AS (
SELECT party."uuid", party.version_id
FROM register.party AS party
WHERE party."uuid" = ANY (@partyUuids)
),
uuids_by_party_id AS (
SELECT party."uuid", party.version_id
with uuids_by_party_id as (
select p."uuid"
from register.party p
where p.id = any (:partyids)
), uuids_by_user_id as (
select u."uuid"
from register."user" u
where u.user_id = any (:userids)
), uuids as (
select "uuid"
public record Root
: IValidatableModel
{
public Child? Child { get; init; }
public List<Child>? Children { get; init; }
public void Validate(ref ValidationContext context)
{
context.Validate(Child, "child");
public enum VariantType
{
LeftChild,
RightChild1,
RightChild2,
RightGrandChild,
}
[PolymorphicFieldValueRecord]
[PolymorphicDerivedType(typeof(LeftChild), VariantType.LeftChild)]
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 7 columns, instead of 6 in line 7.
"id","type","cmd_id","source","identifier","from_party","to_party"
1881277,added,"0195fb3d-2fd2-70c5-bf9a-3f368e0b24c8",ccr,regnskapsforer,"69c5594b-11bb-4ebf-b89d-125d7a7f338e","6005794a-cae2-4fa4-9072-474564670727"
1881276,added,"0195fb3d-2fd2-70c5-bf9a-3f368e0b24c8",ccr,revisor,"69c5594b-11bb-4ebf-b89d-125d7a7f338e",e35b21a6-6cec-4e7b-9b1f-76c89a2485c9
1881275,added,"0195fb3d-2fd2-70c5-bf9a-3f368e0b24c8",ccr,innehaver,"69c5594b-11bb-4ebf-b89d-125d7a7f338e",e2564ede-a4d2-4ce0-bad1-579797437c69
1881274,added,"0195fb29-038b-7d16-9071-903b088c947e",ccr,ikke-naeringsdrivende-hovedenhet,a40f5845-268c-442b-9e37-8f6ad2052536,"4c870238-392d-419a-83f9-b3dd2e2d8ddf"
1881273,added,"0195fb29-037d-77bd-8025-d70ca9202903",ccr,bostyrer,"4c870238-392d-419a-83f9-b3dd2e2d8ddf","9097a8ad-10be-4513-a2a2-c90d8d7735ea"
1881272,added,"0195fb06-2cd6-7557-9ea6-ee01086de7b6",ccr,styreleder,"465773b3-ac4d-41d5-bb8a-89c7dab906b0","60cb93ed-7426-44d3-80dc-1b056aab337e"
1881241,added,"0195fae5-50ad-716c-a5bc-1f5908e0a8a6",ccr,innehaver,
// See https://aka.ms/new-console-template for more information
using MassTransit;
using MassTransit.Testing;
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics;
namespace MTTest;
public class Program
{
@Alxandr
Alxandr / many.csv
Last active March 27, 2025 12:45
customers
to_party identifier count
c27c7679-779e-4d79-a1dd-dccf2fe80f3e revisor 33366
27229997-f13d-4f25-9416-748695fb8e22 revisor 24042
859a5136-ddc8-4f07-9dec-a6312e2907cf revisor 21970
e6e344c8-9c02-4d16-bd95-4f5e61bec26a revisor 19260
6bcc8f8b-8ed8-4f04-8088-3f15bdb8e269 regnskapsforer 13757
f15906fc-3d51-4d2f-b118-d8f412e99cda revisor 13534
687c8b07-b463-41bb-b8b8-4981e41aaa76 revisor 11983
9a7d9661-b069-4897-9c23-8bf062809859 revisor 6215
226a99de-4096-4727-ad17-d67a0d5eece8 regnskapsforer 6014