Skip to content

Instantly share code, notes, and snippets.

View lukeredpath's full-sized avatar
🏠
Working from home

Luke Redpath lukeredpath

🏠
Working from home
View GitHub Profile
@lukeredpath
lukeredpath / ExampleDomain.swift
Last active January 31, 2023 16:18
An enum equivalent of IfLetStore for The Composable Architecture
enum AppState: Equatable {
case featureOne(FeatureState)
case featureTwo(FeatureState)
case featureThree(FeatureState)
}
enum AppAction: Equatable {
case featureOne(FeatureAction)
case featureTwo(FeatureAction)
case featureThree(FeatureAction)
@f-meloni
f-meloni / CellUtilities-Swift2.2.swift
Last active September 5, 2019 08:25
Cells reusableIdentifier and nib utility extension
import Foundation
import UIKit
public protocol Reusable: class, NSObjectProtocol {
static var reusableIdentifier: String { get }
}
public extension Reusable {
public static var reusableIdentifier: String { return String(Self) }
}
(from : https://simplifiedthinking.co.uk/2015/10/03/install-mqtt-server/ )
Installing Brew
The Mosquitto MQTT Server can be easily installed using Homebrew. If it’s not installed on your system already, then a quick visit to the homepage will give you all you need to get going. Homebrew is an OS X Package Manager for installing and updating non-Mac OS X utilities that are more commonly found in other variants of Linux. To install the basic package manager run the following command.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing Mosquitto MQTT
@lukeredpath
lukeredpath / Gemfile
Created July 11, 2012 11:53
A parser for Twitter's tweet archive dump format
gem "mongo"
gem "bson_ext"
gem "mongoid"
@lukeredpath
lukeredpath / butterchicken.txt
Created February 25, 2012 23:59
Murgh Makhani (Butter Chicken) Recipe
MAKES 3-4 SERVINGS.
Marinated chicken:
* 800g - 1KG of boneless, skinless chicken thighs
* 75g of natural/greek yoghurt (full fat)
* 2 garlic cloves, minced
* 2cm ginger, finely chopped/grated
* Juice of half a lemon
* 1 tsp salt
@lukeredpath
lukeredpath / AssertEventually.h
Created August 3, 2010 13:20
Enables simple and elegant testing of asynchronous/threaded code with OCUnit, blocks and OCHamcrest
//
// AssertEventually.h
// LRResty
//
// Created by Luke Redpath on 03/08/2010.
// Copyright 2010 LJR Software Limited. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "HCMatcher.h"