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 / 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 / .gitconfig
Last active October 11, 2022 06:48
.gitconfig with beyondcompare for linux
[core]
excludesfile = ~/.gitignore
autocrlf = input
editor = ~/tools/sublime_text_3/sublime_text
[user]
name = Daniel Fisher
email = info@lennybacon.com
[push]
default = tracking
[http]
@lennybacon
lennybacon / SetCodeManalysis.ps1
Created April 29, 2015 11:13
Enable or disable FxCop Code Analysis solution wide in Visual Studio Package Manager Console
function Disable-CodeAnalysis(){
ForEach ($project in $dte.Solution.Projects) {
Set-CodeAnalysis($project, $false)
}
}
function Enable-CodeAnalysis(){
ForEach ($project in $dte.Solution.Projects) {
Set-CodeAnalysis($project, $true)
}

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:

@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