Skip to content

Instantly share code, notes, and snippets.

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

Justin Adler PureKrome

💭
🦘🕺🏻🎶🕹
View GitHub Profile
@PureKrome
PureKrome / gist:f022793f08339e290390
Created January 31, 2015 03:37
Testing Id creation with sync/async code in RavenDb.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;
using Raven.Tests.Helpers;
using Xunit;
namespace ClassLibrary1
@PureKrome
PureKrome / gist:4848119b4639ee4aab12
Last active August 29, 2015 14:13
Why are the two keys in this RavenDb collection, continuous?
public class FakeModel
{
public string Id { get; set; }
public int Age { get; set; }
public string Name { get; set; }
public DateTime CreatedOn { get; set; }
}
----
@PureKrome
PureKrome / NuGetPackageAndPublish.ps1
Last active September 1, 2023 09:33
Powershell NuGet publish script
############################################################################
### ###
### NUGET PACKAGE and PUBLISH ###
### ###
############################################################################
param (
@PureKrome
PureKrome / PKs Menu and Command Bar Settings.vssettings
Created December 9, 2014 23:19
Awesome Visual Studio 2013 Menu and Command Bar settings
<UserSettings>
<ApplicationIdentity version="12.0" /><ToolsOptions />
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_CommandBars" Category="{B9D9C123-B500-4202-B887-57C829CBD08F}"
Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_CommandBars"
PackageName="Visual Studio Environment Package">
<CommandBars Version="05072811">
<DefaultCustomizations>
<remove_group Group="{D309F791-903F-11D0-9EFC-00A0C911004F}:00000133" GroupPri="01000000"
Menu="{D309F791-903F-11D0-9EFC-00A0C911004F}:00000082" />
@PureKrome
PureKrome / gist:d2397fa6162c5c9c6516
Created November 20, 2014 00:00
Trying to figure out how to unit test an INancyModule
[Fact]
public void GivenAnAuthenticatedClientAndNoReturnUrl_Process_ReturnsAView()
{
// Arrange.
var nancyModule = A.Fake<INancyModule>();
var view = new ViewRenderer(nancyModule);
var negotiator = new Negotiator(nancyModule.Context);
A.CallTo(() => nancyModule.View[A<object>._]).Returns(negotiator);
var accessToken = new AccessToken
{
@PureKrome
PureKrome / gist:6fd50e45ae278fb5c274
Created November 5, 2014 23:12
An EscapeDataString Test
using System;
namespace EscapeDataStringTest
{
internal class Program
{
private static void Main(string[] args)
{
const string data = "abcde *.(.).";
@PureKrome
PureKrome / pewpew.cs
Created September 24, 2014 06:54
RavenDb Search example where I don't understand the Terms that are generated.
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Indexes;
using Raven.Tests.Helpers;
using Xunit;
@PureKrome
PureKrome / gist:74db6cdf271fdd7dd1fc
Last active December 22, 2016 23:01
HttpClient.Helpers .NET Sample application
using System;
using System.Net.Http;
using System.Threading.Tasks;
using WorldDomination.Net.Http;
namespace HttpClient.Helpers.SampleConsoleApplication
{
public class Program
{
@PureKrome
PureKrome / gist:f03131e8778ced0b8209
Last active August 29, 2015 14:05
Open letter to ASP.NET vNext for a better build file "story"
Preceived Problem
^^^^^^^^^^^^^^^^^
Currently, when we try to deploy an ASP.NET website to a Host Server, it's a tricky and complex set of tasks. It's even more frustrating when this is handled by a Continuous Integration service.
It feels like the full build / package / deploy *lifecycle* is currently a hap-hazard mix of band-aid solutions to try and solve this mission critical problem.
Quote @FrankR:
"Its the whole process of looking at code in your IDE, to compiling, composing components, ILMerge, minification, CSS parsing, Installshielding, web deployment packaging, password/security bundling, test running, switching prod server offline, clearing logged in accounts, copying files, turning server back on, logging. Phew."
@PureKrome
PureKrome / gist:7712e64a690d0960d6e0
Last active August 29, 2015 14:03
Fluent Validation with SetValidator should error when it doesn't.
using FluentValidation;
using FluentValidation.TestHelper;
using Xunit;
namespace FVSetValidatorTest
{
#region Models
public class UnitOfMeasure
{