Skip to content

Instantly share code, notes, and snippets.

Steffen Forkmann forki

Block or report user

Report or block forki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SocketStop.fs
module SocketStop
open Microsoft.Azure.WebJobs
open System.Net.Http
open FSharp.Control.Tasks.ContextInsensitive
open Microsoft.Azure.WebJobs.Extensions.Http
open Microsoft.Extensions.Logging
open Microsoft.AspNetCore.Mvc
[<FunctionName("SocketStop")>]
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
You can’t perform that action at this time.