Skip to content

Instantly share code, notes, and snippets.

View nato24's full-sized avatar

Nathan Edminster nato24

  • Click Managment, Inc
  • Spokane, Wa
View GitHub Profile
[OverrideAuthentication]
[HostAuthentication(DefaultAuthenticationTypes.ExternalCookie)]
[AllowAnonymous]
[Route("ExternalLogin", Name = "ExternalLogin")]
public async Task<IHttpActionResult> GetExternalLogin(string provider, string error = null)
{
string redirectUri = string.Empty;
OAuthClient oAuthClient = null;
if (error != null)
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@addyosmani
addyosmani / pubsub.md
Created October 28, 2011 06:49
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@leekelleher
leekelleher / RedirectToFirstChild.master
Created August 24, 2011 15:55
Umbraco template to redirect the current page/node to its first child page/node.
<%@ Master Language="C#" MasterPageFile="~/masterpages/BlankTemplate.master" AutoEventWireup="true" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
var current = umbraco.NodeFactory.Node.GetCurrent();
if (current != null)
{
var child = current.ChildrenAsList.FirstOrDefault();
if (child != null)
{