This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ValueObject | |
{ | |
protected abstract IEnumerable<object> GetEqualityComponents(); | |
public override bool Equals(object? other) | |
{ | |
if (other is null || other.GetType() != GetType()) | |
{ | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override int GetHashCode() | |
{ | |
unchecked | |
{ | |
int hash = 17; | |
hash = hash * 31 + firstField.GetHashCode(); | |
hash = hash * 31 + secondField.GetHashCode(); | |
return hash; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Nuget packages: Serilog, Serilog.AspNetCore, Serilog.Sinks.Console, Serilog.Sinks.File | |
*/ | |
{ | |
"Serilog": { | |
"Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File"], | |
"MinimumLevel": { | |
"Default": "Information", | |
"Override": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. Make sure you have the Transparency Effects enabled in Windows. | |
2. Make sure you're not running on the battery saver mode. | |
From https://zimmergren.net/enable-transparent-background-in-windows-terminal/ | |
*/ | |
// Open settings.json (ctrl+,) | |
// cropped... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Reflection; | |
[Serializable] | |
[DebuggerDisplay("{DisplayName} - {Value}")] | |
public abstract class Enumeration<TEnumeration, TValue> : IComparable<TEnumeration>, IEquatable<TEnumeration> | |
where TEnumeration : Enumeration<TEnumeration, TValue> | |
where TValue : IComparable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Bootstrap Card</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="style.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Debian, RedHat | |
# https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers | |
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.Windows.Forms; | |
namespace Example | |
{ | |
public partial class MyForm : Form | |
{ | |
private Image _image; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc.ModelBinding; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public static class ModelStateExtensions | |
{ | |
/// <summary> | |
/// Extracts error keys and error messages of all model fields |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://stackoverflow.com/a/31643591/1211622 | |
*/ | |
function arrayMax(array) { | |
return array.reduce((a, b) => Math.max(a, b)); | |
} | |
function arrayMin(array) { | |
return array.reduce((a, b) => Math.min(a, b)); |