Skip to content

Instantly share code, notes, and snippets.

View victorvogelpoel's full-sized avatar
💭
NL

Victor Vogelpoel victorvogelpoel

💭
NL
View GitHub Profile
@cezarypiatek
cezarypiatek / .editorconfig
Last active February 14, 2023 21:48
This snippet set severity level to error for different rules related to the reference nullability
[*.cs]
# CS8603: Possible null reference return.
dotnet_diagnostic.CS8603.severity = error
# CS8604: Possible null reference argument.
dotnet_diagnostic.CS8604.severity = error
# CS8606: Possible null reference assignment to iteration variable
dotnet_diagnostic.CS8606.severity = error
# CS8600: Converting null literal or possible null value to non-nullable type.
dotnet_diagnostic.CS8600.severity = error
# CS8602: Dereference of a possibly null reference.
@stettix
stettix / things-i-believe.md
Last active March 20, 2024 17:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@pcgeek86
pcgeek86 / cheatsheet.ps1
Last active May 3, 2024 23:48
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
public class EncryptingJsonConverter : JsonConverter {
private readonly byte[] _encryptionKeyBytes;
public EncryptingJsonConverter(string encryptionKey) {
if (encryptionKey == null) {
throw new ArgumentNullException(nameof(encryptionKey));
}
// Hash the key to ensure it is exactly 256 bits long, as required by AES-256
using (var sha = new SHA256Managed()) {
@jazzdelightsme
jazzdelightsme / ResourceEmitter.cs
Created December 30, 2016 07:39
C# code that can emit a .res file with native version info (VS_FIXEDFILEINFO et al)
// This class is used to generate a compiled win32 resource (.res) file containing version
// information for use during compilation. (it's sort of a substitute for rc.exe and a .rc
// file)
static class ResourceEmitter
{
/// <summary>
/// Similar to the Version class, but uses ushorts instead of ints (because the
/// full version needs to be able to fit into 64 bits).
/// </summary>
public class ResourceVersion : IComparable< ResourceVersion >,

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@Tiberriver256
Tiberriver256 / Get-OrgChart.ps1
Created August 21, 2016 03:32
Get-OrgChart
function Get-ADdirectReports
{
PARAM ($SamAccountName)
$AllUsers = @()
$Manager = Get-Aduser -identity $SamAccountName -Properties DistinguishedName,CN,co,city,DisplayName,mail
$DirectReports = Get-ADUser -Filter {Manager -eq $Manager.DistinguishedName} -Properties manager
Function Out-JSONView {
[cmdletbinding()]
Param (
[parameter(ValueFromPipeline)]
[psobject]$InbutObject,
[int]$Depth = 2