Skip to content

Instantly share code, notes, and snippets.

View fcallejon's full-sized avatar

Fernando Callejon fcallejon

  • Dublin, Ireland
  • 00:20 (UTC +01:00)
View GitHub Profile
@fcallejon
fcallejon / check.fsx
Last active November 26, 2023 18:54
Check Irish Garda E-Vetting
#r "nuget: FSharp.Data"
#r "nuget: FSharpPlus"
open System
open System.Threading.Tasks
open System.Net.Http
open FSharpPlus
open FSharp.Data
[<AutoOpen>]
@fcallejon
fcallejon / Aggregates.fs
Created November 22, 2023 12:57
F# | A very basic and awful event sourcing (with snapshot) implementation
open System.Threading.Tasks
type TaskResult<'T, 'E> = Task<Result<'T, 'E>>
module Task =
let inline map ([<InlineIfLambda>] f) t =
task {
let! r = t
return f r
}
@fcallejon
fcallejon / Load-AceStreamId.ps1
Last active April 13, 2022 21:05
AceStream, Docker and PS
# Requires -RunAsAdministrator
<#
Docker tiene que estar ejecutandose con TCP en el puerto 2375 habiliado
O deberas iniciar Docker y ejecutar el comando de abajo:
docker run -d -p 6878:6878 -p 8621:8621 -e allow_remote=1 jackwzh/acestream-server
Docker needs to be running with TCP enabled on port 2375 enabled
Or you need to start Docker and execute the command below:
docker run -d -p 6878:6878 -p 8621:8621 -e allow_remote=1 jackwzh/acestream-server
#>
@fcallejon
fcallejon / Dockerfile
Last active March 12, 2019 08:53
Some VSCode tasks and launch settings to ease docker usage
FROM microsoft/dotnet:2.2-sdk as build
ARG buildconfig
WORKDIR /app
COPY Service3.csproj .
RUN dotnet restore
COPY . .
RUN if [ "${buildconfig}" = "Debug" ]; then \
dotnet publish -o /publish -c Debug && \
echo "IN DEBUG MODE!!"; \
else \
@fcallejon
fcallejon / fsharp-101-pipes.fs
Created July 28, 2018 11:58
Continuation for the F#101
// REPL https://repl.it/@FernandoCallejo/FSharp101-Pipes
open System
// partially function application as we saw previously
let printItems items = printfn "%i"
// Basic Pipes
let items = [|35;66;1;0;83;9;217;3;8;-3;-12;09;2|]
printItems items |> ignore
@fcallejon
fcallejon / fsharp-101-bindings.fs
Last active July 27, 2018 18:26
Playing a bit with bindings, partial functions and composition
// Playing a bit with bindings, partial functions and composition
// REPL: https://repl.it/@FernandoCallejo/FSharp101-Binding
open System
// binding to a value
let toValue = 10
// binding to a method using an specific overload
let toAMethod = String.Format : _ * _ -> _
// create a method that calls the same overload