Skip to content

Instantly share code, notes, and snippets.

Jay Tuley jbtule

Block or report user

Report or block jbtule

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
@jbtule
jbtule / fsharp-onboarding.md
Last active Oct 18, 2019
F# onboarding from c# - 2018
View fsharp-onboarding.md

Set yourself up for using Exercism

http://exercism.io/

Practice c#

In Exercism you'll have some exercises to

  • Sum Of Multiples
  • Nucleotide Count
@jbtule
jbtule / kv.fs
Last active Sep 25, 2019
KeyValue CE for F# 4.7
View kv.fs
(*
* 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 Mar 13, 2019
haveibeenpwned.com script to check a password
View haveibeenpwned.csx
#!/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 Jul 29, 2017 — forked from bragma/AzureStorageEmulatorManager.cs
SetUp Fixture for NUnit starting the emulator before tests
View AzureStorageEmulatorManager.cs
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 Feb 17, 2017
vscode task.json for Harbour (use a build.hbp)
View task.json
{
// 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 Jan 7, 2018
Tracing the origin of an internet quote
View justice-will-only-be-acheived.md

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

View keybase.md

Keybase proof

I hereby claim:

  • I am jbtule on github.
  • I am jbtule (https://keybase.io/jbtule) on keybase.
  • I have a public key whose fingerprint is 3D0C 3B0C 41D8 A997 9363 F5A9 264F 726E 62F0 9646

To claim this, I am signing this object:

@jbtule
jbtule / build.fsx
Last active Jul 4, 2017
Single file Crossplatform FSharp MakeFile bootstrap
View build.fsx
#!/bin/sh
#if run_with_bin_sh
# Doing this because arguments can't be used with /usr/bin/env on linux, just mac
exec fsharpi --define:mono_posix --exec $0 $*
#endif
#if FSharp_MakeFile
(*
* Single File Crossplatform FSharp Makefile Bootstrapper
@jbtule
jbtule / build.fsx
Last active Jul 4, 2017
Crossplatform FSharp Makefile Bootstrapper
View build.fsx
#!/bin/sh
#if run_with_bin_sh
# Doing this because arguments can't be used with /usr/bin/env on linux, just mac
exec fsharpi --define:mono_posix --exec $0 $*
#endif
(*
* Crossplatform FSharp Makefile Bootstrapper
* Apache licensed - Copyright 2014 Jay Tuley <jay+code@tuley.name>
* v 2.0 https://gist.github.com/jbtule/9243729
@jbtule
jbtule / NullCoalesce.fs
Last active Mar 11, 2019
Null Coalesce Operator for F# (|??), works with option, Nullable, and c# reference types
View NullCoalesce.fs
//inspired by http://stackoverflow.com/a/2812306/637783
type NullCoalesce =
static member Coalesce(a: 'a option, b: 'a Lazy) = match a with Some a -> a | _ -> b.Value
static member Coalesce(a: 'a Nullable, b: 'a Lazy) = if a.HasValue then a.Value else b.Value
static member Coalesce(a: 'a when 'a:null, b: 'a Lazy) = match a with null -> b.Value | _ -> a
let inline nullCoalesceHelper< ^t, ^a, ^b, ^c when (^t or ^a) : (static member Coalesce : ^a * ^b -> ^c)> a b =
((^t or ^a) : (static member Coalesce : ^a * ^b -> ^c) (a, b))
You can’t perform that action at this time.