Skip to content

Instantly share code, notes, and snippets.

Rafael Aguilar rais38

Block or report user

Report or block rais38

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rais38
rais38 / gist:6d8f1b49da73e6fab743
Created Jul 18, 2014
UITextViews in a UITableView link detection bug in iOS 7
View gist:6d8f1b49da73e6fab743
# http://stackoverflow.com/a/23119866/1379492
- (void)prepareForReuse
{
[super prepareForReuse];
self.textView.editable = YES;
self.textView.editable = NO;
self.textView.text = nil;
}
View gist:6ecead686af9291da542
Set a watchpoint on a variable when it is written to.
(lldb) watchpoint set variable -w write global_var
(lldb) watch set var -w write global_var
(gdb) watch global_var
Set a watchpoint on a memory location when it is written into. The size of the region to watch for defaults to the pointer size if no '-x byte_size' is specified. This command takes raw input, evaluated as an expression returning an unsigned integer pointing to the start of the region, after the '--' option terminator.
(lldb) watchpoint set expression -w write -- my_ptr
(lldb) watch set exp -w write -- my_ptr
(gdb) watch -location g_char_ptr
Set a condition on a watchpoint.
(lldb) watch set var -w write global
@rais38
rais38 / gist:11272383
Created Apr 24, 2014
Retrieve current branch OSX
View gist:11272383
- (NSString *)projectDirectoryPath
{
NSWindowController *currentWindowController = [[NSApp mainWindow] windowController];
id document = [currentWindowController document];
if (currentWindowController && [document isKindOfClass:NSClassFromString(@"IDEWorkspaceDocument")]) {
NSURL *workspaceDirectoryURL = [[[document valueForKeyPath:@"_workspace.representingFilePath.fileURL"] URLByDeletingLastPathComponent] filePathURL];
if(workspaceDirectoryURL) {
return [workspaceDirectoryURL path];
}
}
@rais38
rais38 / gist:9957819
Last active Aug 29, 2015
Remove multiple (same) entries on "open with" (OSX)
View gist:9957819
$ /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\LaunchServices.framework/Versions/A/Support/\
lsregister -kill -r -domain local -domain user
$ killall Finder
@rais38
rais38 / BETTestSemaphor.h
Created Mar 26, 2014
Semaphor for wait a action.
View BETTestSemaphor.h
//
// BETTestSemaphor.h
// TwitterClient
//
// Created by Rafael Aguilar Martín on 11/11/12.
// Copyright (c) 2012 Rafael Aguilar Martín. All rights reserved.
//
#import <Foundation/Foundation.h>
@rais38
rais38 / gist:8664759
Created Jan 28, 2014
Perfect for debugging animations
View gist:8664759
p [(CALayer *)[[[[UIApplication sharedApplication] windows] objectAtIndex:0] layer] setSpeed:.1f]
@rais38
rais38 / Appirater.md
Last active Dec 30, 2015
Pequeño documento donde explico los parámetros más interesantes de Appirater
View Appirater.md

##Appirater

Appirater creo que es la librería open source más utilizada en Objective-C para recordar al usuario que si le gusta nuestra app que la vote.

###Configuración

daysUntilPrompt

Los usuarios tendrán que tener la misma versión para que surta efecto. Se puede configurar el número de días que han pasado de la última vez que se mostró el aviso.

usesUntilPrompt

@rais38
rais38 / gist:7589410
Last active Dec 29, 2015
How to Create an OS X Mavericks USB Installation Drive.
View gist:7589410

@see http://lifehacker.com/how-to-create-an-os-x-mavericks-usb-installation-drive-1450280026

  • Download OS X Mavericks from the Mac App Store, if you haven't already. If it tries to start the installation, just close it.
  • Insert your USB drive (you'll need one that's 8GB or larger) and open Disk Utility.
  • Select your drive in the sidebar and go to the Erase tab. Format the drive as "Mac OS Extended (Journaled)" and name the drive "Untitled." (Note: if you already have a drive or partition named "Untitled" connected to your computer, name it something else and change the corresponding variable in step 5's terminal command, or you might experience data loss!).
  • Click the Erase button and wait for Disk Utility to finish.
  • Close Disk Utility and open up a Terminal window. Copy and paste the command into the Terminal.
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointe
@rais38
rais38 / gist:7352813
Created Nov 7, 2013
Show/Hidden all files in OSX
View gist:7352813
$ defaults write com.apple.finder AppleShowAllFiles -boolean true;
$ killall Finder
You can’t perform that action at this time.