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 / SafeTypeFaces
Created February 26, 2013 15:54
CSS: Safe Type Faces
.sans-ui{
font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
}
.sans{
font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
}
.serif{
font-family: Cambria, Georgia, serif;
}
.mono{
@lennybacon
lennybacon / gist:6007741
Created July 16, 2013 10:58
Code Snippet: Surround With Task
<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Task</Title>
<Author>Daniel Fisher(lennybacon)</Author>
<Description>Task</Description>
<Shortcut>task</Shortcut>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@lennybacon
lennybacon / StringExtensions.Wcce.cs
Last active August 29, 2015 13:57
Sanitizing Strings according to Windows Client Certificate Enrollment Protocol [MS-WCCE]
public static partial class StringExtensions
{
/// <summary>
/// Sanitizes the string according to Windows Client Certificate Enrollment
/// Protocol: http://msdn.microsoft.com/en-us/library/cc249879.aspx
/// </summary>
/// <param name="input">The input.</param>
/// <returns>System.String.</returns>
/// <remarks>
/// All disallowed characters in the original name MUST be replaced with
@lennybacon
lennybacon / callChain.js
Last active August 29, 2015 13:57
Chaining asynchronous JavaScript calls with Angular JS
angularModule.
factory(
'callChain',
[
function() {
return function () {
var cs;
cs = [];
this.add = function (call) {
cs.push(call);
@lennybacon
lennybacon / usingCallChain.js
Last active August 29, 2015 13:57
Using the chaining asynchronous JavaScript calls with Angular JS
function f1(callback) {
console.log('f1');
if (callback != null) {
console.log('hasCallback');
callback();
}
}
function f2(callback) {
console.log('f2');
if (callback != null) {
@lennybacon
lennybacon / Ipmi.cs
Last active May 24, 2019 01:56
Remote control supermicro super server via ATEN IPMI in C#
/// <summary>
/// Ipmi remote interface to control supermicro super server via ATEN IPMI.
/// </summary>
public class Ipmi
{
private readonly string _hostName;
private readonly CookieContainer _cookieContainer;
private const string LoginUrlFormat =
"https://{0}/cgi/login.cgi";
@lennybacon
lennybacon / WindowsDefenderVS.reg
Created June 8, 2014 12:24
Windows Defender Registry Settings for Visual Studio Speed
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Extensions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths]
"P:\\"=dword:00000000
"C:\\Windows\\assembly"=dword:00000000
"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0"=dword:00000000
@lennybacon
lennybacon / MultiplyData.sql
Last active August 29, 2015 14:02
Poor Mans SQL Data Generation
SET IDENTITY_INSERT [LogEntry2] ON;
GO
WHILE (SELECT COUNT(*) FROM [LogEntry2]) < 2500000
BEGIN
INSERT INTO [LogEntry2]
(
[LogEntry2].[Id]
, [LogEntry2].[Culture]
, [LogEntry2].[Created]
, [LogEntry2].[CreatedBy]
@lennybacon
lennybacon / iiscfg.ps1
Created August 7, 2014 08:47
IIS Configuration PowerShell Script
Set-Alias iiscfg Edit-ApplicationHostsConfig
function Edit-ApplicationHostsConfig {
$file = Get-ApplicationHostsConfig
edit $file
}
function Get-ApplicationHostsConfig(){
$appHostConfig = "C:\Windows\sysnative\inetsrv\config\applicationHost.config"
$exists = Test-Path $appHostConfig
@lennybacon
lennybacon / VsProjecItemBatch.ps1
Last active February 29, 2016 10:06
Batch processing Visual Studio ProjectItems with the Nuget Package Management Powershell Console
function Search-ItemsRecursive($projectItems, $list){
ForEach ($item in $projectItems) {
$itemName = $item.Name
Write-Host "Getting all project items for $itemName"
$list.Add($item);
if($item.ProjectItems -ne $null){
Search-ItemsRecursive -projectItems $item.ProjectItems -list $list
}
if($item.SubProject -ne $null -and $item.SubProject.ProjectItems -ne $null){
Search-ItemsRecursive -projectItems $item.SubProject.ProjectItems -list $list