Skip to content

Instantly share code, notes, and snippets.

View amis92's full-sized avatar

Amadeusz Sadowski amis92

View GitHub Profile
@HaloFour
HaloFour / Test.cs
Last active March 31, 2020 17:32
Test inheritance with struct builders
/*
public record class Person {
public required int ID { get; init; }
public string FirstName { get; init; }
public string LastName { get; init; }
Person {
if (ID < 0) throw new ArgumentOutOfRangeException(nameof(ID));
}
}
@natemcmaster
natemcmaster / README.md
Last active April 2, 2024 18:27
runtimeconfig.json schema

This defines the schema for .NET Core's runtimeconfig.json file.

Usage in an editor

Using Visual Studio, you can get auto-completion if you import the schema in your .JSON file like this:

{
  "$schema": "https://gist.githubusercontent.com/natemcmaster/0bdee16450f8ec1823f2c11af880ceeb/raw/runtimeconfig.template.schema.json"
}
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@dkittell
dkittell / PictureRename.ps1
Last active May 10, 2024 15:57
PowerShell – Rename Pictures to Image Taken Date/Time with Dimensions
<#
.SYNOPSIS
Renames pictures.
.DESCRIPTION
The Rename-Pictures cmdlet to rename pictures to a format where the file creation time is first
in the name in this format: . The idea is that
.PARAMETER Path
Specifies the path to the folder where image files are located. Default is current location (Get-Location).
@DanDiplo
DanDiplo / JS-LINQ.js
Last active May 20, 2024 10:30
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Reflection;
namespace FindConflictingReference
{
public class Reference
{
public AssemblyName Assembly { get; set; }
using System;
using Xamarin.Forms;
namespace Luax.Xaml.AttachedBehaviours.Blog
{
public class ClickBehavior
{
#region ClickedProperty
public static readonly BindableProperty ClickedProperty = BindableProperty.CreateAttached<ClickBehaviour, Command>(
bindable => ClickBehavior.GetClicked(bindable),
@brianlow
brianlow / FindConflictingReferences.cs
Created January 3, 2012 03:04
Find conflicting assembly references
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MyProject
{
[TestFixture]