Skip to content

Instantly share code, notes, and snippets.

View Boggin's full-sized avatar
💭
bleep bloop blorp

Richard Bogle Boggin

💭
bleep bloop blorp
View GitHub Profile
@Boggin
Boggin / keyboard.ahk
Last active May 7, 2020 20:37
Colemak Mod-DH Angle Extend AutoHotkey layout
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Colemak Mod-DH angle wide mapping for ANSI boards
SC029::Esc
;SC002::1
;SC003::2
@Boggin
Boggin / boxstarter.dev
Last active June 19, 2019 21:12
Boxstarter script
# START http://boxstarter.org/package/url?https://gist.github.com/Boggin/5bcaa3cf4712f6801d0010cab64ee8f3/boxstarter.dev
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
if (Test-PendingReboot) { Invoke-Reboot }
# Configure Windows
@Boggin
Boggin / keymap.reg
Created June 19, 2019 09:38
Registry edit for keymapping
Windows Registry Editor Version 5.00
; The hex data is in five groups of four bytes:
; 00,00,00,00,\ header version (always 00000000)
; 00,00,00,00,\ header flags (always 00000000)
; 02,00,00,00,\ # of entries (1 in this case) plus a NULL terminator line.
; Entries are in 2-byte pairs: Key code to send & keyboard key to send it.
; Each entry is in LSB, MSB order.
; 01,00,3a,00,\ Send ESC (0x0001) code when user presses the CAPS LOCK key (0x003a)
; 00,00,00,00 NULL terminator
@Boggin
Boggin / SqlExceptionMocker.cs
Last active November 9, 2018 17:46 — forked from martinjw/SqlExceptionMocker.cs
Create a SqlException for testing
// .csproj
// <PackageReference Include="System.Data.SqlClient" Version="4.3.0" />
// <PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
namespace HorribleThingsInHere
{
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
Import-Module SqlServer
$srv = New-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = $srv.Databases.Item("IntermediaryManagement.DB")
$scrp = New-Object Microsoft.SqlServer.Management.Smo.Scripter($srv)
$scrp.Options.ScriptData = $TRUE
$scrp.Options.ScriptSchema = $FALSE
$tbl = $db.tables | Where-Object { $_.IsSystemObject -eq $FALSE }
$scrp.EnumScript(@($tbl)) | %{ Add-Content temp.sql $_ }
public struct Option<T>
{
private readonly T _value;
public T Value
{
get
{
if (!HasValue)
throw new InvalidOperationException();
Install-Module Pscx
Install-Module posh-git
Install-Module PSReadLine
Install-Module PSake
Install-Module Pester
@Boggin
Boggin / .git-commit-template.txt
Last active May 9, 2016 10:51 — forked from adeekshith/.git-commit-template.txt
Enforce good commit message practices across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@Boggin
Boggin / MyController.cs
Last active January 19, 2016 15:02
A WebAPI Controller for an Azure WebRole that can manage a request that will take a long time to fulfill.
namespace WebRole.Controllers
{
public class MyController : ApiController
{
private readonly ICache cache;
private readonly IMyRequestQueue myRequestQueue;
public MyController(
ICache cache,
@Boggin
Boggin / ApiAuthorizeAttribute.cs
Created October 17, 2013 15:46
MS Web API Authorize Attribute with Ninject 3.0
namespace Demo.WebMvc4.Infrastructure
{
using System.Web.Http;
public class ApiAuthorizeAttribute : AuthorizeAttribute
{
public Role Permission { get; set; }
// Note: Ninject currently doesn't support filter binding in Web API so this is a workaround.
protected AuthorizationService AuthorizationService