Skip to content

Instantly share code, notes, and snippets.

View brandedoutcast's full-sized avatar
🔥

R2 brandedoutcast

🔥
View GitHub Profile
@bent-rasmussen
bent-rasmussen / Actor.fs
Last active September 12, 2023 04:23
Experimental high performance actor implementation for F# using channel and task computation expression.
// NOTE: import this Nuget package: TaskBuilder.fs (written using 2.1.0)
//
// Tested in LINQPad (hence Dump method usage).
open System
open System.Collections
open System.Collections.Generic
open System.Diagnostics
open System.Linq
open System.Threading
@jhewlett
jhewlett / HttpClient.FSharp.fs
Last active May 14, 2023 15:42
Functional wrapper around System.Net.Http.HttpClient. Inspired in part by Http.fs (https://github.com/haf/Http.fs) and FSharp.Data (https://fsharp.github.io/FSharp.Data/library/Http.html)
namespace HttpClient.FSharp
open System
open System.Net.Http
type HttpMethod =
| Post
| Put
| Delete
| Get
@adamralph
adamralph / ci.md
Last active September 9, 2019 21:58
My current assessment of SaaS CI systems

This assessment is performed with respect to the requirements of the .NET community open source projects which I maintain. It is restricted to the free tier provided by each system.

Only the drawbacks are listed, which makes the assessment sound a bit negative, but it's relative to a baseline functional expectation:

  • Linux and Windows
  • Fast provisioning
  • Concurrent builds
  • Common build properties surfaced as env vars (e.g build number)
  • Readable, copyable, and line-linkable log output, supporting ANSI colour codes and code page 437
@swlaschin
swlaschin / effective-fsharp.md
Last active June 16, 2024 18:41
Effective F#, tips and tricks

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges

@Godofbrowser
Godofbrowser / axios.refresh_token.1.js
Last active April 26, 2024 12:57 — forked from culttm/axios.refresh_token.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
@Waltibaba
Waltibaba / lxc_mount_block_device
Last active April 26, 2024 04:13
Mount a block device like HDD inside an LXC container (specifically in proxmox 4)
Mounting block device in lxc (specifically Proxmox 4)
1. Find devices' major & minor ID (need both dev + partition for HDD)
# ls -al /dev/sda
brw-rw---- 1 root disk 8, 0 Dec 19 11:16 /dev/sda1
# ls -al /dev/sda1
brw-rw---- 1 root disk 8, 1 Dec 19 11:16 /dev/sda1
That's 8,0 for sda and 8,1 for sda1
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active May 19, 2024 18:56
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@staltz
staltz / introrx.md
Last active July 2, 2024 03:45
The introduction to Reactive Programming you've been missing
@anth-3
anth-3 / passThruProxy.cs
Last active April 24, 2019 11:18
Defines a simple pass-through proxy interface for C#.NET (IIS) Server applications and web sites.
<%@ WebHandler Language="C#" Class="PassThruProxy" Debug="true" %>
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Web;
/**
* <summary><c>PassThruProxy</c> is a simple pass-through proxy interface for C#.NET (IIS Servers).</summary>
@gbraad
gbraad / README.md
Last active September 7, 2023 11:57
The core algorithm/TOTP implementation used by GAuth: http://github.com/gbraad/gauth/, https://gauth.apps.gbraad.nl