Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Iffland kenstone

View GitHub Profile
@kenstone
kenstone / _AppStart.cshtml
Created Aug 21, 2012
MVC 4 Application Start Code
View _AppStart.cshtml
@{
if (!WebSecurity.Initialized)
{
WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId",
"UserName", autoCreateTables: true);
}
}
@kenstone
kenstone / gist:3629483
Created Sep 5, 2012
Knockout View Model Method Call without deferreds
View gist:3629483
var viewModel = function() {
var self = this;
self.description = ko.observable('hello');
self.get = function(words) {
$.ajax({
url: "/echo/json",
dataType: "json",
type: "POST",
@kenstone
kenstone / gist:3629588
Created Sep 5, 2012
Knockout View Model Method Call with deferreds
View gist:3629588
var viewModel = function() {
var self = this;
self.description = ko.observable();
self.get = function(words) {
return $.ajax({
url: "/echo/json",
dataType: "json",
type: "POST",
@kenstone
kenstone / aspnet45 auth table defintions.sql
Created Aug 21, 2012
SQL Table definitions for ASP.NET 4.5 Simple Membership Authentication
View aspnet45 auth table defintions.sql
CREATE TABLE [dbo].[UserProfile] (
[UserId] INT IDENTITY (1, 1) NOT NULL,
[UserName] NVARCHAR (MAX) NULL,
PRIMARY KEY CLUSTERED ([UserId] ASC)
);
CREATE TABLE [dbo].[webpages_Membership] (
[UserId] INT NOT NULL,
[CreateDate] DATETIME NULL,
[ConfirmationToken] NVARCHAR (128) NULL,
View flexbox mixins.less
.flex() {
display: -webkit-box;
display: -moz-box;
display:-webkit-flex;
display: -ms-flexbox;
display:flex;
}
.flex-justify(@justifyStyle) {
View FailRequestAttribute.cs
using System;
using System.Net;
using System.Threading;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Controllers;
using ActionFilterAttribute = System.Web.Http.Filters.ActionFilterAttribute;
namespace MyProject
You can’t perform that action at this time.