Skip to content

Instantly share code, notes, and snippets.

View ademar's full-sized avatar
👻
Building stuff

Ademar Gonzalez ademar

👻
Building stuff
View GitHub Profile
@mausch
mausch / gist:7706117
Last active December 29, 2015 17:39
Draft/pseudocode for HTML type provider
// https://twitter.com/mausch/status/406420573518970880
// compiles to ModelLayout -> XElement where ModelLayout = { title: string; script: XAttribute; bodyAttrs: XAttribute list; body: XElement }
type Layout = HTML<"""
<html>
<head>
<title><x:text id="title"/></title>
<script x:attr="script"></script>
</head>
<body x:attrs="bodyAttrs">
@dsyme
dsyme / gist:9b18608b78dccf92ba33
Last active November 1, 2022 18:11
Working self-contained getting-started sample for Suave Web Scripting
//==========================================
// Working fully self-contained getting-started example for Suave Web Server scripting
//
// Note you don't need to have _anything_ installed before starting with this script. Nothing
// but F# Interactive and this script.
//
// This script fetches the Paket.exe component which is referenced later in the script.
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been
// downloaded by the user (by executing the first part of the script) the reference
// shows as resolved and can be used.
@mrange
mrange / json_transform.md
Last active January 23, 2017 06:53
Monadic JSON Transformers in F#
@eulerfx
eulerfx / pfp.fs
Created November 9, 2016 18:16
Probabilistic functional programming F#
/// A probability is a number between 0 and 1 inclusive.
type Prob = float
/// A distribution is a sequence of outcome-probability pairs such that the
/// probabilities sum to 1.
type Dist<'a> = D of seq<'a * Prob>
/// A spread takes a sequence of elements and assigns probabilities.
type Spread<'a> = 'a list -> Dist<'a>
@p-alik
p-alik / cli requests to cardano-sl api
Last active September 10, 2020 07:36
list accounts, list wallet transactions history
# https://cardanodocs.com/technical/wallet/api/
# create a new wallet
$ curl -H "Content-Type: application/json" --cacert cardano-sl/scripts/tls-files/ca.crt https://localhost:8090/api/wallets/new -d '{
"cwInitMeta": {
"cwName": "my-cardano-wallet",
"cwAssurance": "CWAStrict",
"cwUnit": 0
},
"cwBackupPhrase": {
@druska
druska / engine.c
Created September 17, 2018 15:18
Quant Cup 1's winning order book implementation
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@ninjarobot
ninjarobot / RoadToFSharp.md
Last active June 2, 2020 09:21
How I ended up as an F# developer.

My Road to F#

I came from the OOP world, most of my professional work was in Java or C#. The languages were similar, and I could use them interchangably as I built software in each of them for several years. With enough experience in both, I was comfortable with either ecosystem and could generally be productive in either. Sometimes the job required one or the other. Sometimes the target OS constrained my choice to Java, which frustrated me a bit, because the languages were so similar, why would the runtime try to restrict a choice? I enjoyed writing server applications on Unix in college, and Linux afterwards, because the machines were so easy to configure compared to Windows machines that took a few hours to install and configure to get my software running. On Linux, I could type a handful of commands into a newly installed system and be up and running.

Sometime around 2005, Java had stagnated while C# was flourishing. They both released generics, but then C# came out with new features like