Skip to content

Instantly share code, notes, and snippets.

View carstencodes's full-sized avatar
🖤
Head in the clouds, heart dropped to the gut ...

Carsten Igel carstencodes

🖤
Head in the clouds, heart dropped to the gut ...
View GitHub Profile
@carstencodes
carstencodes / sql2csv.py
Created January 2, 2021 18:34
Convert SQL to CSV using python
#!/usr/bin/env python
# This script assumes, that each line is either a complete SQL INSERT statement or not interesting (CREATE, ALTER, comment)
# This script is published under MIT License
# Copyright 2021 Carsten Igel
#
# 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.
@carstencodes
carstencodes / Program.cs
Created May 4, 2021 13:29
Example for an erroneous run for the command line parser
using System;
using System.Collections.Generic;
using CommandLine;
namespace calc
{
[Verb("fib")]
internal sealed class FibonacciOption
{
[Value(0, Required = true, MetaName = "position of the fibonacci number to calculate" )]
@carstencodes
carstencodes / .gitlab-ci.yml
Last active September 11, 2023 09:47
PDM (the Python Development Master) based approach to automatically update your dependencies in pdm.lock
# Instructions for gitlab are yet to come.
@carstencodes
carstencodes / tagged_union.py
Created January 7, 2024 11:57
How to build Tagged Unions with Python
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 Carsten Igel.
#
# 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