Skip to content

Instantly share code, notes, and snippets.


Darren Reid Layoric

View GitHub Profile
lahma / npgsql.cs
Last active Oct 26, 2018
Npgsql 3.0 with Quartz.NET 2.x - programmatic provider registration
View npgsql.cs
// reference Npgsql NuGet package v3 in project
using Npgsql;
using NpgsqlTypes;
// register provider with name Npgsql-30, Quartz V3 has this OOTB
// could also just do a assembly binding redirect
DbProvider.RegisterDbMetadata("Npgsql-30", new DbMetadata
Layoric / main.cs
Last active Sep 1, 2016
Auto mapping
View main.cs
using System;
using ServiceStack;
using ServiceStack.Text;
public class GetPersonResponse
public string FirstName { get;set; }
public string LastName { get;set; }
public int Age { get;set; }
Layoric /
Last active Sep 1, 2016
Auto mapping

Auto mapping

Auto mapping it a helpful utility in ServiceStack that allows you to easy populate different classes with the same structure allowing you to keep appropriate separations whilst reducing lines of code.

For example, it's common in ServiceStack to keep your request and response DTO classes separate from others like your OrmLite model classes or other logic classes even thought they might share the same structure.

public class GetPersonResponse
    public string FirstName { get;set; }
hitsujiwool / docker.json
Created Sep 15, 2015
docker + docker-compose on Amazon Linux
View docker.json
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}"
"builders": [
"type": "amazon-ebs",
"ssh_pty": true,
"access_key": "{{user `aws_access_key`}}",
igrigorik /
Last active Jun 14, 2016
Mechanism to communicate server timing data to the client (Server Timing)

Navigation and Resource Timing provides timing data for the fetch, but currently there is no interoperable way for the server to communicate own timing information to the client. For example:

  • What steps were taken to generate the resource, and how long each took. Many sites already embed this type of information via HTML comments - e.g. wordpress emits <!--Page generated in X.X seconds.--> , and many sites provide more detailed stats (cache, db, generation) to enable performance debugging.
  • If proxied, where was the time spent - e.g. time to fetch from origin, time to process response, etc.

Instead of relying on arbitrary HTML comments, we can define an HTTP header that can be used to send key-value pairs in a well defined format. Making this data available via a well defined interface would...

  • Allow UA and other developer tools to automatically annotate appropriate timelines.
  • Allow analytics vendors to gather this data for operational analysis.
  • Allows proxies and CDNs to append custom timing d
davidfowl /
Last active Oct 27, 2020
.NET project structure
ReedD /
Last active Mar 16, 2020
User data for EC2 to set up Docker and Compose (Fig) for ec2-user
export PATH=/usr/local/bin:$PATH;
yum update
yum install docker -y
service docker start
# Docker login notes:
# - For no email, just put one blank space.
# - Also the private repo protocol and version are needed for docker
# to properly setup the .dockercfg file to work with compose
You can’t perform that action at this time.