This file contains 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 WebSocket | |
// Appache 2.0 license | |
// References: | |
// [1] Proposed WebSockets Spec December 2011 http://tools.ietf.org/html/rfc6455 | |
// [2] John McCutchan (Google Dart Team Member) http://www.altdevblogaday.com/2012/01/23/writing-your-own-websocket-server/ | |
// [3] A pretty good Python implemenation by mrrrgn https://github.com/mrrrgn/websocket-data-frame-encoder-decoder/blob/master/frame.py | |
// [4] WebSockets Organising body http://www.websocket.org/echo.html | |
// [5] AndrewNewcomb's Gist (starting point) https://gist.github.com/AndrewNewcomb/711664 |
This file contains 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 Tsunami.Server | |
open System | |
open System.IO | |
open System.Linq | |
open System.Net | |
open System.Net.Sockets | |
open System.Text | |
open System.Threading | |
open System.Runtime.Serialization |
This file contains 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
open System.Net | |
open Microsoft.FSharp.Control.WebExtensions | |
open System.Diagnostics | |
open System | |
let fetch name (url:string) = | |
printfn "fetching %s" name | |
let uri = new System.Uri(url) | |
use webClient = new WebClient() | |
let stopwatch = Stopwatch() |
This file contains 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
#if run_with_bin_sh | |
# See why this works at http://stackoverflow.com/a/21948918/637783 | |
exec fsharpi --define:mono_posix --exec $0 $* | |
#endif | |
(* | |
* Crossplatform FSharp Makefile Bootstrapper | |
* Apache licensed - Copyright 2014 Jay Tuley <[email protected]> | |
* v 2.0 https://gist.github.com/jbtule/9243729 | |
* |
This file contains 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
#r @"packages\FAKE.2.1.309-alpha\tools\FakeLib.dll" | |
#r @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Build.Client.dll" | |
#r @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Client.dll" | |
open Fake | |
open Microsoft.TeamFoundation.Client | |
open Microsoft.TeamFoundation.Build.Client | |
open System |
This file contains 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
type MyType() = | |
member x.Stuff = 1 | |
member x.DoStuff() = x.Stuff | |
type IListLike<'T> = | |
abstract Enumerate : unit -> seq<'T> | |
type MyType with | |
member x.DoMore() = x.DoStuff() + 1 // this works | |
interface IListLike<int> with // this doesn't: All implemented interfaces should be declared on the initial declaration of the type |
This file contains 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
open System.Net.Sockets | |
type A = System.Net.Sockets.SocketAsyncEventArgs | |
type B = System.ArraySegment<byte> | |
exception SocketIssue of SocketError with | |
override this.ToString() = | |
string this.Data0 | |
/// Wraps the Socket.xxxAsync logic into F# async logic. |
This file contains 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 Owin | |
{ | |
public delegate void AppDelegate( | |
IDictionary<string, object> env, | |
IDictionary<string, string[]> headers, | |
Stream body, | |
ResultDelegate result, | |
Action<Exception> fault); | |
public delegate void ResultDelegate( |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir> | |
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath> | |
<NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath> | |
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig> | |
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir> | |
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir> |
This file contains 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
#r "System.Xml.Linq" | |
open System | |
open System.IO | |
open System.Xml.Linq | |
let script = seq { | |
//TODO: this currently loads fsproj's in alphabeticall order, we should instead | |
//build the dependencies graph of the fsproj's and load them in topological sort order |