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 TelegramWebApp = | |
open System.Security.Cryptography | |
open System.Text | |
open System.Web | |
let validateInitData botToken (initData: string) = | |
let items = | |
initData.Split "&" |> Array.map (fun x -> let p = x.Split("=") in (p[0], p[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
module ZenUtil | |
#r "nuget: NAudio" | |
#r "nuget: System.Speech" | |
open NAudio.Wave | |
open System | |
module WindowsSpeech = |
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
#r "nuget: FSharp.Data, 5.0.2" | |
open System | |
open System.Diagnostics | |
open FSharp.Data | |
open System.IO | |
let [<Literal>] feedUrl = "https://peapix.com/bing/feed" | |
type BingoImage = JsonProvider<feedUrl> | |
let out = Path.Combine(__SOURCE_DIRECTORY__, "bing") |
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
import murmur332 from './murmur332.js'; | |
// https://en.wikipedia.org/wiki/Bloom_filter | |
// https://hur.st/bloomfilter/ | |
export default class BloomFilter { | |
#data; | |
#dataBitMask; |
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
/** | |
* Performs Murmur3_32 hashing. | |
* https://en.wikipedia.org/wiki/MurmurHash | |
* @param key Int32Array input key | |
* @param seed int32 input seed | |
* @returns int32 value | |
*/ | |
export default function murmur332(key, seed) { | |
let hash = seed; |
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
using System; | |
using System.Console; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
def skip_loop(counter, skip, max, idx, lst) { | |
if (idx > max) lst | |
else | |
if ( counter >= skip ) | |
skip_loop(1, skip, max, idx + 1, idx :: lst) |
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
using System.Console; | |
def skip_loop(counter, skip, max, idx, lst) { | |
if (idx >= max) lst | |
else | |
if ( counter >= skip ) | |
skip_loop(1, skip, max, idx + 1, idx :: lst) | |
else | |
skip_loop(counter + 1, skip, max, idx + 1, lst) | |
} |
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 Microsoft.AspNetCore | |
open Microsoft.AspNetCore.Hosting | |
open Giraffe | |
WebHost | |
.CreateDefaultBuilder() | |
.UseKestrel() | |
.Configure(fun a -> a.UseGiraffe(route "/" >=> POST >=> bindJson json)) | |
.ConfigureServices(fun s -> s.AddGiraffe() |> ignore) | |
.Build() |
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
#r "mscorlib.dll" | |
#r "System.dll" | |
open System | |
open System.Windows.Forms | |
type Update<'Msg, 'Model> = 'Msg -> 'Model -> 'Model | |
type Dispatch<'Msg> = 'Msg -> obj -> EventArgs -> unit | |
type View<'Model, 'Msg> = 'Model -> Dispatch<'Msg> -> Control |
NewerOlder