Skip to content

Instantly share code, notes, and snippets.

@briscula
briscula / Controller.php
Created May 11, 2019 21:13 — forked from gmazzap/Controller.php
WordPress plugin to ease the creation of virtual pages.
<?php
namespace GM\VirtualPages;
/**
* @author Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com>
* @license http://opensource.org/licenses/MIT MIT
*/
class Controller implements ControllerInterface {
private $pages;
@briscula
briscula / Obfuscator.swift
Created April 3, 2019 18:49 — forked from DejanEnspyra/Obfuscator.swift
Obfuscation of hard-coded security-sensitive strings.
//
// Obfuscator.swift
//
// Created by Dejan Atanasov on 2017-05-31.
//
import Foundation
class Obfuscator: AnyObject {
@briscula
briscula / CertificatePinningURLSessionDelegate.swift
Created March 28, 2019 20:10 — forked from daniel-rueda/CertificatePinningURLSessionDelegate.swift
Certificate and Public Key Pinning for URLSession using Swift
// Based on https://code.tutsplus.com/articles/securing-communications-on-ios--cms-28529
import Foundation
import Security
struct Certificate {
let certificate: SecCertificate
let data: Data
}
@briscula
briscula / exportOptionsAdHoc.plist
Created March 6, 2019 14:05 — forked from cocoaNib/exportOptionsAdHoc.plist
Xcode build with exportOptionsPlist
<?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>method</key>
<string>ad-hoc</string>
</dict>
</plist>
@briscula
briscula / iterm2-solarized.md
Created January 22, 2019 09:00 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@briscula
briscula / export.py
Last active November 7, 2018 14:45 — forked from rickyngk/export.py
Export XCode string files to excel
import fnmatch
import os
import xlsxwriter
import collections
texts = {}
for root, dirnames, filenames in os.walk('./YourAwesomeProject/'):
for filename in fnmatch.filter(filenames, '*.strings'):
dirs = root.split("/")
@briscula
briscula / fingerprint_management.md
Created October 15, 2018 10:50 — forked from jaredpage-ibm/fingerprint_management.md
Managing fingerprint changes in your ISAM SDK enabled mobile application Raw

Managing fingerprint changes with your ISAM SDK enabled mobile application

In many apps dealing with highly senstive data (Bank Apps, Insurance Apps or similar), ensuring strict authentication for your users into your Android and iOS app is important. One challenging aspect is when Fingerprint Authentication (or Touch ID in iOS) is used for a true biometric authentication solution rather than a convenience use case such as unlocking the device. We want to ensure users are authenticated to the server correctly, and someone who is able to subtly comprimise a device (steal it off you when its unlocked for example - or guess your PIN) won't be able to log into your bank app. An important edge case is to detect is when a Fingerprint has been added or removed to your phone and then prompt for a different form of authentication. This also stop

@briscula
briscula / MNGExpandedTouchAreaButton.swift
Created October 4, 2018 09:30 — forked from mingsai/MNGExpandedTouchAreaButton.swift
A Swift UIButton subclass to expand the touch area of the button.
//
// MNGExpandedTouchAreaButton.swift
//
//
// Created by Tommie Carter on 7/7/15.
// Copyright © 2015 MING Technology. All rights reserved.
//
import UIKit
@briscula
briscula / UIView+Hierarchy.swift
Created June 14, 2018 08:43 — forked from myell0w/UIView+Hierarchy.swift
Traverse View Hierarchy Upwards
extension UIView {
func findFirstSuperview<T>(ofClass viewClass: T.Type, where predicate: (T) -> Bool) -> T? where T: UIView {
var view: UIView? = self
while view != nil {
if let typedView = view as? T, predicate(typedView) {
break
}
view = view?.superview
}
@briscula
briscula / ios-font-sizes.swift
Created April 11, 2018 10:23 — forked from zacwest/ios-font-sizes.swift
iOS default font sizes
let styles: [UIFontTextStyle] = [
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
for style in styles {