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 EnumUtils | |
{ | |
public static IEnumerable<T> Values<T>() | |
{ | |
CheckTypeParamIsEnum<T>(); | |
return Enum.GetValues(typeof(T)).Cast<T>(); | |
} | |
public static T ToEnum<T>(int value) |
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
<!-- example msbuild target --> | |
<Target Name="TranslateCoverageXml"> | |
<ItemGroup> | |
<CoverageFiles Include="$(TestsDir)\*.opencover" /> | |
</ItemGroup> | |
<XslTransformation XmlInputPaths="%(CoverageFiles.Identity)" | |
XslInputPath="$(MSBuildProjectDirectory)\opencover_to_ncover.xslt" | |
OutputPaths="$(TestsDir)\%(CoverageFiles.FileName).ncover.xml" /> |
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
(defn combine-with-suffix | |
"same as riemann.streams/combine but takes a suffix argument to append to the service name" | |
[f suffix & children] | |
(combine f (adjust [:service str suffix] children))) | |
;java.lang.ClassCastException: clojure.lang.ArraySeq cannot be cast to clojure.lang.IFn | |
; at riemann.streams$combine$stream__8140$fn__8150.invoke(streams.clj:132) | |
; at riemann.streams$combine$stream__8140.invoke(streams.clj:132) | |
; at riemann.streams$moving_event_window$stream__8293$fn__8305.invoke(streams.clj:242) | |
; at riemann.streams$moving_event_window$stream__8293.invoke(streams.clj:242) |
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
function Rot47 { param ([string] $in) | |
$table = @{} | |
for ($i = 0; $i -lt 94; $i++) { | |
$table.Add( | |
"!`"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_``abcdefghijklmnopqrstuvwxyz{|}~"[$i], | |
"PQRSTUVWXYZ[\]^_``abcdefghijklmnopqrstuvwxyz{|}~!`"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO"[$i]) | |
} | |
$out = New-Object System.Text.StringBuilder | |
$in.ToCharArray() | %{ |
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.IO | |
open System.Text.RegularExpressions | |
let inputText = File.ReadAllText(__SOURCE_DIRECTORY__ + "/frankenstein.txt") | |
type Prefix = string list | |
type Suffix = string |
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 Akka.FSharp | |
open Akka.Persistence | |
open Akka.Persistence.FSharp | |
let system = System.create "sys" (Configuration.parse(""" | |
akka.persistence.view.auto-update = off | |
""")) |
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 Akkling | |
open Akkling.Persistence | |
type CounterChangedEvent = | |
{ Delta : int } | |
type CounterCommand = | |
| Inc | |
| Dec |