Skip to content

Instantly share code, notes, and snippets.

View GieltjE's full-sized avatar

Michiel Hazelhof GieltjE

View GitHub Profile
@GieltjE
GieltjE / PostgreSQL2MySQL.cs
Created March 2, 2021 16:51
DSMR Reader PostgreSQL2MySQL
public static async void DownloadData()
{
await using NpgsqlConnection conn = new("Host=192.168.199.203;Username=dsmrreader;Password=dsmrreader;Database=dsmrreader");
await conn.OpenAsync();
File.Delete("result.sql");
File.WriteAllText("result.sql", "SET FOREIGN_KEY_CHECKS=0;\r\n");
List<String> tablesFound = new();
using NpgsqlCommand cmd = new("select table_name from information_schema.tables where table_type = 'BASE TABLE' AND table_schema = 'public'", conn);
@GieltjE
GieltjE / Badge.cs
Last active August 2, 2020 12:23
C# connector for the Campzone 2019 and 2020 Badge (should be adaptable to other badge.team badges)
using System;
using System.Globalization;
using System.Text;
using System.Threading;
using SerialPortLib;
namespace CZ_Badges
{
/// <summary>
/// Sample code to make it easier to use the CZ2020 badge as programmatic input, also adds the ability to talk to the CZ2019 badge, should work under Linux too