Skip to content

Instantly share code, notes, and snippets.

View practice-exercise-migration.md

We've made some changes to the v3 spec this week, most notably we've defined what the file structure looks like for Practice Exercises. See the spec for more information.

This PR applies changes to the track to conform to the latest spec. Each change is made as a separate commit, to help with reviewing. When merging this PR, I would suggest to not squash this to preserve the individual commits.

As having this PR merged is essential to prepare this track for Exercism v3, we'll automatically merge this PR one week after it was opened (if it hasn't been merged already).

Here are the changes made:

Add practices field to Practice Exercises

@ErikSchierboom
ErikSchierboom / tags.md
Last active Jan 19, 2021
Exercism v3 tags
View tags.md

Paradigm

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

Typing

View docker-compose.yml
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 / results.json
Created May 8, 2020
Generated results.json
View 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 / .gitconfig
Last active Feb 12, 2020
.gitconfig alias to remove gone branches
View .gitconfig
[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"
View Compile-in-memory.cs
// 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 Dec 4, 2019
Force execution in order
View Discoverer.cs
public class TestCaseInDiscoveryOrderOrderer : ITestCaseOrderer
{
public IEnumerable<TTestCase> OrderTestCases<TTestCase>(IEnumerable<TTestCase> testCases) where TTestCase : ITestCase =>
testCases.ToList();
}
@ErikSchierboom
ErikSchierboom / Program.cs
Last active Sep 11, 2020
Inject dependencies into hosted service
View Program.cs
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 Jun 10, 2019
SimpleInjector + ASP.NET Core
View Program.cs
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
Bulk insert MySQL using EF Core
View Program.cs
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