Skip to content

Instantly share code, notes, and snippets.

View alexruperez's full-sized avatar
:octocat:
Tech Director @globant

Alex Rupérez alexruperez

:octocat:
Tech Director @globant
View GitHub Profile
@alexruperez
alexruperez / StoryTellerViewController.swift
Last active May 14, 2018 09:02
Create a StoryTeller in Swift with Firebase ML Kit Text Recognition OCR | Lil ‘Bits | https://www.youtube.com/watch?v=kpzyFZYI1PQ
import UIKit
import AVFoundation
import Firebase
class StoryTellerViewController: UIViewController {
private lazy var previewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
private lazy var captureSession: AVCaptureSession = {
let captureSession = AVCaptureSession()
guard let captureDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back),
@alexruperez
alexruperez / DDCLSLogger.h
Created August 22, 2016 18:04
Custom CocoaLumberjack logger which sends logs to Crashlytics.
@import CocoaLumberjack;
@interface DDCLSLogger : DDAbstractLogger
@end
@alexruperez
alexruperez / SiriViewController.swift
Last active November 29, 2018 16:32
Create your own Siri in Swift | Lil ‘Bits | https://www.youtube.com/watch?v=Sigl3dihEB8
import UIKit
import Speech
class SiriViewController: UIViewController {
private static let locale = Locale(identifier: "es-ES")
private let speechRecognizer = SFSpeechRecognizer(locale: SiriViewController.locale)!
private var recognitionRequest: SFSpeechAudioBufferRecognitionRequest?
private var recognitionTask: SFSpeechRecognitionTask?
private let audioEngine = AVAudioEngine()
@alexruperez
alexruperez / Podfile
Created January 30, 2019 11:36
MaterialTextInputOutlined iOS PoC
platform :ios, '10.3'
target 'MaterialTextInputOutlinedPoC' do
use_frameworks!
pod 'MaterialComponents/TextFields+ColorThemer', '~> 75.0'
pod 'MaterialComponents/TextFields+TypographyThemer', '~> 75.0'
end
@alexruperez
alexruperez / testflight.sh
Last active August 31, 2020 13:31
A shell script that upload your .ipa file as a build in TestFlight. You just have to set the script variables, place your '<YOUR_PRODUCT_NAME>.ipa' file in the same folder as the script and run it with './testflight.sh'.
#!/bin/bash
PRODUCT_NAME=<YOUR_PRODUCT_NAME>
API_TOKEN=<YOUR_TESTFLIGHT_API_TOKEN>
TEAM_TOKEN=<YOUR_TESTFLIGHT_TEAM_TOKEN>
NOTIFY="True"
NOTES="Build uploaded via the upload API"
if [ "$1" ]
then
NOTES="$1"
@alexruperez
alexruperez / UIImageTintCGExtension.swift
Last active March 2, 2021 13:54
UIImage tint with UIColor in Swift
extension UIImage
{
func tint(color: UIColor, blendMode: CGBlendMode) -> UIImage
{
let drawRect = CGRectMake(0.0, 0.0, size.width, size.height)
UIGraphicsBeginImageContextWithOptions(size, false, scale)
let context = UIGraphicsGetCurrentContext()
CGContextClipToMask(context, drawRect, CGImage)
color.setFill()
UIRectFill(drawRect)
@alexruperez
alexruperez / UIResponder+UserActivity.swift
Last active May 6, 2021 00:47
Take advantage of Siri Shortcuts, suggestions and smart reminders by setting a NSUserActivity to your UIViewController or any other UIResponder subclass.
//
// UIResponder+UserActivity.swift
//
import UIKit
import CoreSpotlight
import MapKit
public extension UIResponder {