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
private static T RunSync<T>(Func<Task<T>> task) | |
{ | |
var oldContext = SynchronizationContext.Current; | |
var synch = new ExclusiveSynchronizationContext(); | |
SynchronizationContext.SetSynchronizationContext(synch); | |
T ret = default(T); | |
synch.Post(async _ => | |
{ | |
try | |
{ |
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
cls | |
Write-Host "Checking NuGet" | |
$nugetPath = "$env:LOCALAPPDATA\NuGet\NuGet.exe" | |
if (!(Get-Command NuGet -ErrorAction SilentlyContinue) -and !(Test-Path $nugetPath)) { | |
if(! (Test-Path "$env:LOCALAPPDATA\NuGet")) | |
{ | |
Write-Host "Creating directory" |
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
#time "on" | |
#load "Bootstrap.fsx" | |
open System | |
open Akka.Actor | |
open Akka.Configuration | |
open Akka.FSharp | |
open Akka.TestKit | |
// #Using Actor |
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 not (File.Exists "paket.exe") then | |
let url = "https://github.com/fsprojects/Paket/releases/download/3.12.0/paket.bootstrapper.exe" in use wc = new System.Net.WebClient() in let tmp = Path.GetTempFileName() in wc.DownloadFile(url, tmp); | |
File.Move(tmp,"paket.bootstrapper.exe"); | |
System.Diagnostics.Process.Start("paket.bootstrapper.exe") |> ignore;; |
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/FParsec.1.0.2/lib/net40-client/FParsecCS.dll" | |
#r "../packages/FParsec.1.0.2/lib/net40-client/FParsec.dll" | |
open FParsec | |
open System | |
let test p str = | |
match run p str with | |
| Success(result, _, _) -> printfn "Success: %A" result | |
| Failure(errorMsg, _, _) -> printfn "Failure: %s" errorMsg |
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 CII.Mercury.CRM | |
{ | |
#region Namespaces | |
using System.Net; | |
using System.Web.Mvc; | |
#endregion | |
public class JsonErrorHandlerAttribute : FilterAttribute, IExceptionFilter |
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
using System; | |
using System.Collections; | |
using NHibernate.Context; | |
using NHibernate.Engine; | |
public class ThreadStaticMultiSession : MapBasedSessionContext | |
{ | |
[ThreadStatic] | |
private static IDictionary sessionFactories; |
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 Namespaces | |
using System; | |
using System.Data; | |
using NHibernate; | |
using NHibernate.SqlTypes; | |
using NHibernate.UserTypes; | |
#endregion |
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 Namespaces | |
using System; | |
using System.Data; | |
using NHibernate; | |
using NHibernate.SqlTypes; | |
using NHibernate.UserTypes; | |
#endregion |
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 LuceneExample | |
{ | |
#region Namespaces | |
using System; | |
using System.Globalization; | |
using Lucene.Net.Analysis.Standard; | |
using Lucene.Net.Documents; | |
using Lucene.Net.Index; |
NewerOlder