View basket.json
{
"albums": [
{
"id": "1234",
"price": {
"amount": 12,
"currency": "EUR",
"vatAmount": 2.4
}
}
View AsyncNamingConventionTests.cs
using System;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace MyProject.Tests
{
public class AsyncNamingConventionTests
{
[Fact]
View add-1.fs
let add a b = a + b
View ClassWithDependency.csx
public class Thing : IThing
{
public Thing(IDependency dependency) { }
public void Do(string arg) { }
}
View AwaitableCompositionSpike.cs
using System;
using System.Threading.Tasks;
namespace Monads
{
public static class AwaitableCompositionSpike
{
/// <summary>
/// First spike composes three aysnc results using Bind(..) extension method
/// </summary>
View FileCopy.cs
using (var inputStream = File.OpenRead(@"TestFiles/Example.txt"))
using (var outputStream = File.OpenWrite(@"TestFiles/Output.txt"))
{
inputStream.CopyTo(outputStream);
}
View first_attempt.fs
let private Main () =
// traverse that works for 'get' only
let traverse ((f1, f2): PLens<'a, 'b>): Lens<'a list, 'b list> =
(fun x -> x |> List.map f1 |> List.choose id),
(fun _ -> fun x -> x) // this doesn't work
let resourceMapLens =
Json.ObjectPLens
>??> mapPLens "links"
View Program.fs
open System
open System.IO
open System.Net
open System.Collections.Generic
open System.Threading.Tasks
let port = 8888
let endWithCompletedTask = fun x -> Task.FromResult(null) :> Task
type OwinEnvironment = {
View Program.fs
open System
open Microsoft.Owin.Hosting
[<EntryPoint>]
let main argv =
let baseAddress = "http://localhost:8888"
use application = WebApp.Start<Startup.Startup>(baseAddress)
View README.md

Example of a D3js time series graph with X,Y crosshairs and a threshold line. Just copy the drawLineGraph function and call it with your data. The data shoud be an array of two element arrays. Something like:

var data = [
    [new Date(2014, 01, 10), 404],
    [new Date(2014, 01, 11), 123],
    [new Date(2014, 01, 12), 666]
    ];
    
var warnLine = { lineValue: 200, label: 'my important threshold' };