Skip to content

Instantly share code, notes, and snippets.


Gustavo Guerra ovatsus

  • London, United Kingdom
View GitHub Profile
ovatsus / windowsPhoneToAndroidMessageImporter.fsx
Last active Jun 13, 2016
Windows Phone to Android message importer
View windowsPhoneToAndroidMessageImporter.fsx
#r "packages/FSharp.Data.2.3.0-beta1/lib/net40/FSharp.Data.dll"
#r "System.Xml.Linq.dll"
open System
open System.Text
open FSharp.Data
let androidSample = """
<smses count="40">
View html.fs
module Html =
type HtmlNode =
| HtmlElement of name:string * attribute:HtmlAttribute list
| HtmlText of content:string *parent:HtmlNode
and HtmlAttribute =
| HtmlAttribute of name:string * value:string * parent:HtmlNode
let createElement name attrs =
ovatsus / FootballStats.fsx
Last active Jan 1, 2016
Alternative implementation of Screen Scraping College Football Statistics (
View FootballStats.fsx
#r @"packages\FSharp.Data.2.0.0-alpha2\lib\net40\FSharp.Data.dll"
#r "System.Xml.Linq"
open System.Xml.Linq
open FSharp.Data
open FSharp.Data.Json
open FSharp.Data.Json.Extensions
open FSharp.Net
// Without Type Providers
View departures.html
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" ""><html xmlns="" xml:lang="en"><body><div class="page"><div class="header"><div class="hInner"><div class="hBar"><div id="div-gpt-ad-8507337232-0"></div></div><div class="title clr"><a href="/" class="logo"><img src="/img/nremed.png" alt="National Rail Enquiries" /></a></div></div></div><div class="header clr"><div class="header-panel clr"><h1>Live departure boards</h1><a class="rBtn" href="javascript:location.reload(true)"><img width="15" height="17" alt="Reload" src="/img/arrowcircle.gif" /></a></div></div><div class="pageCont"><table class="jDetails jDest"><tr><td class="label"><strong>22:44</strong></td><td colspan="2">London Bridge </td></tr><tr class="pb10"><td class="label">To:</td><td colspan="2">Orpington <small>Southeastern</small></td></tr></table><!-- <table class="jDetails jDest"><tr><td class="label"><strong>22:44<
ovatsus / gist:7608238
Created Nov 22, 2013
NuGet reference="false" proposal
View gist:7608238
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="" xmlns:xsd="">
<metadata xmlns="">
ovatsus / after
Created Jul 19, 2013
Fantomas #83
View after
(new CsvFile<_>(new Func<_, _, _>(fun (parent : obj) (row : string []) -> Operations.GetNonOptionalValue("Name", Operations.ConvertString(Operations.AsOption(row.[0])), Operations.AsOption(row.[0])), Operations.GetNonOptionalValue("Distance", Operations.ConvertDecimal("", Operations.AsOption(row.[1])), Operations.AsOption(row.[1])), Operations.GetNonOptionalValue("Time", Operations.ConvertDecimal("", Operations.AsOption(row.[2])), Operations.AsOption(row.[2]))),
new Func<_, _>(fun (row : _ * _ * _) ->
[|Operations.ConvertStringBack(Operations.GetOptionalValue(let x, _, _ = row
Operations.ConvertDecimalBack(, ,
Operations.GetOptionalValue(let _, x, _ = row
Operations.ConvertDecimalBack( O,
View CsvDataApiExperiment.fsx
#r "bin/v40/FSharp.Data.dll"
open FSharp.Data.Csv
open FSharp.Data.Csv.Extensions
let map f (csvFile:CsvFile) =
let headers = csvFile.Headers |> f |> String.concat ","
let data = csvFile.Data |> (fun row -> row.Columns |> f |> String.concat ",") |> String.concat "\n"
CsvFile.Parse(headers + "\n" + data)
let filter f (csvFile:CsvFile) =
ovatsus / gist:5354478
Last active Dec 16, 2015
WorldBank API
View gist:5354478
This file has been truncated, but you can view the full file.
class WorldBankDataProvider
static member GetDataContext: () -> WorldBankDataProvider+ServiceTypes+WorldBankDataService
class WorldBankDataProvider+ServiceTypes
class WorldBankDataProvider+ServiceTypes+WorldBankDataService : FDR.WorldBank.WorldBankData
member Countries: WorldBankDataProvider+ServiceTypes+Countries with get
member Regions: WorldBankDataProvider+ServiceTypes+Regions with get
member Topics: WorldBankDataProvider+ServiceTypes+Topics with get
ovatsus / CsvFile.fsx
Last active Aug 19, 2016
R <-> FSharp.Data comparison
View CsvFile.fsx
#r "packages/FSharp.Data.1.1.10/lib/net40/FSharp.Data.dll"
open FSharp.Data.Csv
open FSharp.Data.Csv.Extensions
let csv = CsvFile.Load("")
//What are the column names of the dataset?
ovatsus / scriptSetup.fsx
Created Sep 2, 2012 — forked from nrolland/scriptSetup.fsx
Script for loading dependencies in fsx file from a solution/project
View scriptSetup.fsx
//This script generates
//a file named __project.fsx, for each proejct which can be #load "__project.fsx" in script intending to use the same dependency graph as the code in VS
//a file named __solmerged.fsx, at the solution root which can be #load "__solmerged.fsx" in script intending to use the same dependency graph as the code in VS
//In both cases, this enforce that a script compiling in VS should work from within FSI
#r "System.Xml"
#r "System.Xml.Linq"