I hereby claim:
- I am 0xdeafcafe on github.
- I am 0xdeafcafe (https://keybase.io/0xdeafcafe) on keybase.
- I have a public key ASANuGtX01IEwplboVPjan4JEgCc5rltukeTikIVSZPeKwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using System.Web; | |
using System.Web.Http; | |
namespace SgTest.Controllers | |
{ | |
public class InboundController : ApiController |
// what were you doing Peaches? ;_; | |
private function _getTimePlayed($time) | |
{ | |
/* Check for days, hours, minutes, seconds */ | |
if (preg_match('/P(?P<days>[0-9]*)DT(?P<hours>[0-9]*)H(?P<minutes>[0-9]*)M(?P<seconds>[0-9]*)S/s', $time, $regs)) | |
{ | |
/* now dump */ | |
$totalSeconds = ($regs['days'] * 86400) + ($regs['hours'] * 3600) + ($regs['minutes'] * 60) + $regs['seconds']; | |
} |
namespace SnapDotNet.Core.Miscellaneous.Helpers | |
{ | |
public static class NetworkInformationHelper | |
{ | |
private const int IanaInterfaceTypeWifi = 71; | |
public static bool OnWifiConnection() | |
{ | |
var internetConnectionProfile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile(); | |
return internetConnectionProfile.NetworkAdapter.IanaInterfaceType == IanaInterfaceTypeWifi; |
// POST api/inbound | |
[ValidateInput(false)] | |
[ParseEmailObjectFilter] | |
public ActionResult Post() | |
{ | |
if (ActionContext == null || ActionContext.ActionArguments == null || ActionContext.ActionArguments["email"] == null || !ActionContext.ActionArguments.ContainsKey("email")) | |
return new HttpStatusCodeResult(HttpStatusCode.OK); | |
var email = ActionContext.ActionArguments["email"] as Email; | |
if (email == null) |
public class ParseEmailObjectFilter : ActionFilterAttribute | |
{ | |
/// <summary> | |
/// Parses the raw form-data of the POST into a snazzy email | |
/// model, and then sets it in the arguments for the POST function | |
/// to read. | |
/// </summary> | |
/// <param name="actionContext">The HTTP action context of the POST.</param> | |
public override void OnActionExecuting(HttpActionContext actionContext) | |
{ |
/// <summary> | |
/// A model with the data format of the Inbound Parse API's POST | |
/// </summary> | |
public class Email | |
{ | |
/// <summary> | |
/// The Domain Keys Identified Email code for the email | |
/// </summary> | |
public string Dkim { get; set; } |