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 / 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 / NSString+SnakeCaseToTitleCase.h
Created May 10, 2013 07:35
How to convert a NSString from snake_case to Title Case in Objective-C
//
// NSString+SnakeCaseToTitleCase.h
//
// Copyright (c) 2013 alexruperez.
//
#import <Foundation/Foundation.h>
@interface NSString (SnakeCaseToTitleCase)
@alexruperez
alexruperez / NSDictionary+AllKeysStartingWith.h
Created May 10, 2013 07:46
How to get all keys starting with a common NSString in a NSDictionary
//
// NSDictionary+AllKeysStartingWith.h
//
// Copyright (c) 2013 alexruperez.
//
#import <Foundation/Foundation.h>
@interface NSDictionary (AllKeysStartingWith)
@alexruperez
alexruperez / ARRegisterForRemoteNotificationTypes.m
Last active August 29, 2015 14:02
- registerForRemoteNotificationTypes:categories: NS_AVAILABLE_IOS(3_0); ( iOS 8 Compatible )
- (void)registerForRemoteNotificationTypes:(NSUInteger)notificationTypes categories:(NSSet *)categories
{
if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)] && [UIApplication instancesRespondToSelector:@selector(registerForRemoteNotifications)])
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:notificationTypes categories:categories]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else if ([UIApplication instancesRespondToSelector:@selector(registerForRemoteNotificationTypes:)])
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes];
@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 / ParseExtensions.h
Created December 9, 2014 16:04
Parse Extensions Categories Objective-C iOS SDK
//
// ParseExtensions.h
//
// Created by Alejandro Rupérez on 9/12/14.
//
#import <Foundation/Foundation.h>
#import <Parse/Parse.h>
@alexruperez
alexruperez / MKMapView (setVisibleMapAnnotations).swift
Created December 29, 2014 15:52
MKMapView extension with setVisibleMapAnnotations edgePadding animated helper in Swift
extension MKMapView
{
func setVisibleMapAnnotations(edgePadding: UIEdgeInsets, animated: Bool)
{
var zoomRect = MKMapRectNull
for annotationObject in annotations
{
let annotation = annotationObject as MKAnnotation
let annotationPoint = MKMapPointForCoordinate(annotation.coordinate)
@alexruperez
alexruperez / ARURLOperation.h
Last active August 29, 2015 14:13
ARURLOperation -> NSOperation subclass. NSURLRequest. NSURLConnection. NSURLResponse. Response NSData. NSError. KVO. NSThread. NSRunLoop.
//
// ARURLOperation.h
// ARURLOperation
//
// Created by alexruperez on 13/1/15.
//
//
#import <Foundation/Foundation.h>
@alexruperez
alexruperez / ARSafariViewController.h
Last active April 4, 2016 10:37
Fix SFSafariViewController StatusBar Style, StatusBar Hidden and freezing when swiping back on iOS 9.2
//
// ARSafariViewController.h
//
// Copyright © 2016 alexruperez. The MIT License (MIT)
//
@import SafariServices;
@interface ARSafariViewController : SFSafariViewController
@alexruperez
alexruperez / DDCLSLogger.h
Created August 22, 2016 18:04
Custom CocoaLumberjack logger which sends logs to Crashlytics.
@import CocoaLumberjack;
@interface DDCLSLogger : DDAbstractLogger
@end