-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple bridge to allow capturing of LibLog log messages in xUnit 2.0 tests | |
// Usage: | |
private readonly ITestOutputHelper _outputHelper; | |
public Example(ITestOutputHelper outputHelper) { _outputHelper = outputHelper; } | |
[Test] | |
public void Test() | |
{ | |
using (LogHelper.Capture(_outputHelper, LogProvider.SetCurrentLogProvider)) | |
{ | |
// Call library code, log messages will be captured |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Samples.FSharp.StringTypeProvider | |
open System | |
open System.Reflection | |
open Samples.FSharp.ProvidedTypes | |
open Microsoft.FSharp.Core.CompilerServices | |
open Microsoft.FSharp.Quotations | |
[<TypeProvider>] | |
type StringTypeProvider(config: TypeProviderConfig) as this = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To include a library as a subtree, follow these steps: | |
1. Add the project as a remote | |
git remote add <remote-name> <source-repo> | |
2. Fetch the remote | |
git fetch <remote-name> | |
3. Add the project | |
git subtree add --prefix "path/to/project" <remote-name> <remote-branch-name> --squash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I wasn't able to find a single example on how to actually use Dapper's new TVP, so I though I'd add one. | |
First of all, you will need to install the Dapper.TVP package from NuGet. | |
The main item to note is the need to create and populate a list of SqlDataRecords. This is then used to used as part of the | |
input parameter for Dapper's TableValueParameter. | |
The API is thus: |
- workout time
- most exercises will take 1:30-2:00 minutes ( with windsprint and rest )
- 3x through 8 of these will be roughly 45min
- windsprints between each workout ( roughly ~10-15 seconds, full speed )
- 30 seconds after each windsprint ( adjust accordingly to keep heart rate up )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Only let input Observable fire every 'n' seconds at most | |
// but unlike Throttle, items fire immediately when they aren't | |
// rate-limited. | |
public IObservable<T> RateLimit<T>(this IObservable<T> This, TimeSpan interval, IScheduler scheduler) | |
{ | |
var slot = default(IObservable<Unit>); | |
var input = This.Publish().RefCount(); | |
return input.Window(input, _ => { | |
if (slot != null) return slot; |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats