Skip to content

Instantly share code, notes, and snippets.

View jesperordrup's full-sized avatar

Jesper Ordrup jesperordrup

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jesperordrup on github.
  • I am jesperordrup (https://keybase.io/jesperordrup) on keybase.
  • I have a public key ASAcTjnv9Z6oOOa2xJ9HSvAdWJLVC9MYy-Ns_prEcynpIAo

To claim this, I am signing this object:

@jesperordrup
jesperordrup / FormMailChimpController.cs
Last active August 29, 2015 14:15
Umbraco MailChimp Angularjs Ajax Form Post to WebAPI. Clean App_Code and 100% control of everything.
using MailChimp;
using MailChimp.Helper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.ServiceModel.Channels;
@jesperordrup
jesperordrup / gist:64d5d3f83fcbc2ac725b
Last active August 29, 2015 14:02
redirect to Primary - if page is requested via any other url than primaryUrl then permanent redirect to primaryUrl
@{
Layout = null;
string primaryUrl = "www.jesper.com";
string adjustedUrl = "";
bool doRedirect = false;
var thisUrl = HttpContext.Current.Request.Url;
string host = thisUrl.Host.ToLower();
string PathAndQuery = thisUrl.PathAndQuery;
@jesperordrup
jesperordrup / gist:a16fae43916e621c688f
Created June 15, 2014 20:07
Distance between two coords (lat lng)
var sCoord = new GeoCoordinate(sLatitude, sLongitude);
var eCoord = new GeoCoordinate(eLatitude, eLongitude);
return sCoord.GetDistanceTo(eCoord);