Skip to content

Instantly share code, notes, and snippets.

View kmcginnes's full-sized avatar

Kris McGinnes kmcginnes

View GitHub Profile
@kmcginnes
kmcginnes / ActionNavigationLink.swift
Created February 7, 2020 01:44
ActionNavigationLink
@kmcginnes
kmcginnes / Bar Essentials.md
Created July 30, 2018 00:02
Bar Essentials

Bar Essentials

While buying all of this at once would be cost prohibitive, most people have the majority of these items already.

So use this as a guide to fill in the blanks and make some of the best cocktails short of spending $15 a drink in Uptown.

Equipment

Steer clear of bar kits and instead buy these items individually. You’ll get much higher quality equipment, which will make them much more enjoyable to use.

  • Mixing Glass
  • Hawthorne Strainer
@kmcginnes
kmcginnes / .hyper.js
Created April 27, 2017 15:10
Hyper console configuration
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
fontFamily: 'Consolas, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
var results = await new ProcessBuilder("some_command.exe")
.WithTimeout(TimeSpan.FromMinutes(5))
.WithArguments("/blah foo")
.WithPath(@"C:\bin")
.ExecuteAsync();
if(results.ExitCode == 0)
{
Console.WriteLine("Output:");
results.StandardOutput.ForEach(line => Console.WriteLine(line));
@kmcginnes
kmcginnes / gist:49c99c465c54e7519151
Last active August 29, 2015 14:18
OS X Reinstall Checklist

Before

  • Backup virtual machines
  • Backup data not in Dropbox or iCloud
  • Backup Projects folder
  • Deauthorize iTunes (why do I still have to do this???)
  • Save open Safari tabs in Dropbox

After

@kmcginnes
kmcginnes / gist:76d935abdd2a499fef1f
Created January 30, 2015 21:05
Test the Castle Windsor Container
public class describe_ioc_container
{
It should_be_able_to_resolve_all_registered_components = () =>
{
var bootstrapper = new AppBootstrapper(false);
var host = (IDiagnosticsHost) bootstrapper.Container.Kernel.GetSubSystem(SubSystemConstants.DiagnosticsKey);
var diagnostics = host.GetDiagnostic<IPotentiallyMisconfiguredComponentsDiagnostic>();
var handlers = diagnostics.Inspect();
@kmcginnes
kmcginnes / gist:9f9c473b5170dd32f1d0
Last active August 29, 2015 14:14
RecordedEvent List
context = context.AsNonChangeTrackingContext();
return context
.AsQueryable<RecordedEvent>()
.Include(x => x.EventStreams)
.AsExpandable()
.Where(where)
.OrderBy(orderByField, ascending)
.Skip((pageNumber - 1)*recordsPerPage)
.Take(recordsPerPage)
.Select(x => new RecordedEventProjection
@kmcginnes
kmcginnes / gist:bdd307fa7e05da232eb6
Last active August 29, 2015 14:14
Typical Test Packages C#
Install-Package AutoFixture.Xunit
Install-Package AutoFixture.AutoNSubstitute
Install-Package FluentAssertions
Install-Package xunit.runner.visualstudio -Prerelease -Version 0.99.9-build1021

Screens & Conductors

  • Dynamic Composition
  • Static Composition

Form Editing

  • Validation
  • Dirty Tracking
  • Guard Close
@kmcginnes
kmcginnes / gist:77ce87741f0bd8667689
Created May 21, 2014 01:26
WPF: Hide Close Button Behavior
public class WindowBehavior
{
static readonly Type OwnerType = typeof (WindowBehavior);
public static readonly DependencyProperty HideCloseButtonProperty =
DependencyProperty.RegisterAttached("HideCloseButton", typeof (bool),
OwnerType, new FrameworkPropertyMetadata(false,
new PropertyChangedCallback(HideCloseButtonChangedCallback)));
[AttachedPropertyBrowsableForType(typeof (Window))]