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 / .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 / 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 / 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 / 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 / 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
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 / 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 =
source https://www.nuget.org/api/v2
nuget FSharp.Data
nuget xplot.googlecharts
@ErikSchierboom
ErikSchierboom / app.html
Created October 7, 2016 13:41 — forked from ZoolWay/app.html
Aurelia Child
<template>
<h1>${message}</h1>
<div>Div Content</div>
</template>
@ErikSchierboom
ErikSchierboom / index.html
Created April 12, 2015 10:37
Knockout pre-rendered: init // source http://jsbin.com/wikaji
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Knockout pre-rendered: init</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-debug.js"></script>
<script src="https://rawgit.com/ErikSchierboom/knockout-pre-rendered/master/dist/knockout-pre-rendered.js" type="text/javascript"></script>
<style id="jsbin-css">
pre {
white-space: pre-wrap; /* css-3 */