Skip to content

Instantly share code, notes, and snippets.

@MangelMaxime
MangelMaxime / fable-repl.fs
Created August 20, 2020 12:57
Created with Fable REPL
open Thoth.Json
open Fable.Core
open Fable.Core.JS
open Fable.Core.JsInterop
// Code copied from https://github.com/MangelMaxime/Fable.Geojson/blob/master/src/Geojson.fs
// REPL include Geojson library so I copy/paste the code in order to have equivalent
module GeoJson =
@MangelMaxime
MangelMaxime / fable-repl.css
Created April 14, 2020 20:13
Created with Fable REPL
.card.is-avatar {
max-width: 350px;
margin: auto;
}
.card.is-avatar .card-image {
display: flex;
justify-content: center;
align-items: center;
padding: 25px 0 0;
}
@MangelMaxime
MangelMaxime / fable-repl.css
Created August 1, 2019 15:36
Created with Fable REPL
html,
body {
font-size: 16px;
}
@MangelMaxime
MangelMaxime / fable-repl.css
Created July 15, 2019 10:17
Created with Fable REPL
html,
body {
font-size: 16px;
}
@MangelMaxime
MangelMaxime / fable-repl.css
Created June 27, 2019 13:51
Drag & Drop using Elmish and React hooks
html,
body {
font-size: 16px;
}
@MangelMaxime
MangelMaxime / fable-repl.css
Created June 26, 2019 20:11
"Pure Elmish" implementation of TIME FLIES LIKE AN ARROW example
html,
body {
font-size: 16px;
}
.main-container {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
@MangelMaxime
MangelMaxime / fable-repl.css
Last active June 26, 2019 19:32
Showcase throttle on input from view
html,
body {
font-size: 16px;
}
.main-container {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
@MangelMaxime
MangelMaxime / Main.fs
Created May 16, 2019 09:16
Demontraste how to store a section of a JSON without decoding/validating it
module Tests.Main
open Expecto
open Util.Testing
open Thoth.Json.Net
let json =
"""
{
"name": "Test HTTP Scenario",
@MangelMaxime
MangelMaxime / Http.fs
Created March 26, 2019 15:43
Http.fs - Demonstrate a way to retry fetching a new access token when old one expired
[<RequireQualifiedAccess>]
module Http
open Fable.Import
open Fable.PowerPack
open Fable.PowerPack.Fetch
open Thoth.Json
open Fable.Core.JsInterop
type User =
@MangelMaxime
MangelMaxime / Async.hx
Last active February 3, 2021 10:14
Demonstrate how to use native async/await from JavaScript with haxe.
package async;
#if macro
import haxe.macro.Context;
#end
class Async {
public static macro function async(expr:haxe.macro.Expr) {
expr = Context.storeTypedExpr(Context.typeExpr(expr));
return macro untyped __js__("(async {0})", ${expr})();