I hereby claim:
- I am ericsampson on github.
- I am erics (https://keybase.io/erics) on keybase.
- I have a public key whose fingerprint is 4E22 3DE1 A252 4DFC 31CD B662 E652 4404 2438 7DCF
To claim this, I am signing this object:
--This script MUST be named "Switch to <User>.scpt", where <User> is the name of the user to switch to. | |
--You must first make a password item (a.k.a. a key) for the other user's password using Keychain Access, | |
--and call it "<user>", where "<user>" is the other user's name.the field "Kind" must be "User Login" (without quotes). | |
--The script assumes that you make this key in your login.keychain, which is the default one. | |
--The first time you run this script, you will be prompted to allow Keychain Scripting to access the password of the key. | |
--This script requires "Enable access for assistive devices" to be enabled in the Universal Access system preference pane. | |
set username to word -1 of my findReplace(".scpt", "", (path to me as text)) | |
-- Invoke Fast User Switching. The `id -ur username` part gets the uid number that corresponds to the username and substitutes it at the end of the CGSession command |
I hereby claim:
To claim this, I am signing this object:
Rec a = new Rec{myInt = 1, myStr = "test"}; | |
Rec b = a; | |
System.Console.WriteLine(a == b); | |
public record Rec() | |
{ | |
public int myInt; | |
public string myStr; | |
// I have a service that needs to be initialized with a FooOptions and then added to the DI container. | |
// I also want to have IOptions<FooOptions> in the DI container to allow injection in other methods. | |
// How should I write my AddFoo extension method to support this? | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddFoo(fooOptions => | |
{ | |
configuration.GetSection("FooOptions").Bind(fooOptions) | |
fooOptions.param = "override"; |
using System; using System.Net; using System.IO; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using System.Linq; | |
using Refit; | |
const string showList = "https://syntax.fm/api"; | |
static async Task<List<Show>> getShowList() { | |
var syntaxApi = RestService.For<ISyntaxApi>(showList); |
How to create NuGet packages that include multiple DLLs: | |
https://josef.codes/dotnet-pack-include-referenced-projects/ |
C# vNext language feature implementation status | |
https://github.com/dotnet/roslyn/blob/main/docs/Language%20Feature%20Status.md | |
C# vNext Working Themes | |
https://github.com/dotnet/csharplang/issues/4144 | |
RequiredProperties | |
https://github.com/dotnet/csharplang/issues/3630 |
ConfigurationBinderTests.cs contains a definitive list of the C# types that ConfigurationBinder can work with
(numerics, bool, enums, DateTime, TimeSpan, GUID, URI, plus collections)
This page is also a useful reference: https://andrewlock.net/how-to-use-the-ioptions-pattern-for-configuration-in-asp-net-core-rc2/
1) Viewing only main/master "linear commit history" as if you'd done squash merges, while actually using merge commits in order to maintain feature branch commit history: | |
https://stackoverflow.com/questions/60796729/keep-commits-in-feature-branch-after-squash-merge-to-master | |
https://marcgg.com/blog/2015/08/04/git-first-parent-log/ | |
2) Ignoring local changes to file: | |
git update-index --skip-worktree $FILE |
using System; | |
using System.Collections.Generic; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Options; | |
using Microsoft.Extensions.DependencyInjection; | |
var config = new ConfigurationBuilder() | |
.AddInMemoryCollection(new Dictionary<string, string>() { { "Param", "yay!" } }) | |
.Build(); |