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
module Monad = | |
type M<'T,'B when 'B :> Sig<'B>> = | |
interface end | |
and Sig<'B when 'B :> Sig<'B>> = | |
abstract member Return<'X> : 'X -> M<'X,'B> | |
abstract member Bind<'X,'Y> : | |
M<'X,'B> -> ('X -> M<'Y,'B>) -> M<'Y,'B> |
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 INTERACTIVE | |
#r "Microsoft.CSharp.dll" | |
#endif | |
open System | |
open System.Dynamic | |
open System.Linq.Expressions | |
open System.Reflection | |
open System.Runtime.CompilerServices | |
open Microsoft.CSharp.RuntimeBinder |
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
load_assembly 'System.Core' | |
load_assembly 'System.CoreEx, Version=1.0.2521.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
load_assembly 'System.Reactive, Version=1.0.2521.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
using_clr_extensions System | |
using_clr_extensions System::Linq | |
include System | |
include System::Linq |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'yaml' | |
require 'cgi' | |
require 'bossman' | |
include BOSSMan | |
require 'igraph' |
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 | |
type Cont<'T> = | |
abstract Call<'R> : ('T -> 'R) * (exn -> 'R) -> 'R | |
let protect f x cont econt = | |
let res = try Choice1Of2 (f x) with err -> Choice2Of2 err | |
match res with | |
| Choice1Of2 v -> cont v | |
| Choice2Of2 v -> econt v |
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
// Load the TCP Library | |
net = require('net'); | |
// Keep track of the chat clients | |
var clients = []; | |
// Start a TCP Server | |
net.createServer(function (socket) { | |
// Identify this client |
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
// Func<IRequest, IResponse> | |
public interface IApplication { | |
IAsyncResult BeginInvoke(IRequest request, AsyncCallback callback, object state); | |
IResponse EndInvoke(IAsyncResult result); | |
} |
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 | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.IO; | |
public interface IResponseHandler | |
{ | |
Type TypeToHandle { get; } |
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
public Result App1(IDictionary<string, object> env) { | |
var request = new Request(env); | |
request.Logger.Info("Calling " + request.ScriptName); | |
return new Result( | |
200, | |
new Dictionary<string, object>{{"Content-Type","text/plain"}}, | |
new[]{"<p>You are looking at", request.ScriptName, "</p>"}); | |
} |
OlderNewer