Skip to content

Instantly share code, notes, and snippets.

Layoric /
Last active Mar 24, 2021 — forked from gistlyn/
Mix Gists

Available Gists


  • console-cs {to:'.'} project,C# C# .NET 5 Console App
  • console-fs {to:'.'} project,F# F# .NET 5 Console App
  • console-vb {to:'.'} project,VB VB .NET 5 Console App
  • console-ss {to:'.'} project,S# #Script Console App
  • console-lisp {to:'.'} project,Lisp #Script Lisp Console App
  • init {to:'.'} project,C# Empty .NET 5 ServiceStack App
Layoric / main.cs
Created Aug 27, 2019
SS enum example
View main.cs
using System.Linq;
using System;
using ServiceStack;
using ServiceStack.Text;
public enum Foo
View XNATextureLoader
/// <summary>
/// Based on
/// </summary>
public class TextureLoader
static TextureLoader()
BlendColorBlendState = new BlendState
ColorDestinationBlend = Blend.Zero,
Layoric / web.config
Last active Apr 22, 2018
IIS web config for .dart files
View web.config
<remove fileExtension=".dart" />
<mimeMap fileExtension=".dart" mimeType="application/dart" />
View fizzbuzz.txt
Create an application that:
1. Loops 100 times
2. Pauses for 200ms each loop
3. Writes 'Fizz' to the console when loop count is divisable by 2
4. Writes 'Buzz' to the console when loop count is divisable by 5
5. Writes 'FizzBuzz' to the console when loop count is divisable by both
Setup project to write a unit test using NUnit, walk through project steps you need to enable this.
Layoric /
Last active Feb 26, 2017
Example solcast-py API usage.
import solcast
# Fetch latest PV power forecast
pv_power_resp = solcast.get_pv_power_forecasts(-35, 149, capacity=2000, tilt=23, azimuth=0, api_key='INSERTYOURAPIKEYHERE')
# Print soonest PV power forecast
Layoric /
Last active Dec 12, 2016 — forked from groovybayo/
Gatling: Step by step guide to IntelliJ integration

Step by step guide to setting up IDEA to write gatling simulations


Have [SBT plugin][sbt-plugin] installed


  • [Create a new project][create-project] in IDEA ( File > New Project ...)
    • Make sure you select a maven module
Layoric / main.cs
Last active Sep 30, 2016
LoadSelect Example
View main.cs
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
public class Foo
Layoric /
Created Sep 13, 2016 — forked from ReedD/
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
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; }