Skip to content

Instantly share code, notes, and snippets.

View RodolfoAntonici's full-sized avatar

Rodolfo Antonici RodolfoAntonici

  • WOM
  • Uberlândia - MG, Brazil
View GitHub Profile
@RodolfoAntonici
RodolfoAntonici / main.py
Last active August 27, 2019 20:00 — forked from bkawakami/main.py
Python Script to ContentStack
from urllib.request import Request, urlopen
import json
import sys
import getopt
import os
def getDataNative(env, loc, key, token, directory):
req = Request(
'https://cdn.contentstack.io/v3/content_types/mobile_translation_poc_/entries/blt9624c908f899c058?environment=%s&locale=%s' % (
env, loc))
@RodolfoAntonici
RodolfoAntonici / apsee.sh
Created June 24, 2019 15:16
AppSee build injection
#Info.plist path
INFO_PLIST="${PROJECT_DIR}/MVCVMRC/Supporting Files/Info.plist"
#Set Appsee ApiKey for this scheme
/usr/libexec/PlistBuddy -c "set :com.appsee.ApiKey 9eb82a6569fa4f92993999a3f87446e5" "$INFO_PLIST"
# Run the script which will export the dSYM
${PODS_ROOT}/Appsee/Appsee.framework/build
@RodolfoAntonici
RodolfoAntonici / Navigations.swift
Last active December 10, 2018 20:02
A way to open the most popular apps of navigations with the route already traced.
//
// Navigations.swift
//
// Created by Rodolfo Antonici on 06/12/18.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@RodolfoAntonici
RodolfoAntonici / CABasicAnimationExtension.swift
Last active December 13, 2017 18:34
A enum of CABasicAnimation key paths to be really easy to use
//
// Created by Rodolfo Antonici on 13/12/17.
// This software is provided by Rodolfo Antonici on an "AS IS" basis.
//
extension CABasicAnimation {
convenience init(keyPath: KeyPath) {
self.init(keyPath: keyPath.rawValue)
}
//
// MoyaProviderCodableExtension.swift
//
//
// Created by Rodolfo Antonici on 22/09/17.
// Copyright (c) 2017 Rodolfo Antonici (https://marcosantadev.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
//Based on: https://github.com/nortthon/CPF-CNPJ-Swift
func generateCPF() -> String {
var cpf = [0,0,0,0,0,0,0,0,0,0,0]
var firstVerification = 0
var secondVerification = 0
for i in 0...8 {
cpf[i] = (Int)(arc4random_uniform(9))
import UIKit
extension Array {
func insertionIndexOf(elem: Element, isOrderedBefore: (Element, Element) -> Bool) -> Int {
var lo = 0
var hi = self.count - 1
while lo <= hi {
let mid = (lo + hi)/2
if isOrderedBefore(self[mid], elem) {
lo = mid + 1
@RodolfoAntonici
RodolfoAntonici / UIScrollViewExtension.swift
Last active December 12, 2018 17:07
Implement keyboard avoidance on any UIScrollView
// Created by Rodolfo Antonici on 12/12/18.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// InputAccessoryView.swift
//
// Created by Rodolfo Antonici on 23/08/16.
// Copyright © 2016 RAntonici. All rights reserved.
//
import UIKit
class InputAccessoryView: UIView {
//
// DateFormatTransform.swift
//
// Created by Rodolfo Antonici on 29/11/16.
// No copyright, just use it as it's.
// ObjectMapper version 2.2
//
// A simple class using the TransformType protocol of ObjectMapper to convert Date String into a NSDate object
import Foundation