Skip to content

Instantly share code, notes, and snippets.

View andrewabest's full-sized avatar

Andrew Best andrewabest

View GitHub Profile
using System.Web.Optimization;
using LOR.PDCA.Web.Infrastructure;
namespace Foo.Bar.Baz
{
public class AppendApplicationVersion : IBundleTransform
{
private readonly IAppSettings _appSettings;
public AppendApplicationVersion(IAppSettings appSettings)
@davidfowl
davidfowl / dotnetlayout.md
Last active December 5, 2025 08:44
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@markryd
markryd / memprofiling.md
Last active August 22, 2016 18:36
Memory profiling with windbg
  • Start up windbg and attach (F6).
  • Make sure you pick the right version (x86/x64) and run as admin if your app is running as admin.
  • Make sure you have the microsoft symbol servers turned on in Visual Studio -> tools -> options -> debugging -> symbols

Load

.loadby sos clr

Dump the heap

@michaelnoonan
michaelnoonan / gist:5566257
Last active December 6, 2019 01:55
Stop Loss Kata
Stop Loss Kata (original source: https://gist.github.com/gregoryyoung/1500720)
Developing solutions when time is involved is tricky, but testing when time is involved is yet another problem.
A trailing stop loss is a term used in financial trading. For a very in depth explanation you can read here (http://www.investopedia.com/articles/trading/03/080603.asp) and here (http://en.wikipedia.org/wiki/Order_(exchange)#Stop_orders), however we do not need a huge amount of background in order to do the kata as we are going to limit the problem a bit.
Say you buy into a stock at $10. You want it to automatically get sold if the stock goes below $9 to limit your exposure. This threshold is set by subtracting 10% from the original position. The term "trailing" means that if the price goes up to $11 then the sell point becomes $10, if it goes up to $15 then the sell point becomes $14, maintaining the original 10% margin of $1.
The kata is to create something that implements a trailing stop loss and to do it with TDD.