Skip to content

Instantly share code, notes, and snippets.


Jérémie Chassaing thinkbeforecoding

Block or report user

Report or block thinkbeforecoding

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
thinkbeforecoding / start.ps1
Created Oct 10, 2016
Github desktop for PS
View start.ps1
. $env:UserProfile\AppData\Local\GitHub\shell.ps1
Function Start-SSHAgent{
[string]$socketfile="/tmp/.ssh-socket", # Used as input to ssh-agent, which expects POSIX format paths
[string]$pidFile="$env:TEMP\.ssh-agent-pid" # Used as input to Out-File which expects Windows format paths
thinkbeforecoding / LogaryMetrics.fs
Created Sep 7, 2016
Sample to report timing metrics
View LogaryMetrics.fs
open Hopac
open Hopac.Infixes
open NodaTime
open Logary
open Logary.Metrics.Reservoirs
open Logary.Configuration
open Logary.Targets
open Metric
module PointName =
thinkbeforecoding / gist:11fd14096ccd4c28a4a0
Created Mar 11, 2016
Setup GitHub for windows in Powershell profile
View gist:11fd14096ccd4c28a4a0
. $env:UserProfile\AppData\Local\GitHub\shell.ps1
$r = ssh-agent -s
[regex]::Matches($r,"SSH_AUTH_SOCK=([^;]+);") | % { $env:SSH_AUTH_SOCK = $_.Groups[1] }
[regex]::Matches($r,"SSH_AGENT_PID=(\d+);") | % { $env:SSH_AGENT_PID = $_.Groups[1] }
ssh-add $env:UserProfile\.ssh\github_rsa
View Ukulele.fsx
# Ukulele
_This post is part of the [F# Advent Calendar in English 2015]( project._
_Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this._
Hi something fun and not too technical for end the year !
As everyone knows, the [favorite instrument of Santa Claus is Ukulele]( !
So let's play some music, and especialy some Ukulele !
thinkbeforecoding / Mindstorm.fsx
Created Jun 17, 2015
Mindstorm API in F# with the lego computation expression.
View Mindstorm.fsx
open System
open System.Threading.Tasks
open System.Text
type Opcode =
| UIRead_GetFirmware = 0x810a
| UIWrite_LED = 0x821b
| UIButton_Pressed = 0x8309
| UIDraw_Update = 0x8400
| UIDraw_Clean = 0x8401
View Async.fs
module Async
// Async extension to enable the direct use of Task<T> and Task
// in async {} blocs
open System
open System.Threading.Tasks
type Microsoft.FSharp.Control.Async with
View Server.fs
// This module implements AwaitTask for non generic Task
// It should be useless in F# 4 since it should be implemented in FSharp.Core
module AsyncExtensions =
open System
open System.Threading
open System.Threading.Tasks
type Microsoft.FSharp.Control.Async with
static member Raise(ex) = Async.FromContinuations(fun (_,econt,_) -> econt ex)
thinkbeforecoding / CodeHash.fs
Last active Aug 29, 2015
This creates a hash code of a F# Expr. The hash code changes when the code change
View CodeHash.fs
open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Quotations.Patterns
open System.Reflection
let hashList f seed = List.fold (fun h v -> h * 37 + f v) seed
let (<+) x y = x * 37 + y
let (!<) f x y = x <+ f y
let rec hashC funcs =
thinkbeforecoding / FsCluster.fs
Created May 20, 2014
EventStore cluster in a F# script !
View FsCluster.fs
This gist runs a 3 in memory node EventStore cluster
and a client that send messages to the cluster
To use the web interface, copy EventStore web folders.
You can found them in the server distribution at
Then connect to http://localhost:2113/
You can view the cluster status at:
View Actors.FSharp
#r @"C:\Development\GitHub\Pigeon\src\Pigeon\bin\Release\Akka.dll"
#r @"C:\Development\GitHub\Pigeon\src\Pigeon.FSharp\bin\Release\Akka.FSharp.dll"
open Akka.FSharp
open Akka.Actor
type IO<'msg> = | Input
type Cont<'m,'v> =
You can’t perform that action at this time.