Skip to content

Instantly share code, notes, and snippets.

Glen Hinkle tempire

Block or report user

Report or block tempire

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.txt
### Keybase proof
I hereby claim:
* I am tempire on github.
* I am tempire (https://keybase.io/tempire) on keybase.
* I have a public key ASDIRg2rJmI_Ly2SlcDphF4jfba_l3Hw2MbSHaFm0wlQZwo
To claim this, I am signing this object:
@tempire
tempire / client_certificate.swift
Last active Mar 5, 2019
WKWebView with client certificate
View client_certificate.swift
//
// ViewController.swift
// CertificateRequest
//
// Created by Glen Hinkle on 3/4/19.
// Copyright © 2019 Zombie Dolphin LLC. All rights reserved.
//
// Works with iOS 12
//
View WKWebView
// In the MTR view controller
let vc = storyboard.instantiateViewController(withIdentifier: "WebViewController")
self.navigationController?.pushViewController(vc, animated: true)
// Web View Controller, assuming a matching view controller in the storyboard
class WebViewController: UIViewController {
View realm-classes.swift
import RealmSwift
class ParentThing: Object {
dynamic var name: String = ""
dynamic var oktaId: String = ""
dynamic var employeeId: String = ""
dynamic var salesforceId: String = ""
dynamic var someOptionalThing: String?
@tempire
tempire / custom_collection-swift2.swift
Created Nov 12, 2016
Swift 2.2-2.3 Custom collection
View custom_collection-swift2.swift
// From Ray Wenderlich, converted to swift 2
extension Structs: CustomStringConvertible {
var description: String {
return contents.description
}
}
extension Structs: ArrayLiteralConvertible {
init(arrayLiteral elements: Element...) {
@tempire
tempire / ble.swift
Last active Jul 10, 2019
bluetooth LE advertise/scan
View ble.swift
//
// Check.swift
// Points
//
// Created by Glen Hinkle on 10/2/16.
// Copyright © 2016 Zombie Dolphin. All rights reserved.
//
import Foundation
import CoreBluetooth
@tempire
tempire / vcs.swift
Created Jun 30, 2016
Typed view controller and storyboard
View vcs.swift
// Allows
// Storyboard.Main.viewController(MainVC)
enum Storyboard: String {
case Main
static let values = [Main]
static var boards = [Storyboard:UIStoryboard]()
func viewController<A: UIViewController>(type: A.Type) -> A {
@tempire
tempire / closure.m
Last active May 11, 2016
objc block closure
View closure.m
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated duration:(NSTimeInterval)duration completion:(void(^)(BOOL finished))completion {
void (^highlight)(UIView *, BOOL) = ^void(UIView *view, BOOL highlight) {
if (highlight) {
view.layer.borderWidth = 0.0;
view.layer.borderColor = [UIColor clearColor].CGColor;
view.layer.shadowOpacity = 0.0;
}
else {
View pccf_.swift
Within a NSManagedObject subclass called "Customer"
@NSManaged var pccf: PCCF?
func findOrCreatePCCF(context: NSManagedObjectContext) -> PCCF? {
if let pccf = self.pccf {
return pccf
}
View nginx_websocket_reverse_proxy
map $http_upgrade $connection_upgrade {
default "upgrade";
"" "";
}
server {
listen 80;
location / {
proxy_pass http://docker;
You can’t perform that action at this time.