Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
Building stuff

Ademar Gonzalez ademar

👻
Building stuff
View GitHub Profile
View Dash.NET.Giraffe.Example.fsproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<WarnOn>3390;$(WarnOn)</WarnOn>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
@ademar
ademar / iris-sample-3.dib
Created Oct 14, 2021
Dash.NET interactive notebook example version 3
View iris-sample-3.dib
#!fsharp
#r "nuget:Dash.NET.Interactive,0.2.0-alpha.4"
#!fsharp
#r "nuget: FSharp.Data"
open FSharp.Data
let [<Literal>] Csv = "https://raw.githubusercontent.com/plotly/datasets/master/iris-id.csv"
type CsvData = CsvProvider<Csv>
@ademar
ademar / iris-sample.dib
Created Oct 14, 2021
Dash.NET interactive notebook example version 2
View iris-sample.dib
#!fsharp
#r "nuget:Dash.NET.Interactive,0.2.0-alpha.4"
#!fsharp
open System.Net
// Download Iris dataset
let webClient = new WebClient()
@ademar
ademar / iris-sample.dib
Created Oct 14, 2021
Dash.NET interactive notebook example
View iris-sample.dib
#!fsharp
#r "nuget:Dash.NET.Interactive,0.2.0-alpha.3"
#!fsharp
open System.Net
// Download Iris dataset
let webClient = new WebClient()
View gist:c9d7b9a0b62785606bac20563a7a6c25
### Keybase proof
I hereby claim:
* I am ademar on github.
* I am ademar (https://keybase.io/ademar) on keybase.
* I have a public key whose fingerprint is 1EBA 8095 9E88 913B 7D5C ADC3 5882 6291 9525 EFE7
To claim this, I am signing this object:
@ademar
ademar / profit.fs
Created Feb 25, 2017
Bitcoin mining profitability calculation
View profit.fs
// Units of measure
[<Measure>] type USD
[<Measure>] type BTC
[<Measure>] type sec
[<Measure>] type hour
[<Measure>] type H
[<Measure>] type GH
[<Measure>] type Watt
[<Measure>] type KW
View gist:2224028db76628d567917d223e776d10
Verifying that "ademar.id" is my Blockstack ID. https://onename.com/ademar
View btc-metcalfe.py
#!/usr/bin/env python
# Wikipedia: https://en.wikipedia.org/wiki/Metcalfe%27s_law
import numpy as np
from matplotlib import pyplot as plt
import urllib
def g(u):
return urllib.urlopen(u).readlines()
@ademar
ademar / file.fs
Last active Jun 26, 2016
Logary plus Logstash
View file.fs
open Logary
open Logary.Configuration
open Logary.Targets
open Hopac
let logstashConf = Logstash.LogstashConf.create("tcp://127.0.0.1:1939")
let pointName = PointName.ofSingle "logstash"
let logary =
@ademar
ademar / gist:f4ddb788162dbdd9e104574e2accf07f
Last active Oct 19, 2019
suave redirect to https webpart
View gist:f4ddb788162dbdd9e104574e2accf07f
let redirectToSsl : WebPart =
context(fun c ->
if not c.runtime.matchedBinding.scheme.secure
then
let uriBuilder = new UriBuilder(c.request.url)
uriBuilder.Scheme <- Uri.UriSchemeHttps
Redirection.redirect (uriBuilder.Uri.ToString())
else never)