Skip to content

Instantly share code, notes, and snippets.

@CavalcanteLeo
CavalcanteLeo / xcode-build-bump.sh
Created July 15, 2016 02:36 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
//
// UIView+CustomTimingFunction.h
// Instants
//
// Created by Christian Giordano on 16/10/2013.
// Copyright (c) 2013 Christian Giordano. All rights reserved.
//
#import <UIKit/UIKit.h>
@CavalcanteLeo
CavalcanteLeo / gist:83937e53d5bdf3ef1a6918de16d6a1c8
Created July 8, 2016 04:33 — forked from marsepu/gist:3854078
Triple DES encryption example using the CommonCrypto Library
#import <CommonCrypto/CommonCryptor.h>
#warning ADD Security.framework to your project
+ (NSData *)tripleDesEncryptData:(NSData *)inputData
key:(NSData *)keyData
error:(NSError **)error
{
NSParameterAssert(inputData);
NSParameterAssert(keyData);
//
// ViewController.m
// AVPlayerCaching
//
// Created by Anurag Mishra on 5/19/14.
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer
//
#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>
@CavalcanteLeo
CavalcanteLeo / UIButton+Block.h
Created March 27, 2016 08:57 — forked from azeitler/UIButton+Block.h
iOS - UIButton+Block
//
// UIButton+Block.h
// BoothTag
//
// Created by Josh Holtz on 4/22/12.
// Copyright (c) 2012 Josh Holtz. All rights reserved.
//
#define kUIButtonBlockTouchUpInside @"TouchInside"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GCM_SENDER_ID</key>
<string>***************</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.example.testapp</string>
@CavalcanteLeo
CavalcanteLeo / AppDelegate.m
Created March 22, 2016 02:59
GCM implementation
@interface AppDelegate() <GGLInstanceIDDelegate, GCMReceiverDelegate>
@property(nonatomic, strong) NSString *gcmSenderID;
@property(nonatomic, strong) NSDictionary *registrationOptions;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#import "ImageHelper.h"
#import "EntryHelper.h"
@implementation ImageHelper
@synthesize image;
- (UIImage *)getFullScreenImage{
return [UIImage imageWithContentsOfFile:[self getFullScreenImagePath]];
}
#import <Foundation/Foundation.h>
#import "Image.h"
@interface ImageHelper : NSObject{
@private
Image *image;
}
- (UIImage *)getThumbnailImage;
- (UIImage *)getFullScreenImage;
- (UIImage *)getOriginalImage;
@CavalcanteLeo
CavalcanteLeo / SnapshotHelper.h
Created March 22, 2016 02:55 — forked from vovkasm/SnapshotHelper.h
Objective C implementation of SnapshotHelper class for https://github.com/fastlane/snapshot
/* This SnapshotHelper class should be compatible with SnapshotHelper.swift version 1.2 */
@import Foundation;
@import XCTest;
@interface SnapshotHelper : NSObject
- (instancetype)initWithApp:(XCUIApplication*)app;
- (void)snapshot:(NSString*)name waitForLoadingIndicator:(BOOL)wait;