Skip to content

Instantly share code, notes, and snippets.

View makomweb's full-sized avatar
🌀

Martin Komischke makomweb

🌀
View GitHub Profile
@makomweb
makomweb / conversion.cs
Created April 15, 2022 16:04
Empty string or null to FALSE conversion
using Newtonsoft.Json;
using NUnit.Framework;
using System;
namespace JSON_empty_string_or_null_to_false_conversion
{
public class MyDocument
{
public bool MyFlag { get; set; }
@makomweb
makomweb / example.cs
Created February 15, 2022 07:47
Response to "Broken iterator example in C# from Entwickler Magazin 1 / 2022"
namespace Sandbox
{
public class MyTests
{
[Test]
public async Task Run_me()
{
var numbers = new List<int> { 1, 2, 3, 5, 8 };
var sum = SumAsync(numbers);
@makomweb
makomweb / CollectionAssertTests.php
Created January 28, 2022 11:45
PHP collection assert
<?php
declare(strict_types=1);
namespace App\Tests\Unit;
use LogicException;
use PHPUnit\Framework\TestCase;
class MyClass {}
@makomweb
makomweb / readme.md
Created January 14, 2022 10:04
download+install dotnet SDK
@makomweb
makomweb / batch_resize.py
Created September 19, 2018 09:28
Python script for batch resizing images and keeping the aspect ratio
from PIL import Image
import os, sys
path = "c:\\Workspace\Images"
dirs = os.listdir( path )
mywidth = 640
def resize_keep_aspect_ration():
for item in dirs:
img_path = path + "\\" + item
@makomweb
makomweb / php_dynamic.php
Last active April 20, 2021 12:28
PHP equivalent to C# dynamic
<?php
class dynamic {
private $data;
public function __construct($data) {
$this->data = $data;
}
public function __call($method, $arguments) {
@makomweb
makomweb / cleanup.sh
Created March 23, 2021 13:31
Cleanup files which should be ignored in VCS
# update .gitignore properly
# after that:
git rm -rf --cached .
git add .
@makomweb
makomweb / fix-author-committer.sh
Created January 19, 2021 15:02
Change committer and author of all commits in a repo
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='__AUTHOR_NAME__'
GIT_AUTHOR_EMAIL='__AUTHOR_EMAIL_ADDRESS__'
GIT_COMMITTER_NAME='__COMMITTER_NAME__'
GIT_COMMITTER_EMAIL='__COMMITTER_EMAIL_ADDRESS__'
" HEAD
@makomweb
makomweb / rx_playground.cs
Last active December 17, 2020 10:09
Rx playground. Create a new Rx operator which can be used for processing data. It is parametrizable with a scheduler.
using System;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading.Tasks;
using FluentAssertions;
using NUnit.Framework;
namespace Tests
{
@makomweb
makomweb / notes-technology-lunch-innoq.md
Last active November 5, 2020 09:26
Meine Notizen vom Technology Lunch "Softwarearchitektur für Entscheider" (gehalten von Stefan Tilkov)

Mitschrift: Technology Lunch - INNOQ - Softwarearchitektur für Entscheider

Youtube: Software-Architektur für Entscheider – INNOQ Technology Lunch

Was ist Software-Architektur? (2 Beispieldefinitionen)

Die Komponenten eines Systems, ihre Beziehungen zueinander sowie die Prinzipien und Regeln, denen ihre (Weiter-)Entwicklung folgt. (ISO 42010)

Die Summe der bedeutenden Design-Entscheidungen, die das System formen, wobei >>bedeutend<< anhand der Änderungskosten gemessen wird. (Grady Booch)