Skip to content

Instantly share code, notes, and snippets.

View lloydjatkinson's full-sized avatar
🌧️
Chilling

Lloyd Atkinson lloydjatkinson

🌧️
Chilling
View GitHub Profile
@lloydjatkinson
lloydjatkinson / redux-performance-mark.js
Created July 5, 2018 12:54 — forked from clarkbw/redux-performance-mark.js
A User Timing middleware for redux to create performance markers for dispatched actions
const timing = store => next => action => {
performance.mark(`${action.type}_start`);
let result = next(action);
performance.mark(`${action.type}_end`);
performance.measure(
`${action.type}`,
`${action.type}_start`,
`${action.type}_end`
);
return result;
@lloydjatkinson
lloydjatkinson / gist:4c1130a42e8847d344b1c9c5333d8eb7
Created June 13, 2018 21:25 — forked from ChickenProp/gist:3050085
Simple Raspberry Pi GPIO example

Introduction

This is a dead-simple way to test that GPIO on the Raspberry Pi is working. I have an SKPang Raspberry Pi starter kit A. But all you need is

  • A Raspberry Pi.
  • An LED.
  • A button.
  • A resistor, approximately 270Ω.
  • Some way to connect these to each other and the GPIO pins.
@lloydjatkinson
lloydjatkinson / CustomerController.cs
Created April 23, 2018 21:02 — forked from vkhorikov/CustomerController.cs
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@lloydjatkinson
lloydjatkinson / 00.howto_install_phantomjs.md
Created December 17, 2017 13:27 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@lloydjatkinson
lloydjatkinson / AhoCorasickTree.cs
Created April 24, 2017 07:53 — forked from alexandrnikitin/AhoCorasickTree.cs
Aho-Corasick C# implementation
using System.Collections.Generic;
using System.Linq;
namespace AhoCorasickTree
{
public class AhoCorasickTree
{
internal AhoCorasickTreeNode Root { get; set; }
public AhoCorasickTree(IEnumerable<string> keywords)