Skip to content

Instantly share code, notes, and snippets.

View erikfloresq's full-sized avatar
Open your eyes

Erik Flores erikfloresq

Open your eyes
View GitHub Profile
@erikfloresq
erikfloresq / Fastfile
Last active April 24, 2017 23:55
Instalación de varios certificates y provisioning profile
# Colocamos una descripción para nuestro lane
desc "Generando Certificados para Weriklandia"
# iniciamos nuestro lane con el nombre certificate
lane :certificate do
# instalamos provising profile de desarrollo
match(
type: "development"
)
# instalamos provising profile para ad-hoc
match(
@erikfloresq
erikfloresq / Matchfile
Last active April 25, 2017 20:28
Configuración de Matchfile para varios provisioning profile
# Aqui declaramos la url del repositorio donde estarán guardados los certificates y provisioning profile
git_url "[email protected]:usuario/ios.certificates.git"
# Se define el tipo de certificate y provisining profile que se crearar por default
# Es decir, cuando escribes solo match en el terminal genera el tipo de certificado que pusiste aqui pueden ser development, ad-hoc, app-store y enterprise.
type "development"
# Aqui defines los bundle indetifier de las aplicaciones a las cuales les crearemos los provisioning profile
app_identifier ["pe.com.orbis.*","pe.com.orbis.OrbisMobile"]
@erikfloresq
erikfloresq / Fastfile
Last active April 24, 2017 23:55
Fastlane Configuración Base
# Definimos que version minima de Fastlane necesitamos para hacer nuestras tareas
# En el momento que estoy escribiendo el post la ultima version es la 2.28.2
fastlane_version "2.28.2"
# En plataformas vamos a trabajar
default_platform :ios
# lane es como una tarea que asu ves tiene un conjunto de acciones las cuales defines segun lo que gustes
# Es el nombre de este lane es "beta"
lane :beta do
@erikfloresq
erikfloresq / SendReviewView
Created October 20, 2016 19:30
Envia a la pantalla para hacer review ios 9 >
let appID = "(Your App ID on App Store)"
let urlStr = "itms-apps://itunes.apple.com/app/id\(appID)" // (Option 1) Open App Page
let urlStr = "itms-apps://itunes.apple.com/app/viewContentsUserReviews?id=\(appID)" // (Option 2) Open App Review Tab
UIApplication.sharedApplication().openURL(NSURL(string: urlStr)!)
@erikfloresq
erikfloresq / sshMultiplerUser.txt
Last active September 2, 2016 14:32
Create multiple indentifier with ssh
1. Create key default
$ ssh-keygen
2. Create other key
$ ssh-keygen -f ~/.ssh/github_key -C "github_key"
3. Create 'config' file
$ touch config && nano config
4. Add Configuration in config
@erikfloresq
erikfloresq / globals.swift
Created March 5, 2016 21:42
example to make global constant
import Foundation
struct K {
struct URL {
static let RecoverPassword = "https://url/recuperar-clave"
static let HaveNotUser = "https://url/afiliacion/paso1"
static let PagoEfectivoOverview = "url/pe/tarjeta-visa"
static let HelpCenter = "http://url/home"
static let serviceURL = "https://url/"
@erikfloresq
erikfloresq / request.swift
Created March 5, 2016 21:33
Make a request to API
// make a request
func getListData(parameters : [String:AnyObject], callback: ([NSObject:AnyObject], String?) -> Void) {
var urlService : String!
var parametersInfo : String!
urlService = "\(urlMain)"
parametersInfo = setFormDataFromDictionary(parameters)
@erikfloresq
erikfloresq / validation.swift
Created March 4, 2016 22:25
Extended a String class for make function validation
extension String {
func isEmail() -> Bool {
let regex = try! NSRegularExpression(pattern: "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$", options: [.CaseInsensitive])
return regex.firstMatchInString(self, options:[], range: NSMakeRange(0, utf16.count)) != nil
}
func isDni() -> Bool {
let regex = try! NSRegularExpression(pattern: "^[0-9]{8}$", options: [.CaseInsensitive])
@erikfloresq
erikfloresq / shakeElement.swift
Created March 4, 2016 22:17
Shake animation for element, for example UITextField
class func shakeThis(element:UIView) {
element.transform = CGAffineTransformMakeTranslation(-20, 0)
UIView.animateWithDuration(0.8, delay: 0.0, usingSpringWithDamping: 0.3, initialSpringVelocity: 0.5, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in
element.transform = CGAffineTransformIdentity
}, completion: nil)
// iphoneVibrate