Skip to content

Instantly share code, notes, and snippets.

Youenn Bouglouan Youenn-Bouglouan

Block or report user

Report or block Youenn-Bouglouan

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
@Youenn-Bouglouan
Youenn-Bouglouan / install-git-town.sh
Last active Aug 25, 2017
Download and Install Git Town (Linux)
View install-git-town.sh
#!/bin/bash
#download version 4.2.1 of Git Town and install it to the desired folder below
eval installFolder='$HOME/bin2'
filename='git-town'
echo 'downloading Git Town (v4.2.1)...'
curl -L https://github.com/Originate/git-town/releases/download/v4.2.1/git-town-linux-amd64 -o $filename
mkdir -p $installFolder
echo 'moving Git Town to' $installFolder
mv $filename $installFolder
@Youenn-Bouglouan
Youenn-Bouglouan / sample.fs
Created Aug 17, 2017
Akka.NET / Handling messages in F#
View sample.fs
open System
open Akka.Actor
open Akka.FSharp
type ActorAMessages =
| MessageA1 of name: string
| MessageA2 of quantity: int
| MessageA3
type ActorBMessages =
@Youenn-Bouglouan
Youenn-Bouglouan / ShortCircuitingExceptionHandling.cs
Last active May 22, 2017
How to efficiently break your code by using exceptions? Example 2: short-circuiting exception handling
View ShortCircuitingExceptionHandling.cs
using System;
namespace FunWithExceptions
{
public class FolderCouldNotBeCreatedException : Exception
{
public FolderCouldNotBeCreatedException(string folderPath)
: base("Folder '" + folderPath + "' could not be created!")
{}
}
@Youenn-Bouglouan
Youenn-Bouglouan / PokemonExceptionCatching.cs
Last active May 22, 2017
How to efficiently break your code by using exceptions? Example 1: Pokemon exception catching
View PokemonExceptionCatching.cs
using System;
namespace FunWithExceptions
{
/*
* 'Vindigator' is an imaginary 3rd-party library that contains
* a lot of useful (if you're into the vindication business) APIs.
*/
public static class Vindigator
{
@Youenn-Bouglouan
Youenn-Bouglouan / Main.fs
Last active May 1, 2017
Websharper - issue with POST expecting a JSON body
View Main.fs
// Issue decribed here: http://websharper.com/question/82758/post-endpoint-with-a-json-body-cannot-be-reached
namespace HelloWebSharper
open WebSharper.Html.Server
open WebSharper
open WebSharper.Sitelets
module Site =
@Youenn-Bouglouan
Youenn-Bouglouan / Pizzas.fs
Last active Mar 16, 2017
C# pizzas versus F# pizzas. Which ones are tastier?!
View Pizzas.fs
open System
type PizzaRecipe() = class end
type PizzaOrder() = class end
type ColdPizza() = class end
type HotPizza() = class end
type PizzaDelivery() = class end
let order (size:string) (recipe:PizzaRecipe) =
PizzaOrder()
@Youenn-Bouglouan
Youenn-Bouglouan / AreYouPolish.fsx
Last active Mar 12, 2017
Let's F# tell us if you're surname is Polish!
View AreYouPolish.fsx
// Check out the associated blog post at:
// http://www.ybouglouan.pl/2017/03/are-you-polish-fharp-will-tell-us-probably/
open System
// -----------------------------------------------------------------------------------------------
/// Return the number of occurrences of a given char within a word (case-insensitive)
let countCharCI char word =
word
You can’t perform that action at this time.