Skip to content

Instantly share code, notes, and snippets.

View rido-min's full-sized avatar
💭
coding

Rido rido-min

💭
coding
View GitHub Profile

JSON-CS (Compact Schema)

C. Vasters (Microsoft) November 2024

Abstract

This document specifies JSON-CS (Compact Schema), a schema language for JSON data that enforces strict typing, modularity, and determinism. JSON-CS provides a clear and self-contained approach to defining JSON data structures, requiring explicit type declarations and reusable, hierarchical type definitions. It

@rido-min
rido-min / clean-lockfile.sh
Created November 28, 2024 00:21
clean-lock-file.sh
cp package-lock.json package-lock.json.bak
jq 'walk(if type == "object" and .link != true then del(.resolved, .integrity) else . end)' package-lock.json.bak > package-lock.json
rm package-lock.json.bak
@rido-min
rido-min / .gitignore
Last active November 21, 2024 06:34
minimal-bot
node_modules/
dist/
.env
.npmrc
package-lock.json
@rido-min
rido-min / dotnetlayout.md
Created November 4, 2024 15:12 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@rido-min
rido-min / SchemaRegistryFlows.md
Last active May 16, 2024 00:06
SchemaRegistryFlows

Schema Registration Diagrams

No versioning

sequenceDiagram;
    participant Connector
    participant SREdge
    participant SRCloud
@rido-min
rido-min / SslStreamCustomCA.cs
Created October 24, 2023 15:29
SslStreamCustomCA
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
string host = "test.mosquitto.org";
int port = 8883;
using Socket socket = new(SocketType.Stream, ProtocolType.Tcp);
socket.Connect(host, port);
using NetworkStream stream = new(socket);
@rido-min
rido-min / LICENSE
Created June 4, 2023 18:57 — forked from chrislawlor/LICENSE
Multicast delegates in Python. Uses operator overloading for subscription, C# style.
Copyright 2020 Christopher Lawlor
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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O
@rido-min
rido-min / Command.cs
Created February 10, 2023 01:48
IoTHubCommands
using Microsoft.Azure.Devices;
using System.Text.Json;
namespace SampleDtdlCmd
{
public class Command<TReq, TResp>
{
string _cs;
string _did;
string _name;
@rido-min
rido-min / admin-user.yaml
Last active June 16, 2022 21:52
k8-dashboard
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@rido-min
rido-min / ComputeDeviceKey.cs
Last active June 3, 2022 02:51
ComputeDeviceKey
internal static string ComputeDeviceKey(string masterKey, string deviceId) =>
Convert.ToBase64String(new System.Security.Cryptography.HMACSHA256(Convert.FromBase64String(masterKey)).ComputeHash(System.Text.Encoding.UTF8.GetBytes(deviceId)));