Skip to content

Instantly share code, notes, and snippets.

💭
bleep bloop blorp

Richard Bogle Boggin

💭
bleep bloop blorp
  • Unsettling Limited
  • Edinburgh, Scotland
Block or report user

Report or block Boggin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Boggin
Boggin / Backup-Folders.ps1
Last active Dec 12, 2019
Use Restic to perform backups to Backblaze B2.
View Backup-Folders.ps1
#requires -version 4
<#
.SYNOPSIS
Restic backup script.
.DESCRIPTION
Use Restic to perform backups to Backblaze B2.
.PARAMETER Repository
The path to the Restic repository, e.g. 'b2:my-named-repo'.
@Boggin
Boggin / keymap.reg
Created Jun 19, 2019
Registry edit for keymapping
View keymap.reg
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
View Backup-Database.ps1
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 $_ }
@Boggin
Boggin / SqlExceptionMocker.cs
Last active Nov 9, 2018 — forked from martinjw/SqlExceptionMocker.cs
Create a SqlException for testing
View SqlExceptionMocker.cs
// .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;
View avoidNull.csx
public struct Option<T>
{
private readonly T _value;
public T Value
{
get
{
if (!HasValue)
throw new InvalidOperationException();
View powershell-installs.txt
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 — forked from adeekshith/.git-commit-template.txt
Enforce good commit message practices across teams.
View .git-commit-template.txt
# <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 / boxstarter.dev
Last active Jun 19, 2019
Boxstarter script
View boxstarter.dev
# 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
View git_flow.md

Git Workflow

Names for branches

  • feature
  • fix
  • hotfix
  • spike

Major branches

  • release (to staging)
@Boggin
Boggin / spf13-vim-windows-install.cmd
Created Sep 22, 2015
Install spf13's Vim on Windows XP (after adding fsutil and junction.exe).
View spf13-vim-windows-install.cmd
REM Copyright 2014 Steve Francia
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
You can’t perform that action at this time.