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
$genDate = (Get-Date) | |
$startFrom = (Get-Date).AddMinutes(-30) | |
$events = Get-EventLog -LogName:Application -Source:"ASP.NET 2.0.50727.0" -After:$startFrom | |
if ($events){ | |
$body = New-Object System.Text.StringBuilder | |
if ($events.Count){ | |
$body.AppendFormat("Gents, please welcome {0} events.`n", $events.Count) | |
} else { | |
$body.Append("Gents, please welcome an event bellow.`n") |
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
form( | |
columns( | |
fields( | |
text("SKU", "SKU", required, max(40)), | |
text("Title", "Title", required) | |
) | |
), | |
wide( | |
rich("Description", "Description") | |
), |
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.Net | |
open System.Text | |
let listen url = | |
use listener = new HttpListener() | |
listener.Prefixes.Add(url) | |
listener.Start(); | |
let context = listener.GetContext() |
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.Net | |
open System.Net.Sockets | |
open System.Text | |
open System.IO | |
let listen port = | |
let listener = new TcpListener(IPAddress.Any, port) | |
listener.Start() | |
let client = listener.AcceptTcpClient() |
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
Seq.initInfinite(fun i -> listener.AcceptTcpClient()) | |
|> Seq.iter(fun client -> Async.Start (handle client)) | |
//or | |
while true do | |
let client = listener.AcceptTcpClient() | |
Async.Start (handle client) |
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 ``Calculator Div Operation Specification`` | |
open FsSpec | |
open Example.Sut | |
module ``Describe simple divide opertion`` = | |
let ``divide two integers`` = | |
let res = Calc.Div 2 2 | |
res.should_be_equal_to 1 |
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
// following is analog of the o => o.ContextID == ContextId; | |
var recordType = typeof(NventstoreProduct); | |
var recordParam = Expression.Parameter(recordType, "o"); | |
var recordContextIDProperty = Expression.Property(recordParam, | |
recordType.GetProperty("ContextID")); | |
var serviceType = typeof (Nventstore); | |
var thisContextIDProperty = Expression.Property(Expression.Constant(this, serviceType), |
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 versions = new Table(db, "__MoveVersions") | |
(** first version **) | |
versions.Columns.Add(new Column(versions, "Sequence", DataType.NVarChar(450))) | |
versions.Columns.Add(new Column(versions, "Version", DataType.NVarChar(450))) | |
versions.Columns.Add(new Column(versions, "PreviousVersion", DataType.NVarChar(450))) | |
versions.Columns.Add(new Column(versions, "LastUpdated", DataType.DateTime)) | |
(** or second version **) |
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
// Code | |
exception MyError of string | |
// and generate stuff | |
[Serializable, CompilationMapping(SourceConstructFlags.Exception)] | |
public class MyError : Exception, IStructuralEquatable | |
{ | |
internal string Data0@; |
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 Order = { | |
Number : string | |
Date : DateTime | |
Items : { | |
ProductSKU : string | |
Quantity : int | |
} list | |
} |