Skip to content

Instantly share code, notes, and snippets.

View lennybacon's full-sized avatar
🏠
Working from home

Daniel Fisher lennybacon

🏠
Working from home
View GitHub Profile
@lennybacon
lennybacon / LicenseLoader.cs
Created November 19, 2014 14:10
Loading Licenses into the LicenseContext
public class LicenseLoader
{
public static void LoadLicensesFromCallingAssembly()
{
var assembly = Assembly.GetCallingAssembly();
foreach (var resourceName in
assembly.GetManifestResourceNames().
Where(resourceName => resourceName.EndsWith(".licenses")))
{
@lennybacon
lennybacon / userstyle_about-home.css
Created December 31, 2014 15:40
Dark Theme for Firefox about:home using the add-on Stylish (https://userstyles.org/)
/* AGENT_SHEET */
/** DeepDark "about:home" for Firefox
/* http://userstyles.org/styles/64099/
/* by sr21
/* update 2014-02
*/
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url("about:home") {
@lennybacon
lennybacon / userstyle_youtube-ad-killer.css
Created December 31, 2014 15:43
Youtube Ad-Killer using the add-on Stylish (https://userstyles.org/)
.pyv-afc-ads-inner{
display: none;
}
.ad-div {
display: none;
}
@lennybacon
lennybacon / SecureStringTests.cs
Created January 30, 2015 13:41
Using credentials based secure string that is disposed
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Security;
using NUnit.Framework;
namespace Tests
{
[TestFixture]
public class SecureStringTests
@lennybacon
lennybacon / IEJSONMime.reg
Created February 3, 2015 13:15
Show JSON in Internet Explorer instead of download
REGEDIT4
[HKEY_CURRENT_USER\Software\Classes\Mime\Database\Content Type\application/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Extension"=".json"
[HKEY_CURRENT_USER\Software\Classes\Mime\Database\Content Type\application/javascript]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Extension"=".js"
@lennybacon
lennybacon / bindevent.js
Last active August 29, 2015 14:17
Attach an event
function bindEvent(el, eventName, eventHandler, bubble) {
var handler;
// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
// http://www.quirksmode.org/js/events_order.html#link9
handler =
function (e) {
if (!bubble) {
if (!e) e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
@lennybacon
lennybacon / ng-http.xml
Last active August 29, 2015 14:17
ng-http snippet for visual studio
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<!-- {MyDocuments}\Visual Studio 2013\Code Snippets\Visual Web Developer\My JScript Snippets\ng-http.snippet -->
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>Angular $http</Title>
<Author>Daniel Fisher</Author>
<Shortcut>nghttp</Shortcut>
</Header>
@lennybacon
lennybacon / Get-PublicKeyFromStrongNameFile.ps1
Created July 1, 2015 11:52
Get the public key for the InternalsVisibleTo attribute from a string name key pair file
$sn.exe –p StrongName.snk PublicKey.snk
[System.String]::Join("", ([System.IO.File]::ReadAllBytes("$pwd\PublicKey.snk") | %{ $_.ToString()}))
[System.IO.File]::Delete("$pwd\PublicKey.snk")
@lennybacon
lennybacon / Get-PublicKeyFromAssembly.ps1
Created July 1, 2015 11:59
Get the public key for the InternalsVisibleTo attribute from an assembly
&sn.exe -q -Tp .\assembly.dll

Keybase proof

I hereby claim:

  • I am lennybacon on github.
  • I am lennybacon (https://keybase.io/lennybacon) on keybase.
  • I have a public key whose fingerprint is 83B1 176C 56A6 DBD1 292C 61A6 10A5 2AF7 5643 445B

To claim this, I am signing this object: