Skip to content

Instantly share code, notes, and snippets.

View alfonsogarciacaro's full-sized avatar

Alfonso Garcia-Caro alfonsogarciacaro

View GitHub Profile
@whitetigle
whitetigle / navscroll.fs
Last active October 8, 2018 15:54
autoscroll + navbar
// types
module Types
open Fable.Import.Browser
let sectionHeaders = [
"#j1s1"
"#j2s1"
]
@whitetigle
whitetigle / deploy.md
Last active May 17, 2022 21:00
Deploying a Single Page Application to Gitlab

Deploying a Single Page Application to Gitlab

Last week I spent some time trying to deploy a SPA on Gitlab. It took me a few hours because the documentation even if complete was not that easy to read. (at least for me)

Preparation

The following steps are mostly taken from this guide

  1. Create an account in Gitlab (or use an existing one)
  2. Create a new git project to host your web site
@sgoguen
sgoguen / _about.md
Last active November 2, 2022 13:23
A Small Elm-like DSL in F#

Making Toys with F# - A Small Elm-like DSL in F#

A Small Elm-Like DSL in F#

I've been working on a talk about the virtues of building toy examples for the purpose of communicating ideas with simple interactive examples.

The toys I talk about in my presentation are based my interest in tools that allow programmers to quickly build web applications that allow them to explore their architecture. So to kickstart this series off, I want to introduce a simple

@whitetigle
whitetigle / Mapbox.fs
Last active June 12, 2017 14:58
Fable MapBox integration
// Updated version thanks to excellent post from Zaid Ajaj
// https://medium.com/@zaid.naom/f-interop-with-javascript-in-fable-the-complete-guide-ccc5b896a59f
namespace Leaflet
module L =
open Fable.Core.JsInterop
open Fable.Core
open System
open System.Collections.Generic
open Fable.Core
open Fable.Core.JsInterop
open Fable.Import.PIXI
open Fable.Import.PIXI.extras
open Fable.Import.Browser
open Fable.Import.JS
let options = [
@TheAngryByrd
TheAngryByrd / build.fsx
Last active September 18, 2016 01:52
Visual Studio Code mono debugging launch.json
//http://www.navision-blog.de/blog/2015/12/21/adding-background-tasks-to-suave-io-websites/
let startApp path =
let info = ProcessStartInfo(FileName = path)
let proc = new System.Diagnostics.Process(StartInfo = info)
start proc
proc

Comparison of ASP.NET and Node.js for Backend Programming

We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.

Updates

This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):

  1. Koa.js no longer uses co-routines, it has switched to Babel's async/await. yield and await are used almost in the same way, so I see no point to rewrite the examples.
@Thorium
Thorium / gulpfile.js
Last active August 29, 2015 14:11
JavaScript minifier for FunScript
// Put this file to your FunScript output folder.
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps');
var jsfile = {
targetPath: '',
//This is your FunScript-generated .js-file:
sources: ['generated.js']
@gusty
gusty / trampoline.fsx
Last active February 27, 2024 08:04
Trampolines in F#
let trampoline f c n =
let rec loop = function
| Choice1Of2 x -> x
| Choice2Of2 x -> loop (f x)
loop (Choice2Of2 (c,n))
// Test
let factorial n =
let rec factorialT (current, n) =
if n = bigint 0 then Choice1Of2 current