Skip to content

Instantly share code, notes, and snippets.

View PureKrome's full-sized avatar
💭
🦘🕺🏻🎶🕹

Justin Adler PureKrome

💭
🦘🕺🏻🎶🕹
View GitHub Profile
@PureKrome
PureKrome / ToyRobot.md
Last active March 10, 2016 05:15
Toy Robot Simulator Instructions

Toy Robot Simulator Instructions

Description:

  • The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.
  • There are no other obstructions on the table surface.
  • The robot is free to roam around the surface of the table, but must be prevented from falling to destruction. Any movement that would result in the robot falling from the table must be prevented, however further valid movement
@PureKrome
PureKrome / gist:8aa486b0440d4147ccc3
Created February 15, 2016 04:10
Async awaity stuff with Azure queues - props to Ben Adams for the answer
private ConcurrentQueue<Message> _queue = new ConcurrentQueue<Message>();
private SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
public async Task DoTheThing()
{
var tasks = new Task[20];
for (var i = 0; i < tasks.Length; i++)
{
tasks[i] = UploadMessages();
}
@PureKrome
PureKrome / appveyor-build-info.ps
Last active August 6, 2016 13:46
AppVeyor build information
$isPr = "No";
if ($env:APPVEYOR_PULL_REQUEST_NUMBER)
{
$isPr = "Yes = PR #: $env:APPVEYOR_PULL_REQUEST_NUMBER"
}
$isTag = "No";
if ($env:APPVEYOR_REPO_TAG -eq $TRUE)
{
$isTag = "Yes = Tag: $env:APPVEYOR_REPO_TAG_NAME"
@PureKrome
PureKrome / gist:be8967ebc2bc43ac8154
Last active August 29, 2015 14:23
Load testing Redis servers via IIS
using System;
using System.Configuration;
using System.Text;
using System.Threading;
using System.Web.Mvc;
using StackExchange.Redis;
namespace WebApplication2.Controllers
{
public class HomeController : Controller
@PureKrome
PureKrome / gist:61f54b3061fccdfd4c61
Created May 5, 2015 11:43
Class is persisted without the $type property
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Raven.Client.Document;
namespace ConsoleApplication5
{
class Program
@PureKrome
PureKrome / gist:df7b5bdd6582cd99a98a
Created May 5, 2015 11:40
Class is persisted with a $type property.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Raven.Client.Document;
namespace ConsoleApplication5
{
class Program
@PureKrome
PureKrome / gist:d5c5797850f522e15a65
Created March 30, 2015 11:50
How to test abstract classes with FluentValidation?
// How can I create a CatValidator and EagleValidator that both use (inherit) an AnimalValidator?
public abstract class Animal
{
public string Name { get; set; }
}
public class Cat : Animal
{
@PureKrome
PureKrome / error.cs
Created March 13, 2015 10:26
Inconsistent Nancy testing when deserializing some json response.
using System.Collections.Generic;
using System.Linq;
using Nancy;
using Nancy.Testing;
using Newtonsoft.Json;
using Shouldly;
using Xunit;
namespace ConsoleApplication4
{
@PureKrome
PureKrome / gist:ba3a519d807e5103243c
Last active August 29, 2015 14:14
Why is TinyIoC is disposing of this instance?
/*
install-package raven.database
install-package xunit
install-package nancy.testing
install-package shouldly
install-package nbuilder
*/
using System;
using System.Collections.Generic;
@PureKrome
PureKrome / RavenDbCeremonyComparison.cs
Created February 4, 2015 01:28
Ceremony Comparison between two ways of writing RavenDb tests.
using System.Collections;
using System.Linq;
using System.Threading.Tasks;
using FizzWare.NBuilder;
using Raven.Client.Document;
using Raven.Client.Embedded;
using Raven.Client.Indexes;
using Shouldly;
using WorldDomination.Raven.Tests.Helpers;
using Xunit;