Skip to content

Instantly share code, notes, and snippets.

View adamralph's full-sized avatar
🤗
Living the dream

Adam Ralph adamralph

🤗
Living the dream
View GitHub Profile
@adamralph
adamralph / UdiWorld.cs
Created October 22, 2018 19:51
My solution to the saga homework for https://particular.net/adsd
namespace UdiWorld
{
using System;
using System.Threading.Tasks;
using NServiceBus;
public class UserBecamePreferred
{
public Guid UserId { get; set; }
}
@adamralph
adamralph / hardware.md
Last active October 20, 2018 06:30
My hardware

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)
@adamralph
adamralph / twitter-home-hider.js
Created August 23, 2018 17:12
Twitter Home hider
// ==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 November 10, 2017 10:03
A LINQPad script to search GitHub repos for package usage (and potentially other things)
<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.
@adamralph
adamralph / list-video-duration.linq
Last active September 28, 2017 16:18
List duration of video files
<Query Kind="Statements">
<NuGetReference>Xabe.FFmpeg</NuGetReference>
<Namespace>Xabe.FFmpeg</Namespace>
</Query>
Util.AutoScrollResults = true;
FFbase.FFmpegDir = @"C:\ffmpeg-3.3.3-win64-static\bin";
Directory.EnumerateFiles(@"C:\vids")
@adamralph
adamralph / HashBus.DeDup-Program.cs
Created March 31, 2017 12:21
A hack to remove dups from HashBus, from before we fixed the app to strip them out on the way in
namespace HashBus.DeDup
{
using System;
using System.Linq;
using System.Threading.Tasks;
using HashBus.ReadModel;
using HashBus.ReadModel.MongoDB;
using MongoDB.Driver;
class Program
@adamralph
adamralph / gist:3904338
Created October 17, 2012 08:16
xbehave background out param idea
[Background]
public static void Background(out Stack<int> stack)
{
"Given a stack"
.Given(() => stack = new Stack<int>());
}
[Scenario]
[Example(123)]
[Example(234)]
@adamralph
adamralph / inspectcode-error.txt
Created November 14, 2016 13:14
Intermittent error in InspectCode in Resharper Command Line tools
Running '"./.resharper/inspectcode.exe" --profile=./src/NServiceBus.RabbitMQ.sln.DotSettings --output=./src/NServiceBus.RabbitMQ.sln.inspections.xml ./src/NServiceBus.RabbitMQ.sln'...
JetBrains Inspect Code 2016.2.2
Running in 64-bit mode, .NET runtime 4.0.30319.42000 under Microsoft Windows NT 6.2.9200.0
Custom settings layer is mounted. Used file C:\code\Particular\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ.sln.DotSettings
Asking for writer lock unexpected. File changes:
--- EXCEPTION #1/1 [LoggerException]
Message = "Asking for writer lock unexpected. File changes:"
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
#!/usr/bin/env bash
# options
set -e
set -o pipefail
set -x
# determine cache dir
if [ -z $XDG_DATA_HOME ]; then
NUGET_CACHE_DIR=$HOME/.local/share
Config.WebGreeting = "Hello World from web!";
Config.WebValediction = "Goodbye World from web!";