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
#res = a + 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
/* | |
for C# wish list | |
---------------- | |
partial implementation of interface while coding | |
(something can be done with DynamicMethod, IL generation | |
but I'd like a language feature) | |
*/ | |
interface IMyInterface { |
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 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 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> |
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
+ [pyenv:22] enable -f /usr/local/bin/../libexec/pyenv-realpath.dylib realpath | |
+ [pyenv:29] '[' -z '' ']' | |
++ [pyenv:31] type -p greadlink readlink | |
++ [pyenv:31] head -1 | |
+ [pyenv:31] READLINK=/usr/bin/readlink | |
+ [pyenv:32] '[' -n /usr/bin/readlink ']' | |
+ [pyenv:57] '[' -z /Users/giacomo/.pyenv ']' | |
+ [pyenv:60] PYENV_ROOT=/Users/giacomo/.pyenv | |
+ [pyenv:62] export PYENV_ROOT | |
+ [pyenv:65] '[' -z '' ']' |
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
[ | |
"Liam", | |
"Noah", | |
"William", | |
"James", | |
"Logan", | |
"Benjamin", | |
"Mason", | |
"Elijah", | |
"Oliver", |
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
// 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 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 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 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; |