Skip to content

Instantly share code, notes, and snippets.

View james-dibble's full-sized avatar

James Dibble james-dibble

View GitHub Profile
@james-dibble
james-dibble / Controller.cs
Created May 17, 2014 12:08
Dictionary receiving MVC Controller
public ActionResult Filter(string productCategory, IDictionary<string, string> filters)
{
}
@james-dibble
james-dibble / AccountController.cs
Last active August 29, 2015 14:01
Example controller for OAuth Authentication
namespace OAuthDemo.Controllers
{
using System;
using System.Web.Mvc;
[Authorize]
public class AccountController : Controller
{
public ActionResult Logout()
{
@james-dibble
james-dibble / _ExternalAuthenticationProviders.cshtml
Created May 15, 2014 16:25
External Authentication Providers View
@foreach (var provider in OAuthWebSecurity.RegisteredClientData)
{
<a href="@this.Url.Action("loginexternal", "account", new { provider = provider.AuthenticationClient.ProviderName, returnUrl = this.Model.RedirectUrl })">
<@provider.DisplayName
</a>
}
@james-dibble
james-dibble / SecurityConfig.cs
Last active August 29, 2015 14:01
Setting up WebSecutiry providers
namespace OAuthDemo.App_Start
{
using System.Configuration;
using Microsoft.Web.WebPages.OAuth;
using WebMatrix.WebData;
public static class SecurityConfig
{
public static void Setup()
{
<body>
<nav id="sidebar">
<button type="button" class="btn btn-default" data-toggle="collapse-width" data-target="#sidebar">
<span class="glyphicon glyphicon-align-justify"></span>
</button>
<div>
<ul class="nav nav-pills nav-stacked">
<li><a href="#">Some Page</a></li>
<li><a href="#">Anothe Page</a></li>
<li><a href="#">Another Page</a></li>
@james-dibble
james-dibble / Android Sliding Menu Css.css
Last active August 29, 2015 14:00
Android Sliding Menu Css
html {
overflow-y: scroll;
}
html,
body {
position: relative;
}
#sidebar {
position: fixed;
@james-dibble
james-dibble / Android Sliding Menu Javascript.js
Created May 3, 2014 20:46
Android Sliding Menu Javascript
<script>
$(function () {
$('*[data-toggle="collapse-width"]').click(function (event) {
event.stopPropagation();
var target = $($(this).data('target'));
if (target.hasClass('out')) {
target.removeClass('out');
$('#wrap').removeClass('out');
@james-dibble
james-dibble / MetaWeblogHandler.cs
Created April 17, 2014 16:58
MetaWeblog HTTP Handler
namespace Personal.Website.Handlers
{
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Personal.ServiceLayer;
public class MetaWeblogHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
@james-dibble
james-dibble / RouteConfig.cs
Created April 17, 2014 16:57
RouteConfig for metaweblog
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add(new Route("metaweblog", new MetaWeblogHandler()));
}
@james-dibble
james-dibble / web.config
Created April 17, 2014 16:55
XML-RPC HttpHandler Config
<configuration>
<system.webServer>
<handlers>
<add name="MetaWebLogHandler" verb="POST,GET" type="MetaWeblogService" path="/metaweblog" />
</handlers>
</system.webServer>
</configuration>