Skip to content

Instantly share code, notes, and snippets.

View scottlerch's full-sized avatar

Scott Lerch scottlerch

View GitHub Profile
// Useful for students in need of block quotes for their paper, etc.
// Execute the line in your JavaScript console
new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML;
javascript:new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML;
@scottlerch
scottlerch / Break
Created July 8, 2014 03:47
Fast conditional breakpoint
using System;
using System.Diagnostics;
public static class Break
{
[Conditional("DEBUG")]
public static void OnCondition(Func<bool> condition)
{
if (Debugger.IsAttached)
{
@scottlerch
scottlerch / Extensions.cs
Created August 16, 2012 01:58 — forked from slpsys/Extensions.cs
I do not know how I feel about this.
public static class Extensions
{
// Extension should be on IContainer not ITraceable for consistency when resolving objects
public static TTargetInterface ResolveTraceableDependency<TTargetInterface>(this IContainer container, ITraceConfig traceConfig)
{
return container.Resolve<TTargetInterface>(
TypedParameter.From<ITraceConfig>(traceConfig));
}
}