Skip to content

Instantly share code, notes, and snippets.

On leave

Geoffrey Huntley ghuntley

On leave
View GitHub Profile
ghuntley / TodoMVC.purs
Created Jun 9, 2020
PureScript implementation of WebCheck frontend language
View TodoMVC.purs
module TodoMVC where
import DSL
import Data.Array (filter, head, last)
import Data.Array as Array
import Data.Foldable (length)
import Data.Maybe (Maybe(..))
import Data.Number as Number
import Data.String (Pattern(..), split)
ghuntley /
Created Jul 28, 2018 — forked from shiftkey/
Working Distributed - Cliff Notes
ghuntley / TheDateTime.cs
Created May 3, 2018 — forked from glennstephens/TheDateTime.cs
If you have an app that is designed to be used over a long period of time (say a year). To write tests you need to simulate the passage of time. I've been using this little helper to allow to simulated tests in the fourth dimension
View TheDateTime.cs
// Instead of using calls like DateTime.Now, use TheDateTime.Now instead. In your production code it will default to using
// the read details and for testing you would make calls like:
// TheDateTime.SwitchToMockDate(new DateTime(2018, 12, 3);
// and then test what the outcome would be. It assumes that you have this throughout
public static class TheDateTime
static Lazy<LiveDateTimeFunctions> _liveDates = new Lazy<LiveDateTimeFunctions>(() => new LiveDateTimeFunctions());
static Lazy<MockDateTimeFunctions> _mockDates = new Lazy<MockDateTimeFunctions>(() => new MockDateTimeFunctions());
static IDateTimeFunctions _instance = _liveDates.Value;
ghuntley /
Created Oct 9, 2017 — forked from agc93/
Script used for demos and live coding
# This is pretty trimmed down, but is the basic idea, at least
docker ps -a -q -f status=exited | xargs -r docker rm
git reset --hard
git checkout stage-$1

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.


Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

ghuntley / AppPickerExtensions.cs
Created Jun 28, 2017 — forked from richseviora/AppPickerExtensions.cs
Xamarin UI Test Date/Time Picker Extensions
View AppPickerExtensions.cs
// Tested with Xamarin.UITest V1.3.7;
using System;
using Xamarin.UITest;
namespace {APPNAMEHERE}.UITests
/// <summary>
/// This extension class extends the <see cref="IApp"/> interface to add extension methods for selecting values from the default Date/Time pickers in iOS and Android.
/// </summary>
public static class AppPickerExtensions
ghuntley / PureIO.cs
Created Mar 14, 2017 — forked from tonymorris/PureIO.cs
A demonstration of pure-functional I/O using the free monad in C#
View PureIO.cs
using System;
namespace PureIO {
C# does not have proper sum types. They must be emulated.
This data type is one of 4 possible values:
- WriteOut, being a pair of a string and A
- WriteErr, being a pair of a string and A
- readLine, being a function from string to A
ghuntley / ExampleUsage.cs
Created Aug 18, 2016 — forked from NickCraver/ExampleUsage.cs
Code to mark a SQL string before it's passed to Dapper.
View ExampleUsage.cs
public static List<T> Query<T>(this DataContext db, string sql, object param = null, int? commandTimeout = null, IDbTransaction transaction = null, [CallerFilePath]string fromFile = null, [CallerLineNumber]int onLine = 0, string comment = null)
using (db.Connection.EnsureOpen())
return db.Connection.Query<T>(MarkSqlString(sql, fromFile, onLine, comment), param, transaction ?? db.Transaction, true, commandTimeout).AsDapperList();
catch (SqlException ex) when (ex.Is(SqlErrorCode.DatabaseReadOnly_3906))
ghuntley / Build.xml
Created May 3, 2016 — forked from NickCraver/Build.xml
Stack Overflow Build Reference Docs
View Build.xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="PrepareStaticContent" xmlns="">
<!-- Passed in Parameters -->
ghuntley / FilesystemWatchCache.cs
Created Apr 5, 2016 — forked from anaisbetts/FilesystemWatchCache.cs
An Rx-friendly Filesystem Watcher
View FilesystemWatchCache.cs
using System;
using System.IO;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using ReactiveUI;
namespace SaveAllTheTime.Models
interface IFilesystemWatchCache
You can’t perform that action at this time.