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 OwinHttpListenerWithNancyFx | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Net; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Nancy; | |
| using Owin.Listener; |
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
| open System | |
| open System.Reflection | |
| open CommandLine | |
| open CommandLine.Text | |
| [<assembly: AssemblyCopyright("Copyright (c) 2013 Giacomo Stelluti Scala playing with FSharp")>] | |
| do() | |
| type options() = | |
| [<Option(HelpText = "Let your program talk a lot.")>] |
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
| public static IEnumerable<TResult> Pairwise<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TSource, TResult> selector) | |
| { | |
| if (source == null) | |
| { | |
| throw new ArgumentNullException("source"); | |
| } | |
| if (selector == null) | |
| { | |
| throw new ArgumentNullException("selector"); |
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
| static class DynamicComparer | |
| { | |
| public static bool DynamicEquals<T>(this T value, T other) | |
| { | |
| if (object.Equals(value, default(T))) | |
| { | |
| throw new ArgumentNullException("value"); | |
| } | |
| if (object.Equals(other, default(T))) |
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
| internal enum MaybeType { Just, Nothing } | |
| /// <summary> | |
| /// C# implementation of F# 'T option. Based on the one found in http://goo.gl/jMwzg. | |
| /// Here Haskell naming is used, to not create confusion with local option concept. | |
| /// </summary> | |
| internal abstract class Maybe<T> | |
| { | |
| private readonly MaybeType tag; |
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
| // Copyright 2015 Giacomo Stelluti Scala. All rights reserved. See doc/License.md in the project root for license information. | |
| package process | |
| /* | |
| #include <stdlib.h> | |
| #include "libproc.h" | |
| */ | |
| import "C" | |
| import "unsafe" |
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
| // Copyright 2015 Giacomo Stelluti Scala. All rights reserved. See doc/License.md in the project root for license information. | |
| package process | |
| /* | |
| #include <stdlib.h> | |
| #include "libproc.h" | |
| */ | |
| import "C" | |
| import "unsafe" |
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
| #!/bin/sh -x | |
| #This script removes Mono from an OS X System. It must be run as root | |
| rm -r /Library/Frameworks/Mono.framework | |
| rm -r /Library/Receipts/MonoFramework-* | |
| for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do | |
| (cd ${dir}; |
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
| (* | |
| * Minimal AssemblyInfo.fs for automatic help screen generation in Command Line Parser Library 2.0.x-pre. | |
| *) | |
| module YourProject.AssemblyInfo | |
| open System.Reflection | |
| [<assembly: AssemblyCopyright("Copyright (c) 2015 Your Name Here")>] | |
| do() |
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
| #region Partial application and Currying | |
| static class FuncHelper | |
| { | |
| public static Func<T2, T3, T4, TResult> ApplyPartial<T1, T2, T3, T4, TResult> | |
| (Func<T1, T2, T3, T4, TResult> function, T1 arg1) | |
| { | |
| return (b, c, d) => function(arg1, b, c, d); | |
| } | |
| public static Func<T2, T3, TResult> ApplyPartial<T1, T2, T3, TResult> |