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 / gist:8801248
Created February 4, 2014 10:29
PayPal REST API SDK Configuration
<configuration>
<configSections>
<section name="paypal" type="PayPal.Manager.SDKConfigHandler, PayPalCoreSDK" />
</configSections>
<paypal>
<accounts>
<account apiUsername="" apiPassword="" applicationId="" apiSignature="" />
</accounts>
<settings>
<add name="mode" value="sandbox" />
@james-dibble
james-dibble / gist:8801458
Last active August 29, 2015 13:56
PayPal REST API SDK Payment Serice example
namespace Application.Services
{
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using global::PayPal;
@james-dibble
james-dibble / gist:8801628
Last active August 29, 2015 13:56
An example MVC controller for interacting with a PayPal payment service
namespace TheBush.Controllers
{
using System.Globalization;
using System.IO;
using System.Web.Mvc;
using PayPal.Exception;
using Application.Services;
@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>
@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 / 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 / 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 / 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;
<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 / 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()
{