Skip to content

Instantly share code, notes, and snippets.

View ErikSchierboom's full-sized avatar
💭
I only respond on Tuesdays & Fridays

Erik Schierboom ErikSchierboom

💭
I only respond on Tuesdays & Fridays
View GitHub Profile
@ErikSchierboom
ErikSchierboom / ScalaDifficulties.fsx
Created March 3, 2017 07:23
Exercism Scala track with difficulties mapped from F# track
#r "../packages/FSharp.Data.2.3.2/lib/net40/FSharp.Data.dll"
open FSharp.Data
type configJson = JsonProvider<"https://raw.githubusercontent.com/exercism/xscala/master/config.json">
let scalaConfigJson = configJson.Load("https://raw.githubusercontent.com/exercism/xscala/master/config.json")
let fsharpConfigJson = configJson.Load("https://raw.githubusercontent.com/exercism/xfsharp/master/config.json")
let fsharpExerciseDifficulties =
@ErikSchierboom
ErikSchierboom / Program.cs
Created May 3, 2017 08:32
Bulk insert MySQL using EF Core
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace DbBulkPerformance
{
public class Program
{
public class MySqlContext : DbContext
@ErikSchierboom
ErikSchierboom / Program.cs
Created June 10, 2019 10:47
SimpleInjector + ASP.NET Core
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace WebApplication1
{
public class Program
{
public static void Main(string[] args) =>
CreateWebHostBuilder(args).Build().Run();
@ErikSchierboom
ErikSchierboom / Program.cs
Last active September 11, 2020 03:50
Inject dependencies into hosted service
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using WebApiPlayground.Services;
namespace WebApiPlayground
@ErikSchierboom
ErikSchierboom / Discoverer.cs
Created December 4, 2019 15:31
Force execution in order
public class TestCaseInDiscoveryOrderOrderer : ITestCaseOrderer
{
public IEnumerable<TTestCase> OrderTestCases<TTestCase>(IEnumerable<TTestCase> testCases) where TTestCase : ITestCase =>
testCases.ToList();
}
@ErikSchierboom
ErikSchierboom / Compile-in-memory.cs
Last active December 11, 2019 06:47
Compile C# in-memory
// analyzer Git SHA: d236535d1656e5e11c84b25bce8374d40b9d65e0
<Project>
<PropertyGroup>
<OutDir>/Users/erikschierboom/Downloads/temp/bin</OutDir>
<BaseIntermediateOutputPath>/Users/erikschierboom/Downloads/temp/obj</BaseIntermediateOutputPath>
</PropertyGroup>
</Project>
// var xElements = xDocument.XPathSelectElements("//TestRun/Results/UnitTestResult").ToList();
@ErikSchierboom
ErikSchierboom / .gitconfig
Last active February 12, 2020 09:12
.gitconfig alias to remove gone branches
[alias]
co = checkout
ap = !git commit --amend -a --no-edit && git push --force
gone = ! "git fetch -p && for branch in `git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == \"[gone]\" {sub(\"refs/heads/\", \"\", $1); print $1}'`; do git branch -D $branch; done"
@ErikSchierboom
ErikSchierboom / results.json
Created May 8, 2020 13:53
Generated results.json
{
"status": "fail",
"tests": [
{
"name": "Test Using Assert Equal In Expression Body With Expected Int",
"test": "FakeExpressionBodies.Test_Using_Assert_Equal_In_Expression_Body_With_Expected_Int",
"expected": "-5",
"command": "Fake.Invert(5)",
"status": "pass"
},
@ErikSchierboom
ErikSchierboom / docker-compose.yml
Created July 24, 2020 17:22
Exercism v3 website
version: "3.2"
services:
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- ./v3-website/docker/init.sql:/docker-entrypoint-initdb.d/v3-website.sql
redis:
@ErikSchierboom
ErikSchierboom / tags.md
Last active January 19, 2021 13:25
Exercism v3 tags

Paradigm

  • Declarative
  • Functional
  • Imperative
  • Logic
  • Object-oriented
  • Procedural

Typing