Skip to content

Instantly share code, notes, and snippets.

@MangelMaxime
MangelMaxime / App.fs
Created July 19, 2018 11:37
Example usage of vis.js with Fable
module Client
open Fable.Core
open Fable.Core.JsInterop
open Fable.Import
importSideEffects "vis/dist/vis.css"
[<Import("*", "vis")>]
@MangelMaxime
MangelMaxime / Example.fs
Created October 24, 2017 12:35
Fable.Helpers.ReactLeaflet
open Fable.Helpers.React
open Fable.Helpers.React.Props
module RL = Fable.Helpers.ReactLeaflet
let group =
let truckTracks =
zones.paths
|> Array.map(fun path ->
let keyboardCaptureHandler (keyboard: Keyboard.Record) =
match keyboard.Modifiers with
| { Control = true } ->
match keyboard.LastKey with
| Keyboard.Keys.O ->
window2.Closed <- false
true // Key has been captured
| _ -> false
| _ ->
match keyboard.LastKey with
@MangelMaxime
MangelMaxime / MapboxGL.fs
Created July 20, 2017 12:12
Fable MapboxGL bindings
namespace Fable.Import
open System
open System.Text.RegularExpressions
open Fable.Core
open Fable.Import.JS
open Fable.Import.Browser
module Mapboxgl =
type [<AllowNullLiteral>] [<Import("Map","mapboxgl")>] Map(?options: MapboxOptions) =
inherit Evented()
@MangelMaxime
MangelMaxime / GeoJson.fs
Created July 15, 2017 21:46
Leaflet bindings for Fable
namespace Fable.Import
open System
open System.Text.RegularExpressions
open Fable.Core
open Fable.Import.JS
module GeoJSON =
type [<AllowNullLiteral>] GeoJsonObject =
abstract ``type``: string with get, set
(**
- title: Fable architecture sample
- tagline: Just a try to implement the Fable architecture over Pixi
- app-style: width:800px; margin:20px auto 50px auto;
- require-paths: `'PIXI':'https://cdnjs.cloudflare.com/ajax/libs/pixi.js/3.0.11/pixi.min'`
- intro: Just a try to implement the Fable architecture over Pixi. This is an experimentation for the moment
*)
#r "../../node_modules/fable-core/Fable.Core.dll"
#load "../../node_modules/fable-import-pixi/Fable.Import.Pixi.fs"
@MangelMaxime
MangelMaxime / fable-architecture.fs
Created September 7, 2016 18:40
RAF fable-architecture for pixi
(**
- title: Fable architecture sample
- tagline: Just a try to implement the Fable architecture over Pixi
- app-style: width:800px; margin:20px auto 50px auto;
- require-paths: `'PIXI':'https://cdnjs.cloudflare.com/ajax/libs/pixi.js/3.0.11/pixi.min'`
- intro: Just a try to implement the Fable architecture over Pixi. This is an experimentation for the moment
*)
#r "../../node_modules/fable-core/Fable.Core.dll"
#load "../../node_modules/fable-import-pixi/Fable.Import.Pixi.fs"
namespace Fable.Import.KeyboardJS
open System
open Fable.Core
open Fable.Import.JS
open Fable.Import.Browser
type [<AllowNullLiteral>] KeyEvent =
abstract preventRepeat: unit -> unit
and Callback =
@MangelMaxime
MangelMaxime / cmd outuput
Created August 26, 2016 12:22
Fable output from fsproj with pixi.js
[WARNING] The value 'crossorigin' is unused (L909,85-L909,96) (Fable.Import.Pixi.fs)
[WARNING] The value 'scaleMode' is unused (L909,105-L909,114) (Fable.Import.Pixi.fs)
[WARNING] The value 'renderer' is unused (L911,44-L911,52) (Fable.Import.Pixi.fs)
[WARNING] The value 'texture' is unused (L911,89-L911,96) (Fable.Import.Pixi.fs)
[WARNING] The value 'forcePowerOfTwo' is unused (L911,108-L911,123) (Fable.Import.Pixi.fs)
[WARNING] The value 'point' is unused (L912,36-L912,41) (Fable.Import.Pixi.fs)
[WARNING] The value 'v' is unused (L920,74-L920,75) (Fable.Import.Pixi.fs)
[WARNING] The value 'v' is unused (L924,74-L924,75) (Fable.Import.Pixi.fs)
[WARNING] The value 'v' is unused (L925,75-L925,76) (Fable.Import.Pixi.fs)
[WARNING] The value 'v' is unused (L926,75-L926,76) (Fable.Import.Pixi.fs)
#r "../node_modules/fable-core/Fable.Core.dll"
#load "libs/Parser.fsx"
#load "Helpers.fsx"
namespace Herebris.BridgeStream
open Fable
open Fable.Import
open Fable.Import.Browser