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
var Identity = function(x) { | |
this.__value = x; | |
} | |
Identity.of = function(x) { return new Identity(x); }; | |
Identity.of(3); | |
//=> Identity(3) | |
Identity.of('hotdogs'); |
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 Tennis | |
%default total | |
data Player = PlayerOne | PlayerTwo | |
Eq Player where | |
(==) PlayerOne PlayerOne = True | |
(==) PlayerOne PlayerTwo = False | |
(==) PlayerTwo PlayerOne = False |
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
let sequence = ["A";"C";"A";"C";"G";"A";"G";"C";"A";"G";"T"] | |
let numbers = [1;2;3;4;5] | |
let dnaTotals = List.fold(fun (a, c, g, t) char -> | |
match char with | |
| "A" -> (a + 1, c, g, t) | |
| "C" -> (a, c + 1, g, t) | |
| "G" -> (a, c, g + 1, t) | |
| "T" -> (a, c, g, t + 1) |
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
dnvm upgrade -r mono |
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
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.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
#!/bin/bash | |
git push $1 +HEAD:master | |
git fetch $1 | |
git push origin --tags |
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 static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
config.EnableCors(); // allow cross origin resource sharing | |
config.MapHttpAttributeRoutes(); // enable attribute routing | |
} | |
} |
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/FunScript/lib/net40/FunScript.dll" | |
#r "packages/FunScript.TypeScript.Binding.lib/lib/net40/FunScript.TypeScript.Binding.lib.dll" | |
[<ReflectedDefinition>] | |
module Program = | |
open FunScript.TypeScript | |
let main () = | |
Globals.window.alert("Hello, world!") |
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 | |
let allDuplicateChars (str : string) = | |
str.Replace(str.[0].ToString(), "") |> String.IsNullOrEmpty |
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
// src/fsharp/FSharp.Core/array.fs#L702-L706 | |
let mutable state = acc | |
let len = array.Length | |
for i = 0 to len - 1 do | |
state <- f.Invoke(state,array.[i]) | |
state |