Skip to content

Instantly share code, notes, and snippets.

{
"EventId": 1844225537,
"LogLevel": "Debug",
"Category": "GraphQLAPI.ExecutionEventListener",
"Message": "Executing query: `query GetPersonAndProperties($personId: ID!, $first: Int, $after: String) {\n personViaId(personId: $personId) {\n ... PersonFields\n }\n ejerskaberViaPersonId(personId: $personId, first: $first, after: $after) {\n ... PersonEjerskabFields\n }\n}\n\nfragment PageInfoFields on PageInfo {\n __typename\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n}\n\nfragment EjerEjerskabEjendomFields on Ejendom {\n __typename\n id\n status\n bfeNummer\n ... on SamletFastEjendom {\n enheder {\n ... EnhederFields\n }\n bygninger {\n ... BygningerFields\n }\n grunde {\n ... GrundFields\n }\n }\n ... on BygningPaaFremmedGrund {\n enheder {\n ... EnhederFields\n }\n bygninger {\n ... BygningerFields\n }\n }\n ... on Ejerlejlighed {\n enheder {\n ... EnhederFields\n }\n }\n}\n\nfragment GrundFields
@hroi
hroi / config.toml
Created September 24, 2023 18:19
Some vim movements in Helix
[keys.normal]
# VIMisms:
# same as "]p"
"}" = "goto_next_paragraph"
# same as "[p"
"{" = "goto_prev_paragraph"
# same as "gh"
"0" = "goto_line_start"
# same as "gs"
"^" = "goto_first_nonwhitespace"
@hroi
hroi / playground.rs
Created July 2, 2019 20:28 — forked from rust-play/playground.rs
Code shared from the Rust Playground
pub struct Sentences<'a> {
pub inner: &'a str,
}
pub fn sentences(input: &str) -> Sentences {
Sentences { inner: input }
}
const TOK_WHITESPACE: u32 = 1;
const TOK_PERIOD: u32 = 1 << 1;
const TOK_UPPERCASE: u32 = 1 << 2;
@hroi
hroi / markup.pest
Last active February 17, 2019 00:38
Document = { SOI ~ (WHITE_SPACE+ | instr_doctype | Text | Element )+ ~ EOI }
Text = { (!(WHITE_SPACE* ~ "<" | ">") ~ ANY)+ }
Comment = { (!(WHITE_SPACE* ~ "-->") ~ ANY)+ }
Element = {
WHITE_SPACE* ~
(
tag_comment |
tag_void |
tag_open ~ WHITE_SPACE* ~ (Element | Text | WHITE_SPACE+)* ~ tag_close |
create table apples (
apple_id int not null generated by default as identity primary key,
apple_name text not null
);
create table oranges (
orange_id int not null generated by default as identity primary key,
orange_name text not null
);
-- Computus
-- Easter in the Gregorian calendar
-- Copied from https://docs.rs/computus/1.0.0/src/computus/lib.rs.html
CREATE OR REPLACE FUNCTION computus_gregorian(_year INTEGER)
RETURNS DATE AS $$
DECLARE
AA INTEGER;
BB INTEGER;
CC INTEGER;
snmptable:
SNMP table: CISCO-ENTITY-SENSOR-MIB::entSensorThresholdTable
index entSensorThresholdSeverity entSensorThresholdRelation entSensorThresholdValue entSensorThresholdEvaluation entSensorThresholdNotificationEnable
1063.1 major greaterOrEqual 900 false false
1063.2 minor greaterOrEqual 850 false false
1063.3 minor lessOrEqual -50 false false
1063.4 major lessOrEqual -100 false false
SNMP table: CISCO-ENTITY-SENSOR-MIB::entSensorValueTable
@hroi
hroi / rawvec.rs
Last active January 9, 2017 23:21
pub struct RawVec<T> {
mem: *mut T,
cap: usize,
}
impl<T> RawVec<T> {
pub fn with_capacity(cap: usize) -> RawVec<T> {
let mut vec = Vec::<T>::with_capacity(cap);
let ptr = vec.as_mut_ptr();
mem::forget(vec);
CREATE TABLE snmp.ifDescr (
device_id BIGINT NOT NULL REFERENCES devices,
ifIndex BIGINT NOT NULL,
ifDescr TEXT,
valid TSTZRANGE NOT NULL DEFAULT tstzrange(now(), 'infinity', '[)'),
EXCLUDE USING GIST (device_id WITH =, ifIndex WITH =, valid WITH &&),
EXCLUDE USING GIST (device_id WITH =, ifDescr WITH =, valid WITH &&)
);
CREATE OR REPLACE FUNCTION set_ifdescr(xdevice_id bigint, xifIndex bigint, xifDescr text)
mod parallel {
use std::{sync, thread};
use std::sync::atomic::Ordering::Relaxed;
pub fn run<F, I, O>(jobs: Vec<I>, num_workers: usize, f: F) -> Vec<O>
where F: Fn(usize, &I) -> O,
F: Send + Sync + 'static,
I: Send + Sync + 'static,
O: Send + Sync + 'static
{