Skip to content

Instantly share code, notes, and snippets.

View rflechner's full-sized avatar

Flechner Romain rflechner

View GitHub Profile
@rflechner
rflechner / nugets.cmd
Created May 15, 2018 17:17
meetup canopy
nuget install canopy -Version 2.0.1 -OutputDirectory packages -ExcludeVersion -Prerelease
nuget install Selenium.Chrome.WebDriver -Version 2.38.0 -OutputDirectory packages -ExcludeVersion
@rflechner
rflechner / training1.fsx
Created March 22, 2018 13:03
training fsharp 1
printfn "hello world"
open System.Runtime.InteropServices
let mutable name = "toto"
name <- "tata"
let display text =
printfn "%s" text
@rflechner
rflechner / lucene_dot_net.fsx
Last active November 10, 2017 18:59
Exploring Lucene in Fsharp
#I @"../../packages/Newtonsoft.Json/lib/net45/"
#I @"../../packages/Lucene.Net/lib/NET40/"
#r "Lucene.Net.dll"
open System
open System.IO
open System.Globalization
open Lucene
open Lucene.Net
let suffixedBy (suffix : string) baseSt = baseSt + suffix
let sayHello name = "Hello " + name
let toNode = // ?
let toBold = toNode "b"
let toBody= toNode "body"
let toParagraph= toNode "p"
let toHtml = toNode "html"
// Imperative style
@rflechner
rflechner / Script1.fsx
Last active September 17, 2017 14:31
FSharp TypeProviderKata
#I @"packages/SQLProvider/lib/"
#r "FSharp.Data.SqlProvider.dll"
open FSharp.Data.Sql
let [<Literal>] connectionString = "..."
let [<Literal>] resolutionPath = ""
type sql = SqlDataProvider<Common.DatabaseProviderTypes.MSSQLSERVER,
connectionString,
@rflechner
rflechner / install.bat
Created August 31, 2017 12:33
install mongod as a windows service
mkdir C:\mongodb
mkdir C:\mongodb\log
mkdir C:\mongodb\db
cd C:\mongodb
mongod.exe --install --config C:\mongodb\mongod.cfg
net start MongoDb
@rflechner
rflechner / fsharp-msbuild.fsproj
Created July 25, 2017 08:24
Workaround for FSharp build conditions
<!-- fix some build bugs -->
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<When Condition="'$(VisualStudioVersion)' == '15.0'">
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\F#\4.1\Framework\v4.0\Microsoft.FSharp.Targets') ">
@rflechner
rflechner / Result.cs
Last active June 23, 2017 15:39
C# railway oriented programming
namespace Finexkap.MicroServices.Salesforce.Models.Railway
{
public abstract class Result<T>
{
}
public class Success<T> : Result<T>
{
public Success(T model)
module BCM2835Interop
open System.Runtime.InteropServices
type FselMode =
| InputMode = 0us
| OutputMode = 1us
| BCM2835_GPIO_FSEL_ALT0 = 0x04us
| BCM2835_GPIO_FSEL_ALT1 = 0x05us
| BCM2835_GPIO_FSEL_ALT2 = 0x06us
| BCM2835_GPIO_FSEL_ALT3 = 0x07us
@rflechner
rflechner / GetSellers.sql
Last active January 19, 2023 02:33
How to store SQL files in assembly and execute them in C#
-- this file Embedded resource
SELECT * FROM "Sellers"