Skip to content

Instantly share code, notes, and snippets.

@GuyHarwood
GuyHarwood / BindGenericTypeImplementationsAutofac.cs
Created November 29, 2016 15:01
Bind Generic Type Implementations In Autofac
/*
If you have...
IAnInterface<T> where T : IAnotherInterface
and the interface is implemented by a base class, that the class inherits...
ThisType : TheBaseClass<TypeImplementingAnotherInterface>
rather than do...
@GuyHarwood
GuyHarwood / essential_libs.md
Last active May 9, 2019 19:20
just a list of libraries that are useful to automatically install into new projects

CS

  • Install-Package netfx-Guard
  • Install-Package NSubstitute (or Moq)
  • Install-Package xUnit
  • Install-Package AutoFixture
  • Install-Package AutoMapper
  • Install-Package SimpleInjector
  • Install-Package FluentMigrator
  • Install-Package GitVersion
@GuyHarwood
GuyHarwood / IIS_Parallels_OSX.md
Last active August 25, 2016 15:06 — forked from justingarrick/IIS_Parallels_Win8_Mac.md
Expose IIS or IISExpress running in a Parallels Windows VM to your OS X host

###Expose IIS or IISExpress running in a Parallels Windows VM to your OS X host

####Rename your virtual machine In your Windows VM, go to Control Panel > System > Advanced system settings > Computer Name and click Change. Name this whatever you like, e.g. devserver. Restart your VM.

####Add an ACL rule Open CMD or Powershell as administrator. Add a URL ACL entry for your new name on the port of your choice, e.g.
netsh http add urlacl url=http://devserver:8080/ user=everyone

####Add a firewall rule

/**
* Protect window.console method calls, e.g. console is not defined on IE
* unless dev tools are open, and IE doesn't define console.debug
*
* Chrome 41.0.2272.118: debug,error,info,log,warn,dir,dirxml,table,trace,assert,count,markTimeline,profile,profileEnd,time,timeEnd,timeStamp,timeline,timelineEnd,group,groupCollapsed,groupEnd,clear
* Firefox 37.0.1: log,info,warn,error,exception,debug,table,trace,dir,group,groupCollapsed,groupEnd,time,timeEnd,profile,profileEnd,assert,count
* Internet Explorer 11: select,log,info,warn,error,debug,assert,time,timeEnd,timeStamp,group,groupCollapsed,groupEnd,trace,clear,dir,dirxml,count,countReset,cd
* Safari 6.2.4: debug,error,log,info,warn,clear,dir,dirxml,table,trace,assert,count,profile,profileEnd,time,timeEnd,timeStamp,group,groupCollapsed,groupEnd
* Opera 28.0.1750.48: debug,error,info,log,warn,dir,dirxml,table,trace,assert,count,markTimeline,profile,profileEnd,time,timeEnd,timeStamp,timeline,timelineEnd,group,groupCollapsed,groupEnd,clear
*/
@GuyHarwood
GuyHarwood / typescript_angular.adoc
Created January 8, 2016 10:56 — forked from esfand/typescript_angular.adoc
AngularJS with TypeScript
@GuyHarwood
GuyHarwood / BoxstarterNewVm.txt
Created December 14, 2015 10:06
Boxstarter for new dev VM
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
cinst fiddler
cinst cmder
cinst sourcetree
cinst TortoiseGit
cinst winrar
cinst rdcman
cinst greenshot
cinst everything
cinst sysinternals
using Xunit;
namespace dnxDemo
{
public class Tests
{
[Fact]
public void Passing()
{
Assert.Equal(1,1);
@GuyHarwood
GuyHarwood / textarea.html
Created November 25, 2015 15:46
for steve...
<div class="form-group">
<label for="comments" class="control-label col-md-2">Comments</label>
<div class="col-md-10">
<textarea cols="20" class="form-control" id="Comments" name="Comments" rows="2"></textarea>
<span class="field-validation-valid text-danger" data-valmsg-for="Comments" data-valmsg-replace="true"></span>
</div>

Certificate wizard Choose "Web server SSL/TLS certificate"

generate strong password for private key

save private key as ssl.key open terminal and execute "openssl rsa -in ssl.key -out ssl.key" insert password generated above when prompted

select correct domain

@GuyHarwood
GuyHarwood / osx_dev.md
Last active March 3, 2016 20:30
OSX Dev Setup Notes

OSX dev config Notes

Notes compiled over the years, because we forget.

Colorised Git Output

> git config --global color.ui auto

Case insensitive auto-complete in Terminal