Skip to content

Instantly share code, notes, and snippets.

//
// 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 / 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);
//
// 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 / 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+Parallax.h
//
#import <Foundation/Foundation.h>
@interface UIView (Parallax)
-(void)addBackgroundParallax:(CGFloat)strength;
-(void)addForegroundParallax:(CGFloat)strength;
-(void)removeParallax;
@CavalcanteLeo
CavalcanteLeo / Preferences.sublime-settings
Last active August 11, 2016 13:31
Sublime preferences
{
"color_inactive_tabs": true,
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"draw_indent_guides": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
@CavalcanteLeo
CavalcanteLeo / podforceupdate.sh
Created September 28, 2016 20:17 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@CavalcanteLeo
CavalcanteLeo / open xcode project.zshrc
Last active November 11, 2016 17:38
Open xcode from terminal
function xc {
bold=$(tput bold)
normal=$(tput sgr0)
xcode_proj=`find . -name "*.xc*" -d 1 | sort -r | head -1`
if [[ `echo -n $xcode_proj | wc -m` == 0 ]]
then
echo "No xcworkspace/xcodeproj file found in the current directory."
else
echo "Opening ${bold}\033[1;32m$xcode_proj"
open "$xcode_proj"
@CavalcanteLeo
CavalcanteLeo / zsh.md
Created January 28, 2017 04:46 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
//
// MapViewController.h
// MapsCustomInfoWindow
//
// Created by Jon Friskics on 4/22/14.
// Copyright (c) 2014 Jon Friskics. All rights reserved.
//
#import <UIKit/UIKit.h>