Skip to content

Instantly share code, notes, and snippets.

Andrew Stanton-Nurse anurse

Block or report user

Report or block anurse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anurse / GetActiveDNX.ps1
Last active Aug 29, 2015
Get the active DNX and put it on your prompt
View GetActiveDNX.ps1
# If 'dnvm' is present, this code writes " ([activednx])" to the host, where [activednx] is the
# active DNX name. If 'dnvm' is not present, this writes nothing.
# If we have dnvm, use it to determine the active DNX
if(Get-Command dnvm -ErrorAction SilentlyContinue) {
$activeDnx = dnvm list -passthru | where { $_.Active }
if($activeDnx) {
Write-Host " (" -nonewline -ForegroundColor ([ConsoleColor]::Yellow)
Write-Host "dnx-$($activeDnx.Runtime)-win-$($activeDnx.Architecture).$($activeDnx.Version)" -nonewline -ForegroundColor ([ConsoleColor]::Cyan)
Write-Host ")" -nonewline -ForegroundColor ([ConsoleColor]::Yellow)
anurse / drill
Last active Feb 2, 2018
My VIM drill
View drill
VIM Drill
NEVER USE Arrows or Esc!
1. Type the following:
public class Foo {
public string Property { get; set; }
public int Property { get; set; }
anurse / atom-shell.d.ts
Created Dec 22, 2014
Atom TypeScript definitions.
View atom-shell.d.ts
/// <references src="node.d.ts" />
declare module "app" {
var app: AtomShell.App;
export = app;
declare module "browser-window" {
class _BrowserWindow extends AtomShell.BrowserWindow { }

Keybase proof

I hereby claim:

  • I am anurse on github.
  • I am anurse ( on keybase.
  • I have a public key whose fingerprint is 54D5 8341 7CFE 423E 5A54 D52B 4388 456B 1C13 750E

To claim this, I am signing this object:

anurse / HashCodeCombiner.cs
Created Feb 19, 2014
HashCodeCombiner - Useful for GetHashCode implementations!
View HashCodeCombiner.cs
// Copied from
// Licensed under the Apache 2 License Terms as defined in
// The only change made is to move the class to the System namespace to make it easily available in any project this file is included in.
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using System.Collections;
namespace System
anurse / JobsService.cs
Created Dec 18, 2013
A tiny snippet of what I'm trying to do. Full code is here: and kinda complicated ;P
View JobsService.cs
public class JobsService : NuGetService {
// .. stuff!
protected override Task<bool> OnStart() {
// Here, Container is the "scope" passed in to service.Initialize above.
Jobs = Container.Resolve<IEnumerable<JobDefinition>>();
// *** KA BOOM! Exception trying to construct a JobDefinition (when it's not designed to be constructed by Autofac) ***
public override void RegisterComponents(ContainerBuilder builder)
View gist:5881102
Id Version
-- -------
anurse / gist:5827060
Created Jun 20, 2013
Does this compile?
View gist:5827060
using System;
public static class Program
static void Main(string[] args)
View FixedJsonWebTokenHandler.cs
public class FixedJsonWebTokenHandler : JsonWebTokenHandler
public override SecurityToken ReadToken(string tokenString)
// Azure ACS messes with the token a bit
return base.ReadToken(Encoding.UTF8.GetString(Convert.FromBase64String(tokenString)));
anurse / gist:5485124
Created Apr 29, 2013
Azure Portal Full Width
View gist:5485124
#headerbar-wrapper {
width: 100%;
margin-left: 0;
left: 0;
#fxshell-navpane {
left: 0;
margin-left: 0;
#drawer {
You can’t perform that action at this time.