https://gist.github.com/Luiz-Monad/c7a0a05077619b1b15cd
https://gist.github.com/Luiz-Monad/4303fc25c8f98feaf3f8fd07f24a9425
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. |
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 |
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 |
#include <chrono> | |
#include <thread> | |
#include <cstdio> | |
#include <cstdint> | |
#include <iostream> | |
#include <algorithm> | |
#include <functional> | |
#include <random> | |
#include <chrono> |
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()); |
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 |
// 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 |
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
public static class MainClazz { | |
[DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | |
static extern bool OpenProcessToken( | |
IntPtr ProcessHandle, | |
UInt32 DesiredAccess, |
(() => { | |
const i = require('inspector') | |
const l = i.console.log | |
const w = i.console.warn | |
const C = console.Console | |
const c = new C({inspectOptions: {depth: 0}, stdout: console._stdout, stderr: console._stderr}) | |
c.Console = C | |
c.log = (...a) => { l.apply(i, a); C.prototype.log.apply(c, a) } | |
c.warn = (...a) => { w.apply(i, a); C.prototype.warn.apply(c, a) } | |
console.log = c.log |