Skip to content

Instantly share code, notes, and snippets.

@BennyM
BennyM / OutlookAgentMessageHandler.cs
Last active December 28, 2015 01:19
Get request and accept json
public class OutlookAgentMessageHandler
: DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{
if (request.Headers.UserAgent.Any(x => x.Comment != null && x.Comment.Contains("Microsoft Outlook")))
{
request.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("text/iCal"));
}
@BennyM
BennyM / Web.config
Created November 2, 2013 14:02
Web.config to use in your Views folder when starting an MVC 4 project in Visual Studio 2012 and upgrade to MVC5 and Razor3
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
Verifying that "bennym.id" is my Blockstack ID. https://onename.com/bennym
@BennyM
BennyM / Jade Anchor Tag
Created January 28, 2012 22:01
Create anchor tag in text
p Something something. Oh yeah you need a new line
a(href="#") those
| spaces are importantand then a pipe with more spaces to get ur text on the same line, that's usefull.
@BennyM
BennyM / init.js
Created September 20, 2017 14:43
Use eth-lightwallet with Web3ProviderEngine
var keyStore = ...init as usual...;
var engine = new Web3ProviderEngine();
var opts = {
getAccounts: (cb) => {
let addresses = keyStore.getAddresses();
let prefixedAddresses = addresses.map(add => {
return '0x' + add;
});
cb(null, prefixedAddresses);
},