View AccountController.cs
await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
// Redirect users to the home page if local because we can't send emails or confirm accounts
return RedirectToAction("Index", "Manage");
// For more information on how to enable account confirmation and password reset please visit
// send the user a confirmation email
await SendEmailConfirmationTokenAsync(user.Id, "Confirm your account");
return View("EmailConfirmationRequired");
View myfacebookapp.js
complete facebook sdk authorization/login in 20 lines (or less)
include in your html page
function onLogin(response) {
if(response.status === "not_authorized") {
// send the user somewhere as they refused to authorize your app
View TerrainManager.cs
using UnityEngine;
using System.Collections;
using Utility;
public class TerrainManager : MonoBehaviour {
public GameObject playerGameObject;
public Terrain referenceTerrain;
public int TERRAIN_BUFFER_COUNT = 50;
public int spread = 1;
View terrarium.nuspec
<?xml version="1.0"?>
<package >
<title>Terrarium SDK</title>
<authors>Microsoft, Bil Simser</authors>
<owners>Bil Simser</owners>
View build.bat
@echo Off
set config=%1
if "%config%" == "" (
set config=Release
set version=1.0.0
if not "%PackageVersion%" == "" (
set version=%PackageVersion%
View gist:4612617
public class HelpDeskTicket
public CallerInfo CallerInfo { get; set; }
[Display(Name = "Comments")]
public string Comments { get; set; }
View program.cs
using System;
using SignalR.Client.Hubs;
namespace FANS.Demo
internal class Program
private static void Main(string[] args)
View generic_class.cs
// Trying to create a generic class using constraints. Something is wrong.
// I *think* I have the base class declared correctly?
public class Map<T, S> where T: Type where S: struct
View SentenceParser.cs
namespace System
public static class SentenceParser
public static string TrimSentence(this string @string, int length)
if (TheInputsAreNotValid(length, @string)) return AnEmptyString();
if (TheLengthIsLongerThanTheInputString(length, @string)) return TheOriginalString(@string);
if (TheNextCharacterIsEmpty(@string, length)) return TheNormallyParsedString(length, @string);
View viewmodels.cs
class MainViewModel : ViewModelBase
public string Duration {get; set;}
abstract class ViewModelBase