Skip to content

Instantly share code, notes, and snippets.

View ezefranca's full-sized avatar
💻
👨🏻‍💻

Ezequiel Santos ezefranca

💻
👨🏻‍💻
View GitHub Profile
class ViewControllerTest: XCTestCase {
var systemUnderTest: ViewController!
override func setUp() {
super.setUp()
//get the storyboard the ViewController under test is inside
let storyboard: UIStoryboard = UIStoryboard(name: "Main_iPhone", bundle: nil)
@ezefranca
ezefranca / URLSchemes.txt
Created October 27, 2017 13:41 — forked from cocuroci/URLSchemes.txt
URLSchemes Bancos
Banco do Brasil = "bbapp://"
Bradesco = "BDNiPhoneVarejo://"
Bradesco Prime = "BDNiPhonePrime://"
Itaú = "itauvarejo://"
Itaú Personnalité = "itaupersonnalite://"
Santander = "santanderpf://"
Sicoob = "sicoob://"
Neon = "banconeon://"
Nubank = "nuapp://"
@ezefranca
ezefranca / ViewController.swift
Last active October 25, 2017 17:29 — forked from santoshbotre/ViewController.txt
Local Authentication using Biometric
import UIKit
import LocalAuthentication
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
authenticationWithTouchID()
}
@ezefranca
ezefranca / String+Email.swift
Last active August 7, 2017 22:51 — forked from DaveWoodCom/String+Email.swift
Swift method to check for a valid email address (uses Apples data detector instead of a regex)
extension String {
func isValidEmail() -> Bool {
guard !self.lowercased().hasPrefix("mailto:") else { return false }
guard let emailDetector = try? NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue) else { return false }
let matches = emailDetector.matches(in: self, options: NSRegularExpression.MatchingOptions.anchored, range: NSRange(location: 0, length: self.characters.count))
guard matches.count == 1 else { return false }
return matches[0].url?.scheme == "mailto"
}
}
@ezefranca
ezefranca / README.md
Created June 6, 2017 22:45 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

require "nokogiri"
require "open-uri"
require 'json'
url = "https://speakerdeck.com/#{params['username']}?page=#{params['page']}"
document = Nokogiri::HTML(open(url))
images = document.xpath('//div[@class="deck-preview-slide"]').map { |node| 'https:' + node.xpath('//@style').text.split(';')[1].split(':')[2].split('\'')[0] }
#titles = document.xpath('//div[@class="deck-preview-slide"]').map { |node| node.xpath('//div[@class="deck-title px-3 pt-3 text-truncate"]') }[0].map { |title| title.text.strip }
@ezefranca
ezefranca / 3DFlip.swift
Last active July 22, 2017 09:05 — forked from ivanseidel/3DFlip.swift
TDC Florianopolis 2017 - Demos da palestra Going Raw with animations
import UIKit
import XCPlayground
import CoreGraphics
import PlaygroundSupport
/*
* Demo
*/
func applyPerspective(_ view: UIView, distance: CGFloat) {
view.layer.transform.m34 = 1.0 / distance
@ezefranca
ezefranca / FTDI_Basic_Hookup_for_ESP-01.jpg
Created February 3, 2017 16:22 — forked from stonehippo/FTDI_Basic_Hookup_for_ESP-01.jpg
Notes on using the ESP8266 with the Arduino IDE
FTDI_Basic_Hookup_for_ESP-01.jpg
@ezefranca
ezefranca / Card type.swift
Created January 11, 2017 20:24 — forked from igorcferreira/CardType.swift
Basic implementation to apply different regexes over a card number String and find the card type
import UIKit
//: Basic implementation to apply different regexes over a card number String and find the card type
enum CardType:String, CustomStringConvertible {
case invalid = "Not valid"
case visa = "^4[0-9]{6,}$"
case mastercard = "^5[0-9]{6,}$"
case amex = "^3[47][0-9]{13}$"
case diners = "^3(?:0[0-5]|[68][0-9])[0-9]{11}$"
@ezefranca
ezefranca / struct_vs_inheritance.swift
Created September 12, 2016 05:55 — forked from AliSoftware/struct_vs_inheritance.swift
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/