Skip to content

Instantly share code, notes, and snippets.

View SimonCropp's full-sized avatar

Simon Cropp SimonCropp

View GitHub Profile
public static class Log
{
public static void Debug(string message)
{
throw new NotImplementedException();
}
public static void Debug(string message, Exception exception)
{
throw new NotImplementedException();
}
Using
public class Log
{
public static Log With
{
get
{
throw new NotImplementedException();
}
@SimonCropp
SimonCropp / gist:4214439
Created December 5, 2012 10:04
LogParamsOnException
Before
public class SimpleClass
{
[LogToDebugOnException]
void Method1(string param1, int param2)
{
//Do Stuff
}
public object ToDebugWithReturnAndTC(string param1, int param2)
{
try
{
throw new Exception("Foo");
}
finally
{
Debug.WriteLine("finally");
}
There is at least one non-shared VCS root in this build configuration.
To move this build configuration attached VCS roots need to be shared
but you do not have enough permissions to share them. Move operation
is not possible.
@SimonCropp
SimonCropp / gist:4984933
Last active December 13, 2015 22:29
Full rebuild of NServiceBus with Nuget package restore (first) and Pepita package restore (second)
With Nuget.exe
Line 2173: 219 ms RestorePackages 1 calls
Line 8549: 162 ms RestorePackages 1 calls
Line 13958: 166 ms RestorePackages 1 calls
Line 16610: 433 ms RestorePackages 1 calls
Line 19297: 232 ms RestorePackages 1 calls
Line 22442: 162 ms RestorePackages 1 calls
Line 27069: 162 ms RestorePackages 1 calls
Line 29766: 160 ms RestorePackages 1 calls
System.Threading.ThreadStateException : Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.
at System.Windows.OleServicesContext.SetDispatcherThread()
at System.Windows.OleServicesContext.get_CurrentOleServicesContext()
at System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
at ApprovalTests.Reporters.ClipboardReporter.Report(String approved, String received)
at ApprovalTests.Approvers.FileApprover.ReportFailure(IApprovalFailureReporter reporter)
at ApprovalTests.Core.Approvals.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer, IApprovalNamer namer, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer)
at ApprovalTests.Xml.XmlApprovals.VerifyText(String text, String fileExtensionWithoutDot, Boolean safely)
// * Dont need [ImplementPropertyChanged] since it will be detected from the base class
// * Namespaces are noise. dont use them
// * use fielder so you dont need properties https://github.com/Fody/Fielder
// * I prefer property injection. simply less code
// * fields allow me to initialise them outside the constructor
public class FirstViewModel : MvxViewModel
{
public ICalculationService CalculationService;
public double Generosity = 20;
@SimonCropp
SimonCropp / gist:6069460
Created July 24, 2013 10:23
posts by category in jekyll
{% for category in site.categories %}
<b>{{category[0]}}</b>
<ul>
{% for post in category[1] %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
2013-08-22 | 08:11:11 PM +10 | INFO | App: Bootstrapper started
2013-08-22 | 08:11:14 PM +10 | WARN | POCOObservableForProperty: Shimmer.WiXUi.Views.WelcomeView is a POCO type and won't send change notifications, WhenAny will only return a single value!
2013-08-22 | 08:11:14 PM +10 | WARN | POCOObservableForProperty: NuGet.ZipPackage is a POCO type and won't send change notifications, WhenAny will only return a single value!
2013-08-22 | 08:11:15 PM +10 | WARN | POCOObservableForProperty: Shimmer.WiXUi.Views.InstallingView is a POCO type and won't send change notifications, WhenAny will only return a single value!
2013-08-22 | 08:11:16 PM +10 | INFO | App: Bootstrapper finishing
2013-08-22 | 08:11:32 PM +10 | INFO | App: Bootstrapper started
2013-08-22 | 08:11:34 PM +10 | INFO | App: Bootstrapper finishing