Skip to content

Instantly share code, notes, and snippets.

View oliverbarreto's full-sized avatar

Oliver oliverbarreto

View GitHub Profile
@jasperf
jasperf / launch_sublime_from_terminal.markdown
Last active April 5, 2020 05:44 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 3 from the Mac OS X Terminal

Launch Sublime Text 3 from the Mac OS X Terminal

Sublime Text 3 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/3/osx_command_line.html

Installation

@naoty
naoty / Playground.swift
Last active April 6, 2018 23:42
A playground to display a table view controller on a navigation controller
import XCPlayground
import UIKit
struct Pokemon {
let id: UInt
let name: String
}
class PokedexViewController: UITableViewController {
let pokemons: [Pokemon] = [
@oliverbarreto
oliverbarreto / Podfile Xcode iOS7.rb
Created December 8, 2013 21:27
Podfile Xcode iOS7 pod 'AFNetworking', '2.0.1' pod 'CocoaLumberjack', '1.6.2' pod 'TestFlightSDK', '1.3.0-beta.6' pod 'TestFlightLogger', '0.0.2'
platform :ios, "7.0"
target "MiProyecto" do
pod 'AFNetworking', '2.0.1'
pod 'CocoaLumberjack', '1.6.2'
pod 'TestFlightSDK', '1.3.0-beta.6'
pod 'TestFlightLogger', '0.0.2'
end
target "MiProyectoTests" do
@oliverbarreto
oliverbarreto / .gitignore & .gitattributes for Xcode Projects
Created December 8, 2013 11:00
.gitignore & .gitattributes for Xcode Projects (Thanks to @sendoa http://www.punteroavoid.com/blog/2013/07/12/iniciando-un-nuevo-proyecto-ios/) Excludes CocoaPods files !!!
// .gitignore
# OS X Finder
.DS_Store
# Xcode per-user config
*.mode1
*.mode1v3
*.mode2v3
*.perspective
@sendoa
sendoa / Dlog.h
Created July 9, 2013 20:33
NSLog and NSAssert substitution macros based on the ones from Marcus Zarra http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ When the app runs on "Release" mode, assertions are linked to TestFlight checkpoints. I always name assertion type checkpoints with "ASSERTION" prefix. Example: Alog(@"ASSERTION_NON_PARSEABLE_ITEM_DATA_RECEIVED");
#ifdef DEBUG
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
#define DLog(...) do { } while (0)
#define ALog(...) [TestFlight passCheckpoint:[NSString stringWithFormat:__VA_ARGS__]]
#ifndef NS_BLOCK_ASSERTIONS
#define NS_BLOCK_ASSERTIONS
#endif
#endif
@sendoa
sendoa / ejemplo.m
Created July 4, 2013 10:04
UILabel con URL clicable
yourTextView.editable = NO;
yourTextView.dataDetectorTypes = UIDataDetectorTypeAll;
@sendoa
sendoa / AppDelegate.h
Created November 27, 2012 14:52
AppDelegate accesible de forma global
#import <UIKit/UIKit.h>
#define ApplicationDelegate ((QBKAppDelegate *)[UIApplication sharedApplication].delegate)
@interface QBKAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (copy, nonatomic) NSString* unaCadena;
@end
@sendoa
sendoa / gist:4135566
Created November 23, 2012 13:13
Obtener UUID
//http://mobiledevelopertips.com/core-services/create-universally-unique-identifier-uuid-the-ios-6-way.html
//The class NSUUID implements RFC 4122 creating values that are 128 bits long and guaranteed to be unique across space and time by using a unique value on the device as well as a value representing the elapsed time since October 15, 1582 at 00:00:00.
// iOS 6
NSUUID *uuid = [NSUUID UUID];
NSLog(@"UUID: %@", [uuid UUIDString]);
// Output: UUID: A84AFC3C-B3A7-31C7-B3E9-234AF423C6B1