Skip to content

Instantly share code, notes, and snippets.

View benjohnde's full-sized avatar
brewing code all day long

Ben John benjohnde

brewing code all day long
View GitHub Profile
import RxFlow
public class BootstrapFlow: Flow {
// MARK: - Public properties
public var root: Presentable {
return UINavigationController()
}
public var completionStep: Step?
// MARK: - Private properties
#!/usr/bin/env python3
import csv
import re
with open('customer_interview_list.csv') as file:
reader = csv.reader(file, delimiter=';')
for row in reader:
column = row[13]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.25882354378700256</real>
@benjohnde
benjohnde / Channel.swift
Created March 27, 2018 08:04 — forked from gokselkoksal/Channel.swift
Channel implementation
public class Channel<Value> {
private class Subscription {
weak var object: AnyObject?
private let notifyBlock: (Value) -> Void
private let queue: DispatchQueue
var isValid: Bool {
return object != nil
// without turtle drawing a hexagon is math heavy and not trivial to modify
let numberOfSides: CGFloat = 6
let radiusOuterCircle: CGFloat = 30
let sideLength = radiusOuterCircle / 2
let theta = (CGFloat.pi * 2) / numberOfSides
let centerX = sideLength / 2
let centerY = sideLength / 2
let initialPoint = CGPoint(x: radiusOuterCircle * cos(2 * CGFloat.pi * 0/numberOfSides + theta) + centerX, y: radiusOuterCircle * sin(2 * CGFloat.pi * 0/numberOfSides + theta) + centerX)
import Foundation
public enum Either<T, U> {
case left(T)
case right(U)
}
precedencegroup EitherChaining {
associativity: left
}
@benjohnde
benjohnde / check-provisioning-udid.sh
Last active January 8, 2018 10:32 — forked from akofman/checkIosProvisiongProfile.md
Check for device(s) in a provisioning profile.
unzip -oq IDQuantOnCalDemo.ipa
security cms -Di Payload/IDQuantOnCalDemo.app/embedded.mobileprovision > mobileprovision.plist
/usr/libexec/PlistBuddy -c "Print :ProvisionedDevices" mobileprovision.plist > provisioneddevices.txt
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
@benjohnde
benjohnde / build_opencv_ios.sh
Last active October 25, 2017 08:43
Compilation error of dynamic framework for iOS (OpenCV 3.3.0)
#!/bin/bash
git clone [email protected]:opencv/opencv.git
cd opencv
git checkout 3.3.0
python platforms/ios/build_framework.py ios \
--dynamic \
--without imgcodec --without videoio --without video --without calib3d --without features2d \
--without objdetect --without dnn --without ml --without flann --without photo --without stitching \
--without cudaarithm --without cudabgsegm --without cudacodec --without cudafeatures2d \
--without cudafilters --without cudaimgproc --without cudalegacy --without cudaobjdetect \