Skip to content

Instantly share code, notes, and snippets.

@jbtule
jbtule / haveibeenpwned.fsx
Last active September 18, 2020 04:36
This script uses the Troy Hunt's HaveIBeenPwned.com range api, to search for passwords
#!/usr/bin/env -S dotnet fsi --langversion:preview
(*
* This work (haveibeenpwned.fsx by James Tuley),
* identified by James Tuley, is free of known copyright restrictions
* Source: https://gist.github.com/jbtule/d98faec0abddea3d50180df54c33b617
* http://creativecommons.org/publicdomain/mark/1.0/
*
* This script uses the Troy Hunt's HaveIBeenPwned.com range api, to search for passwords,
* without revealing what you are searching for.
*
@jbtule
jbtule / Program.fs
Last active March 6, 2020 15:26 — forked from grishace/Program.fs
Benchmarking memory traffic from the while loop inside async CE
open System
open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Running
open BenchmarkDotNet.Jobs
open FSharp.Control.Tasks.V2
[<SimpleJob(RuntimeMoniker.NetCoreApp31); MemoryDiagnoser>]
type Test() =
[<Params(100, 1000, 10000)>]
@jbtule
jbtule / ReadCSVFile.cs
Last active March 4, 2020 02:07
CSVReader.ReadCSVFile
/*
CSVReader.ReadCSVFile
Ported from FSharp.Data into C#
Changes by James Tuley 3/3/2020
* Ported into C#
* Removes recursuion and adds mutation (since no tail call optimizaiton in c#)
Orignal Code:
@jbtule
jbtule / CsvBasic.fs
Last active November 2, 2020 07:16
My Shortest CSV Parser
(*
* This work (My Shortest CSV Parser:CsvBasic.fs by James Tuley),
* identified by James Tuley, is free of known copyright restrictions
* Source: https://gist.github.com/jbtule/83e330335b1afc924d508ce49b0927fc
* http://creativecommons.org/publicdomain/mark/1.0/
*)
module CsvBasic
open System.IO
type SB = System.Text.StringBuilder
[<Struct>] type internal Quote = None | Open | Closed
@jbtule
jbtule / fsharp-onboarding.md
Last active October 12, 2021 15:15
F# onboarding from c# - 2018

Set yourself up for using Exercism

http://exercism.io/

To unlock these execerises you will need to disabled learning mode.

Practice c#

In Exercism you'll have some exercises to

@jbtule
jbtule / kv.fs
Last active September 25, 2019 22:20
KeyValue CE for F# 4.7
(*
* This work (KeyValue CE for F# 4.7 by James Tuley),
* identified by James Tuley, is free of known copyright restrictions
* Source: https://gist.github.com/jbtule/45284eee325416759c5fcf62dfa54b95
* http://creativecommons.org/publicdomain/mark/1.0/
*)
namespace FSharp.Experimental.KeyValueCE
open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Quotations.Patterns
@jbtule
jbtule / haveibeenpwned.csx
Last active March 13, 2019 17:01
haveibeenpwned.com script to check a password
#!/usr/bin/env dotnet-script
/*
* This work (haveibeenpwnded.csx by James Tuley),
* identified by James Tuley, is free of known copyright restrictions
* Source: https://gist.github.com/jbtule/7dab1a1031590209bdcfac88ee71cb2b
* http://creativecommons.org/publicdomain/mark/1.0/
*
* This script uses the Troy Hunt's HaveIBeenPwned.com range api, to search for passwords,
* without revealing what you are searching for.
*
@jbtule
jbtule / AzureStorageEmulatorManager.cs
Created July 29, 2017 01:26 — forked from bragma/AzureStorageEmulatorManager.cs
SetUp Fixture for NUnit starting the emulator before tests
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AzureTableStorage.Tests
{
// Start/stop azure storage emulator from code:
@jbtule
jbtule / task.json
Created February 17, 2017 13:57
vscode task.json for Harbour (use a build.hbp)
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"tasks":[
{
"taskName": "Build",
"command": "hbmk2",
"isShellCommand": true,
"isBuildCommand": true,
@jbtule
jbtule / justice-will-only-be-acheived.md
Last active April 5, 2023 13:33
Tracing the origin of an internet quote

Tracing the origin of an internet quote

So I saw this quote on twitter

"Justice will only be achieved when those who are not injured by crime feel as indignant as those who are."
–Solomon (635-577 B.C.)

Which I though was a real effective quote relating the