Instantly share code, notes, and snippets.

View getNextInvoiceNo.fs
let rec getNextInvoiceNo (table:CloudTable) operatorID = task {
let rowKey = "invoiceno"
let query = TableOperation.Retrieve(operatorID, rowKey)
let! r = table.ExecuteAsync(query)
if r.HttpStatusCode <> 200 || isNull r.Result then
let entity = DynamicTableEntity()
entity.PartitionKey <- operatorID
entity.RowKey <- rowKey
let no = 1
View partition.fs
let queue1 = // ..
let chunkSize = 100
[<FunctionName("Start")>]
let run([<QueueTrigger("start")>]content:string, log:ILogger) =
let t = task {
let msgs =
[1..5000]
View gist:1c077fab9070585e66bda0aacd705804
let queue = // ..
[<FunctionName("MyFunction")>]
let run([<QueueTrigger("start")>]content:string, log:ILogger) =
let t = task {
let! _ =
[1..5000]
|> Seq.map (fun _ ->
View Test.fs
let queue = // ..
[<FunctionName("MyFunction")>]
let run([<QueueTrigger("start")>]content:string, log:ILogger) =
let t = task { =
for i in 1 .. 5000 do
let message = CloudQueueMessage(Newtonsoft.Json.JsonConvert.SerializeObject msg)
do! queue.AddMessageAsync(message)
View header.fs
let allTagsEndpoint =
pipeline {
plug (fun next ctx -> task {
let txt = TagList.Encoder tags |> Encode.toString 0
ctx.SetContentType ("application/json")
return! setBodyFromString txt next ctx
})
set_header "Content-Type" "application/json"
}
View tags.fs
get "/api/alltags" (fun next ctx -> task {
let tags = { Tags = [| { Token = "celeb" }|] }
let txt = TagList.Encoder tags |> Encode.toString 0
return! text txt next ctx
})
View build.fsx
let getFunctionApp projectName =
match projectName with
| "RenderInvoice.fsproj" ->
""
| "TransactionHandling.fsproj" ->
"ecartransactions"
| "OCPPStatus.fsproj" ->
"ocppstatus"
| "Accounting.fsproj" ->
View build.fsx
let getFunctionApp projectName =
match projectName with
| "RenderInvoice.fsproj" ->
""
| "TransactionHandling.fsproj" ->
"ecartransactions"
| "OCPPStatus.fsproj" ->
"ocppstatus"
| "Accounting.fsproj" ->
View usage.fs
module Client.TimeTable
open Elmish
open Elmish.Toastr
open Fable.Helpers.React
open Fable.Helpers.React.Props
open Shared
open Fulma
open Fable.PowerPack
open System
View TimeTableComponent.fs
module CalendarTimeline
open System
open Elmish
open Fable.Core.JsInterop
open Fable.Core
open Fable.Import
open Fable.Helpers.React
module R = Fable.Helpers.React