Skip to content

Instantly share code, notes, and snippets.

View KevM's full-sized avatar

Kevin Miller KevM

View GitHub Profile
@KevM
KevM / solution-load-times.md
Last active April 10, 2018 20:24
Large .Net Solution Load times

We have a large solution with about 69 projects. Here are the load times I measured in a very non-scientific way.

  1. I opened the IDE.
  2. Clicked on the solution in the MRU selection.
  3. Timed on my phone how long it took to get to a point where a file is editable.
  4. Did a warm up then repeated this 3 times for each configuraion.
App Version Detail Time Notes
@KevM
KevM / BootstrapService.cs
Created September 13, 2012 18:40
Example configuration of Topshelf to turn an console application into a Windows service
public class BootstrapService : ServiceControl
{
private readonly HostSettings _settings;
private Container _container;
private CaseMonitor _monitor;
public BootstrapService(HostSettings settings)
{
_settings = settings;
}
@KevM
KevM / endpoints.cs
Last active December 22, 2016 16:55
FubuContinuations do not redirect when a simple checkbox is present on the input model?
public class get_handler
{
public SignInModel Execute(SignInRequest request)
{
return new SignInModel {ReturnUrl = request.ReturnUrl, LoginFailed = request.LoginFailed};
}
}
public class post_handler
{
@KevM
KevM / regex.txt
Created November 19, 2016 23:27
Port Nuget packages to Paket Regex
Include="(.*\w)(\,\sVersion.*MSIL")>
Include="\1">
packages\\(.*[a-zA-Z])\.\d+((?:\.\d+){1,5})\\lib
packages\\$1\\lib
@KevM
KevM / Reactive.Config-readme.md
Last active November 19, 2016 11:50
Reactive Configuration

Reactive Configuration

Wouldn’t it be great to take a dependency on a Concrete POCO and know that it’s state is de-serialized from the most recent configuration settings for your system? Your IoC container could be configured to create Configured Types whose state is determined by potentially many Configuration Stores. Each store would source its configuration settings from a different location (env, appSettings, Consul). A Configuration Registry would setup the Configuration Stores in play and their precedence.

Having a robust, reactive, and easy to use configuration story is liberating and can be used as a foundation layer for additional functionality such as Feature Toggles and A/B testing.

Configuration Stores

Configuration stores are responsible for matching the key space for a Configured Type with the source of configuration backing them. Say a source backed by environment variables is asked if it is a source for the POCO whose full qualified namespace is Cald

@KevM
KevM / InputModel.cs
Last active October 14, 2016 20:17
FubuMVC: Model binding challenged. My scenario seems to be what the NestedObjectPropertyBinder was created for but I cannot get it working The endpoint using this input model is binding everything perfectly except the Address properties
public class SitePostRequest
{
public int DatabaseIdentifier { get; set; }
[Required]
public string SiteId { get; set; }
[Required]
public string Name { get; set; }
Once upon a time there was a junior developer who had a simple ticket
assigned to him to make a new checkbox. The straightforward implementation
required a schema change to implement. Being a fastidious fellow, he wanted to
follow the proper procedure and searched the wiki.
The wiki described a procedure that required he run a particular script against
the qa database server and add the output to his ticket. He looked over the
script and found that it would not run on his macOS box.
After editing the script so that it would run on his laptop, he submitted the
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