Skip to content

Instantly share code, notes, and snippets.

Avatar
🤗
Living the dream

Adam Ralph adamralph

🤗
Living the dream
View GitHub Profile
@adamralph
adamralph / .gitconfig
Last active Sep 13, 2020
My global .gitconfig
View .gitconfig
[user]
name = Adam Ralph
email = adam@adamralph.com
[core]
autocrlf = false
editor = \"C:/Users/adam/AppData/Local/Programs/Microsoft VS Code/Code.exe\" --wait
sshCommand = C:/Windows/System32/OpenSSH/ssh.exe
[alias]
prune-all = !git remote | xargs -n 1 git remote prune
dtag = !git tag -l | xargs git tag -d
@adamralph
adamralph / bullseye-custom-args-mcmaster.cs
Last active Oct 17, 2019
Using Bullseye with custom args with McMaster.Extensions.CommandLineUtils
View bullseye-custom-args-mcmaster.cs
// dotnet add package McMaster.Extensions.CommandLineUtils
using System.Linq;
using McMaster.Extensions.CommandLineUtils;
using static Bullseye.Targets;
class Program
{
static void Main(string[] args)
{
@adamralph
adamralph / ci.md
Last active Sep 9, 2019
My current assessment of SaaS CI systems
View ci.md

This assessment is performed with respect to the requirements of the .NET community open source projects which I maintain. It is restricted to the free tier provided by each system.

Only the drawbacks are listed, which makes the assessment sound a bit negative, but it's relative to a baseline functional expectation:

  • Linux and Windows
  • Fast provisioning
  • Concurrent builds
  • Common build properties surfaced as env vars (e.g build number)
  • Readable, copyable, and line-linkable log output, supporting ANSI colour codes and code page 437
@adamralph
adamralph / DumpPalette.cs
Created Aug 26, 2019
For use in Bullseye Palette.cs when tuning for CI systems
View DumpPalette.cs
Console.WriteLine($"{black}black{@default}");
Console.WriteLine($"{red}red{@default}");
Console.WriteLine($"{green}green{@default}");
Console.WriteLine($"{yellow}yellow{@default}");
Console.WriteLine($"{blue}blue{@default}");
Console.WriteLine($"{magenta}magenta{@default}");
Console.WriteLine($"{cyan}cyan{@default}");
Console.WriteLine($"{white}white{@default}");
Console.WriteLine($"{brightBlack}brightBlack{@default}");
@adamralph
adamralph / bullseye-custom-args-system.cs
Last active Aug 11, 2019
Using Bullseye with custom args with System.CommandLine.Experimental
View bullseye-custom-args-system.cs
// dotnet add package System.CommandLine.Experimental
using System.CommandLine;
using static Bullseye.Targets;
class Program
{
static void Main(string[] args)
{
var cmd = new RootCommand { TreatUnmatchedTokensAsErrors = false };
@adamralph
adamralph / ConcurrencyThrottlingByMessageType.cs
Created Dec 10, 2018
Throttling concurrency by message type in NServiceBus
View ConcurrencyThrottlingByMessageType.cs
using NServiceBus.Pipeline;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
internal class ConcurrencyThrottlingByMessageType : IBehavior<IIncomingLogicalMessageContext, IIncomingLogicalMessageContext>
{
private static readonly Dictionary<Type, Throttle> throttles = new Dictionary<Type, Throttle>
{
@adamralph
adamralph / UdiWorld.cs
Created Oct 22, 2018
My solution to the saga homework for https://particular.net/adsd
View UdiWorld.cs
namespace UdiWorld
{
using System;
using System.Threading.Tasks;
using NServiceBus;
public class UserBecamePreferred
{
public Guid UserId { get; set; }
}
View hardware.md

Workstation (Dec 2015)

  • Dell Precision T5810
  • Intel Xeon E5-1650 v3 (3.8GHz, 12 threads)
  • 32GB (1x32GB) DDR4-2133 ECC RAM
  • 512GB M.2 (PCI Express) SSD (Samsung SSD 950 Pro)
  • 2x1TB HDD
  • APC BR1500LCDI, Back-UPS RS
  • nVidia Quadro K2200 (2xDisplayPort 1.2)
  • nVidia Quadro K620 (1xDisplayPort 1.2)
View twitter-home-hider.js
// ==UserScript==
// @name Twitter Home hider 323465
// @version 1
// @grant none
// @include https://twitter.com/*
// ==/UserScript==
document.getElementById("global-nav-home").style.display = "none";
@adamralph
adamralph / search-package-usage.linq
Last active Nov 10, 2017
A LINQPad script to search GitHub repos for package usage (and potentially other things)
View search-package-usage.linq
<Query Kind="Statements">
<NuGetReference>Humanizer</NuGetReference>
<NuGetReference>Octokit</NuGetReference>
<Namespace>Humanizer</Namespace>
<Namespace>Octokit</Namespace>
<Namespace>Octokit.Internal</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>
// I wrote this script to help me find out where my NuGet packages are being used.
You can’t perform that action at this time.