Skip to content

Instantly share code, notes, and snippets.

Benny Michielsen BennyM

View GitHub Profile
@BennyM
BennyM / init.js
Created Sep 20, 2017
Use eth-lightwallet with Web3ProviderEngine
View init.js
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);
},
View gist:988d3c76fdb128ddf591ce1e618a8ac8
Verifying that "bennym.id" is my Blockstack ID. https://onename.com/bennym
@BennyM
BennyM / OutlookAgentMessageHandler.cs
Last active Dec 28, 2015
Get request and accept json
View OutlookAgentMessageHandler.cs
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 Nov 2, 2013
Web.config to use in your Views folder when starting an MVC 4 project in Visual Studio 2012 and upgrade to MVC5 and Razor3
View Web.config
<?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>
@BennyM
BennyM / Jade Anchor Tag
Created Jan 28, 2012
Create anchor tag in text
View Jade Anchor Tag
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.
You can’t perform that action at this time.