Skip to content

Instantly share code, notes, and snippets.

View sharpjs's full-sized avatar
💾
Flipping bits, taking bytes

Jeff Sharp sharpjs

💾
Flipping bits, taking bytes
View GitHub Profile
@sharpjs
sharpjs / Severities.cs
Created June 3, 2020 17:26
SQL Server Message Severities
// LEVEL GROUP KILLS EVENT LOG MEANING
// 0 Informational - - User-defined
// 1 Informational - - User-defined
// 2 Informational - - User-defined
// 3 Informational - - User-defined
// 4 Informational - - User-defined
// 5 Informational - - User-defined
// 6 Informational - - User-defined
// 7 Informational - - User-defined
// 8 Informational - - User-defined
@sharpjs
sharpjs / ApplicationInsightsReleaseAnnotation.ps1
Created December 21, 2019 00:02
How to create an Application Insights release annotation (in Octopus Deploy)
using namespace System.Net
#Requires -Version 5.1
$ErrorActionPreference = "Stop"
function New-ApplicationInsightsReleaseAnnotationCore {
param (
[Parameter(Mandatory, Position=0)]
[string] $ApplicationId,
[Parameter(Mandatory, Position=1)]
@sharpjs
sharpjs / SemVer2.ps1
Last active May 22, 2018 21:42
PowerShell/.NET Regular Expression for SemVer 2.0
# Pubic Domain. No rights reserved. No warranty.
# Reference:
# https://github.com/semver/semver/blob/master/semver.md
$VersionRegex = [regex] '(?nx)
^
(?<Version>
(?<Numbers>
( 0 | [1-9][0-9]* )
(
@sharpjs
sharpjs / MainThreadSynchronizationContext.cs
Created December 23, 2017 18:43
A "Main Thread" SynchronizationContext
/*
Copyright (C) 2017 Jeffrey Sharp
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@sharpjs
sharpjs / bash-files.md
Last active February 20, 2022 23:44
Bash Startup File Chart

What files will Bash run automatically?

When invoked as bash:

Remote Non-Login Login
Interactive
  • .bashrc
  • .bashrc
  • /etc/profile
  • First one of:
    • .bash_profile
    • .bash_login
    • .profile
  • .bash_logout
Non-Interactive
  • .bashrc
  • $BASH_ENV
  • /etc/profile
  • First one of:
    • .bash_profile
    • .bash_login
    • .profile
  • $BASH_ENV
  • .bash_logout (if exit invoked)

When invoked as sh:

@sharpjs
sharpjs / CrashPlan.md
Last active November 19, 2016 19:27
Running CrashPlan in Docker on a Synology NAS
@sharpjs
sharpjs / functor.rs
Created March 26, 2016 10:44
Functor (fmap) for Rust
// Functors (fmap) for Rust
//
// Copyright (C) 2016 Jeffrey Sharp
//
// This file is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This file is distributed in the hope that it will be useful, but
@sharpjs
sharpjs / shared.rs
Created December 27, 2015 18:18
Rust Smart Pointer to Shared Immutable Data
// Smart Pointer to Shared Immutable Data
//
// Copyright (C) 2015 Jeffrey Sharp
//
// This file is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This file is distributed in the hope that it will be useful, but
@sharpjs
sharpjs / dynamic_eq.rs
Created December 27, 2015 18:17
Rust Dynamic Trait Equality Deriving
// Dynamic Trait Equality Deriving
//
// Copyright (C) 2015 Jeffrey Sharp
//
// This file is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This file is distributed in the hope that it will be useful, but
@sharpjs
sharpjs / AssemblyInfo.cs
Created May 14, 2014 22:24
Example Per-Project AssemblyInfo.cs
using System.Reflection;
using System.Security;
// General Information
[assembly: AssemblyTitle ("My Utility")]
[assembly: AssemblyDescription ("A neat program that does a few useful things.")]
// Security
//
// All code is transparent.