Skip to content

Instantly share code, notes, and snippets.

View KevM's full-sized avatar

Kevin Miller KevM

View GitHub Profile
BEGIN KEYBASE SALTPACK ENCRYPTED MESSAGE. kiPgBwdlv6bV9N8 dSkCbjKrku54ziK Zz2uuSzFWy1m8YQ LehNteae3PkgFI3 cZc9GMkuZWFbE3m yCQFNtG1SQR2aFm Xm9gtQbMuYcJqom kuqtSGw9CUZcFM0 Lz4S60xUJLfR9DV WbBmxqBrSFzB8qF V2GUi8TnQ2poVrk za5VeMhI9FWdtHY PXTY4xNej7l4TAu 5Nm46wsGzMNHOP8 j45i6xSdwzbnumh pRvpGTiCiQuGimg HemvGt86GcbD2Rh UivQW13qpIGEKHW 7edZPvoxvu4RRhu H5dYaEcc1i2IMPP Em9Q8q86z4mZjFY EMcXcM5YWhRv6Jp pMMxLgUEXRyXPmT 4PqoNoSb1hGIYj2 7lCGGtI5FnhnOBn 53Q3nY9bGbIZdZJ WKL9e8IaacZU9e9 9jeNzVqxpV0SeHy do7Gyln6vTQ3LYq Vp7Qg735r2QZuWJ n1mC0xjm7s4SNDD e0Uv3jVGf8xoTgz y2yAGH7UhuHIO2G PW6BLPNzGpwDuNA N6jQv7ZdFvyUJTf ywOaIRZjinxO5gZ 8SUHRW5JNg0jh4V dpFcblMEpgsuAAZ mTTG24Diw1b5YZh XlyctMXkJUsf16y IEKye95fJRlajoK 8K22GcXrTEggW9k QaVT2PIr0OlQYjI BNNxPDrZzvUd7Ub 8hcLkw7A2cHJA2b HjK4DyojSVOpgkV UpOr6r8ejLyt6ZU QOHjV54CGnRCLC8 V9mU6RcZtrF7v0s 1z4zatFPPyhV1bQ T6LBWy3szXAYM9v 5T3gzewZ3k59wfg 2rQB3SDz2jWs0zq CyOU1cPDMcrfdtI AjldCtW3IRdCe6j crVqx7rqgMEaKzZ jAN3Anbonh0txhF aVlutRouweTrSjM PtuKGtoH6wQ5Y0I kgmeNkYNfwmPCZg kqmgvpMnbVu5rlV 2pQbVM
-----BEGIN PGP MESSAGE-----
Comment: https://keybase.io/download
Version: Keybase Go 1.0.17 (darwin)
wcBMA8LJ7PaLh/QzAQgAwOZYt1DaP3/wyHNjXSYECZD8/hziUEXQXtti8yFuFXkQ
RlWGIeN0zd46EohqtXoWSRyo1RGoyglc+iknm+ZC0EJcem2ba3v7SdU58STDz6pv
uDJrmH4Snm2T9/uXSVGrGOSQ144DC2LNsY20zXevj8mlMsANOgVECVjaTuShP+eD
+qIhXy6N0LQm8RuGd0ilRCQYrvU2+2VXEk7w3rybO4mXDbIwcLqR6NI0vV99tQD3
c7D6wot1OrisVy1UhCRDug1yok6qwavyOt63kMc63LSVhS13eRWvkH2hUggA4V8C
sZ30aAEseDfct4mGLDxIzSIcU04e2dLpHsggGxAZUtLgAeQpX0E5H463zd5m/l7D
@KevM
KevM / mp.sh
Last active August 11, 2016 18:30
Bash script to monitor the Alamo Drafthouse calendar for changes
# Usage: Run script with watch to repeat this check every N seconds `watch -n 20 ./mp.sh`
# On macos: `brew install jq watch`
# Example Used for Master Pancake CYOP tickets that often go on sale and then sell out quickly.
rm mp*.json
# Download the Alamo Drafthouse calendar for Austin
curl -s https://feeds.drafthouse.com/adcService/showtimes.svc/calendar/0002/ > mp.json
# Hacky jq query to pull out the Ritz location's events for the desired week/day combinations
cat mp.json | jq .Calendar.Cinemas[0].Months[0].Weeks[2].Days[4] >> mp-res.json
@KevM
KevM / ObservableExtensions.cs
Created October 12, 2015 18:35
IObservable extensions for testing
public static class ObservableExtensions
{
public static Func<bool> WasObserved<T>(this IObservable<T> o, T expected)
{
var wasExpectedObserved = false;
var result = o.Subscribe(s =>
{
wasExpectedObserved = s.Equals(expected);
});
@KevM
KevM / child.wxs
Created August 5, 2015 21:53
Wix Provides and Requires example (non-working)
<?xml version="1.0" encoding="UTF-8"?>
<?define VERSION=!(bind.FileVersion.ChildConsole.exe)?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:Dep="http://schemas.microsoft.com/wix/DependencyExtension">
<Product Id="*" Name="ChildInstaller" Language="1033" Version="$(var.VERSION)" Manufacturer="Child Entity" UpgradeCode="6607f3eb-256f-44d8-a7d5-efe6f21f07e4">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
@KevM
KevM / recipe.md
Last active August 29, 2015 14:21
Future Stew

Future Stew

We made this for Foodie Night 05/24/2015 where the theme was food through the ages. We selected the age of the future. Our premise was that, in the future, meat would be scarce or out of favor and in vogue would be to dine from the harvest of hydroponically grown veggies. We created a stew that is mostly based on a Chinese hot pot recipe edited to include extra tasty veggies.

The main things we did different was to cook the tofu separately and add it to the top of the stew.

You may want to add a bit more stock if you like your stew to be more soupy as quite a lot of broth gets absorbed by the noodles and potatoes.

We added some completely optional far out garnish of Star Fruit and Rambutan in addition to attractive micro-arugula.

@KevM
KevM / measureme.cs
Created February 18, 2015 19:47
Wrote this quick little performance testing harness. Guessing this is a C# right of passage kind of thing.
public static void MeasureMe(Action action, int count=100, int warmup = 10, int runs = 1,string messageFormat = "It took {0}ms to do this.")
{
Enumerable.Range(0, warmup).Each(i =>
{
action();
});
Enumerable.Range(0, runs).Each(r =>
{
var watch = new Stopwatch();
@KevM
KevM / OutputXmlAttribute.cs
Created January 30, 2015 15:19
FubuMVC modify chain attribute example
[AttributeUsage(AttributeTargets.Method)]
public class OutputXml : ModifyChainAttribute
{
public override void Alter(ActionCall call)
{
call.ParentChain().AlterConnegOutput(c =>
{
c.ClearAll();
c.AddFormatter<XmlFormatter>();
});
@KevM
KevM / WebRegistry.cs
Created January 29, 2015 20:54
Make sure all your Bottle StructureMap registries are imported
public class WebRegistry : Registry
{
public WebRegistry()
{
//Your application's normal registries
IncludeRegistry<BootstrapRegistry>();
IncludeRegistry<SettingsProviderRegistry>();
//typical scanner type stuff
Scan(x =>
@KevM
KevM / CustomizedByAttribute.cs
Created January 28, 2015 21:40
Fubu attribute based action customization mechanism
[AttributeUsage(AttributeTargets.Method)]
public class CustomizedBy : ModifyChainAttribute
{
private readonly Type _customizerInputType;
private readonly Type customizerBehaviorOpenType = typeof(CustomizerBehavior<>);
public CustomizedBy(Type customizerInputType)
{
_customizerInputType = customizerInputType;
}