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
anurse / JobsService.cs
Created Dec 18, 2013
A tiny snippet of what I'm trying to do. Full code is here: https://github.com/NuGet/NuGetGallery/tree/anurse/v3-jobs/src/Services 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
-- -------
DotNetOpenAuth.AspNet 4.1.4.12333
DotNetOpenAuth.Core 4.1.4.12333
DotNetOpenAuth.OAuth.Consumer 4.1.4.12333
DotNetOpenAuth.OAuth.Core 4.1.4.12333
DotNetOpenAuth.OpenId.Core 4.1.4.12333
DotNetOpenAuth.OpenId.RelyingParty 4.1.4.12333
EntityFramework
@anurse
anurse / gist:5827060
Created Jun 20, 2013
Does this compile?
View gist:5827060
using System;
public static class Program
{
static void Main(string[] args)
{
http://localhost/index.html
Console.WriteLine("hello!");
}
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
anurse / gist:5208395
Created Mar 20, 2013
Testing X-Frame-Options: deny
View gist:5208395
<html>
<head><title>NuGet</title></head>
<body>
<h1>Nuget!</h1>
<iframe src="http://preview.nuget.org"></iframe>
</body>
</html>
@anurse
anurse / Program.cs
Last active Dec 13, 2015
Curious about Lambdas vs Method Groups...
View Program.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Curious
{
class Program
View BlobScanner.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
namespace BlobScanner
{
@anurse
anurse / PatchedWebViewPage.cs
Created Nov 8, 2012
Patched WebViewPage base class
View PatchedWebViewPage.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.WebPages;
using System.Web.WebPages.Instrumentation;
namespace MvcApplication1.Patches
@anurse
anurse / PatchedWebViewPage.cs
Created Nov 8, 2012
Patched WebViewPage base class
View PatchedWebViewPage.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.WebPages;
using System.Web.WebPages.Instrumentation;
namespace MvcApplication1.Patches
@anurse
anurse / IConsole.cs
Created May 18, 2012
BadImageFormatException - The signature is incorrect
View IConsole.cs
public interface IConsole {
void WriteLine(string line);
}
You can’t perform that action at this time.