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 class DynamicEntityExtensions | |
{ | |
public static string GetString(this DynamicEntity entity, string property) | |
{ | |
if (entity.Properties.Contains(property)) | |
return (string)entity[property]; | |
else | |
return null; | |
} |
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.IO | |
open System.Text.RegularExpressions | |
open System.Diagnostics | |
let (|Match|_|) pattern input = | |
let m = Regex.Match(input, pattern) | |
if m.Success then Some (List.tail [for g in m.Groups -> g.Value]) else None | |
let abcDeploy = @"\\cvsw90163\c$\Apps\ABC2\apache-tomcat-6.0.33\webapps\ABC" | |
let svc = @"c:\Program Files\Microsoft SDKs\Windows\v7.0a\bin\SvcUtil.exe" |
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
#!/usr/bin/perl | |
use strict; | |
use Data::Dumper; | |
use File::Find; | |
my $abc_deploy = '\\\\cvsw90163\\c$\\Apps\\ABC2\\apache-tomcat-6.0.18\\webapps\\ABC'; | |
my $svc_util = 'C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\SvcUtil.exe'; | |
my @files = (); |
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
module Program | |
open EasyNetQ | |
type MyMessage = { Message : string } | |
let bus = RabbitHutch.CreateBus("host=192.168.56.1") | |
bus.Subscribe<MyMessage>("FSharpTest", fun mesg -> printfn "%A" mesg.Message) | |
bus.Publish({ Message = "Hello world"}) |
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
(** | |
## References | |
As they aren't part of a project, fsx files need | |
to reference all of their dependencies within the | |
file. | |
You'll always want to reference FakeLib. VersionUpdater | |
is an inhouse tool we use for handling feature branch |
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.Collections.Concurrent | |
type JobRequest<'T> = | |
{ | |
Id : int | |
WorkItem : 'T | |
} | |
type WorkRequest<'T> = | |
| Job of JobRequest<'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
let inline doParallelWithThrottle limit f items = | |
use sem = new System.Threading.Semaphore(limit, limit) | |
items | |
|> Seq.map (fun element -> async { | |
sem.WaitOne() |> ignore | |
let result = Async.RunSynchronously <| async { return f element } | |
sem.Release() |> ignore | |
return result | |
}) | |
|> Async.Parallel |
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
let GetHintPath hintPathFromRoot root projFile = | |
let rootDir = DirectoryInfo(root) | |
let projDir = DirectoryInfo(Path.GetDirectoryName(projFile)) | |
let rec dirDiff (rootDir : DirectoryInfo) (currentDir : DirectoryInfo) levels = | |
if rootDir.FullName = currentDir.FullName then | |
levels | |
else | |
dirDiff rootDir (currentDir.Parent) (levels + 1) | |
hintPathFromRoot::[for _ in 1..(dirDiff rootDir projDir 0) -> ".."] | |
|> List.rev |
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 NuGet | |
open ReferenceManagement | |
open UnionArgParser | |
type Argument = | |
| [<MandatoryAttribute>] Action of string | |
| [<MandatoryAttribute>] ProjectFile of string | |
| [<MandatoryAttribute>] PackageId of string | |
| Version of string | |
with |
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
type DeliveryResult = | |
| Success of SuccessfulDelivery | |
| Bounce of Bounce | |
let TopicTest = Regex(@"Some relevant regex here", RegexOptions.Compiled) | |
let inline TryExtractTopic record = | |
let envId = ( ^a : (member EnvId : string) record) | |
match TopicTest.IsMatch(envId) with |
OlderNewer