Skip to content

Instantly share code, notes, and snippets.

Introduction to Owin
- What is Owin
- Benefits of Owin
- Introduction to middleware - how middleware is useful
Introduction to OAuth
- What does OAuth do
- What doesn't OAuth do
- The spec
- Example of flow
public static class IdentifierGenerator
{
private const string Alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
private static readonly int _base = Alphabet.Length;
public static string Encode(int index)
{
if (index == 0)
return Alphabet[0].ToString();
public class AccountController : Controller
{
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Login()
{
var redirectUri = Url.Action(
"ExternalLoginCallback",
"Account");
return new ChallengeResult(redirectUri);
USE master;
DROP DATABASE Experiment;
CREATE DATABASE Experiment;
USE Experiment;
CREATE TABLE dbo.Tags
(
TagName NVARCHAR(100) PRIMARY KEY
@AlexArchive
AlexArchive / CascadeDelete.sql
Created February 23, 2015 06:51
Cascade Delete T-Sql
USE master;
DROP DATABASE Experiment;
CREATE DATABASE Experiment;
USE Experiment;
CREATE TABLE dbo.Departments
(
departmentid INT PRIMARY KEY IDENTITY,
name NVARCHAR(100) NOT NULL
USE [Master];
IF DB_ID('Prototype') IS NOT NULL
DROP DATABASE Prototype;
CREATE DATABASE Prototype;
USE Prototype;
CREATE TABLE dbo.Users
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Metadata;
namespace ConsoleApp1
{
public class Program
{
#header {
margin-top: 30px;
}
#header:before {
background-color: red;
content: "What an awful hack indeed.";
color: white;
position: absolute;
top: 0;
left: 0;