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
// FORK from : https://github.com/fsharp/FSharp.Data | |
// -------------------------------------------------------------------------------------- | |
// Helper operations for converting converting string values to other types | |
// -------------------------------------------------------------------------------------- | |
open System | |
open System.Globalization | |
open System.Text.RegularExpressions |
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! table = container eset | |
let nextSegment callcc args ct = asyncSeq { | |
let execute (_, filter, records) = | |
let query = TableQuery () | |
query.TakeCount <- Option.toNullable records | |
let q = query.Where(filter) | |
table.ExecuteQuerySegmentedAsync ( q, fromContinue ct ) | |
match! catch execute args with | |
| Ok segmt -> | |
yield! segmt.Results |> Seq.map Ok |> AsyncSeq.ofSeq |
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
ostringstream param; | |
param << "\x4c\x1b\x47\x4c\x31\x2c\x30\x2c"; | |
param << string(3 - swidth.size(), '0') << swidth; | |
param << ","; | |
param << string(3 - sheight.size(), '0') << sheight; | |
param << ";"; | |
string cmd = param.str(); | |
write(f, cmd.c_str(), cmd.size()); |
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
#include <chrono> | |
#include <thread> | |
#include <cstdio> | |
#include <cstdint> | |
#include <iostream> | |
#include <algorithm> | |
#include <functional> | |
#include <random> | |
#include <chrono> |
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
msg { | |
let! xn = ApiSubmit ( API.GetWorker ) | |
match xn with | |
//match! User.Get with | |
| Ok data -> | |
yield StorageSave ( DataKey.User, data ) | |
| Error (e: FableUtil.FetchUtil.Response) -> | |
yield ApplicationError <| string e.Status + " " + e.StatusText |
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 Suave | |
open Suave.Filters | |
let subPath path (ctx:HttpContext) = | |
async { | |
let localPath = ctx.request.url.LocalPath | |
let result = | |
match (localPath.StartsWith(path)) with | |
| false -> None |
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.Linq; | |
using System.Resources; | |
public class MakeResource | |
{ | |
public static void Run(string file, string[] resources) | |
{ | |
var strt = resources; | |
// Define a resource file. |
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
$strings = @( "file1.bin", "file2.bin", "file3.bin" ) | |
# Compile the code | |
function escape() { process { "@`"$_`"" } } | |
$source = @" | |
using System.Resources; | |
public class MakeResource | |
{ | |
public static void Main(string[] args) |
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
# ls -Recurse -Include *.d.ts | % { " declare module $((($_.Name) -split "[.]")[0]) { " ;gc $_; "}" } | Set-ClipBoard | |
node .\ts2fable\build\ts2fable.js material-ui-pickers\lib\build\index.d.ts src\material_ui_pickers.fs -e material-ui-pickers react react-dom material-ui |
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 patchRequest (r: RequestEventArgs) = | |
let filter (s: string) = s.Replace ( "\"", "" ) | |
let doc = using (new MemoryStream ()) <| fun ms -> | |
let xw = System.Xml.XmlWriter.Create ms | |
r.RequestInformation.WriteXml xw | |
xw.Flush () | |
ms.Position <- 0L |