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
@ademar
ademar / Dash.NET.Giraffe.Example.fsproj
Last active October 14, 2021 19:00
Dash Giraffe example
<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 October 14, 2021 04:03
Dash.NET interactive notebook example version 3
#!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 October 14, 2021 03:18
Dash.NET interactive notebook example version 2
#!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 October 14, 2021 00:55
Dash.NET interactive notebook example
#!fsharp
#r "nuget:Dash.NET.Interactive,0.2.0-alpha.3"
#!fsharp
open System.Net
// Download Iris dataset
let webClient = new WebClient()
### 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 February 25, 2017 19:54
Bitcoin mining profitability calculation
// 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
Verifying that "ademar.id" is my Blockstack ID. https://onename.com/ademar
#!/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 June 26, 2016 18:36
Logary plus Logstash
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 October 19, 2019 12:41
suave redirect to https webpart
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)