Skip to content

Instantly share code, notes, and snippets.

View zhouhao27's full-sized avatar

Zhou Hao zhouhao27

  • Zeus Software LLP
  • Singapore
View GitHub Profile
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
struct User {
let firstName: String
let lastName: String
let email: String
let age: Int
@zhouhao27
zhouhao27 / SwiftDI.swift
Last active February 17, 2020 03:00
A Swift-y Approach to Dependency Injection
// Refer to: https://danielhall.io/a-swift-y-approach-to-dependency-injection
// Part two: https://www.danielhall.io/swift-y-dependency-injection-part-two
import Foundation
protocol NetworkingInjected {}
extension NetworkingInjected {
var networking: NetworkingProtocol {
return NetworkInjector.injectNetworking()
@zhouhao27
zhouhao27 / CompileOpenAlpriOS.md
Last active July 13, 2018 06:17
Compile OpenAlpr for iOS
  1. Download the source code

git clone https://github.com/openalpr/openalpr.git

cd openalpr

  1. Copy dependecies to framework folder

Regarding with the compiling of the dependent libraris like opencv2.framework, leptonica.framework and tesseract.framework is another story.

#!/bin/sh
GLOBAL_OUTDIR="`pwd`/dependencies"
LOCAL_OUTDIR="./outdir"
LEPTON_LIB="`pwd`/leptonica-1.76.0"
TESSERACT_LIB="`pwd`/tesseract-3.05.02"
# OPENCV_LIB = "`pwd`/opencv_3.4.1_5"
IOS_BASE_SDK="10.3"
IOS_DEPLOY_TGT="8.0"