Skip to content

Instantly share code, notes, and snippets.

View ferbass's full-sized avatar
:octocat:
ι(`ロ´)ノ

Fernando Bass ferbass

:octocat:
ι(`ロ´)ノ
View GitHub Profile
@ferbass
ferbass / gist:1010989
Created June 6, 2011 20:09
How to remove xcode
sudo /Developer/Library/uninstall-devtools --mode=all
@ferbass
ferbass / gist:1289704
Created October 15, 2011 15:25
GitIgnore for xcode 4.x
.DS_Store
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
@ferbass
ferbass / gist:1713769
Created January 31, 2012 23:27
sample twitter message with sharekit
-(IBAction)sendMessage
{
NSString *text = [NSString stringWithString:@"SUA MENSAGEM"];
SHKItem *item = [SHKItem text:text];
[SHKTwitter shareItem:item];
}
@ferbass
ferbass / gist:6911840
Created October 10, 2013 01:54
create a dashed border using CoreGraphics, in your custom view puts thats code on drawRect method.
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [[UIColor grayColor] CGColor]);
CGFloat dashes[] = {1,1};
CGContextSetLineDash(context, 0.0, dashes, 2);
CGContextSetLineWidth(context, 1.0);
@ferbass
ferbass / gist:7231889
Created October 30, 2013 12:32
Objective-C ZigZag line with CoreGraphics
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [[UIColor colorWithRed:241.0/255.0 green:241.0/255.0 blue:238.0/255.0 alpha:1] CGColor]);
CGContextSetLineWidth(context, 0.6);
CGContextMoveToPoint(context, CGRectGetMinX(rect), CGRectGetMaxY(rect) - 5);
@ferbass
ferbass / gist:7239784
Last active December 27, 2015 00:39
create a circle in view using bezierpath wi
- (void)drawRect:(CGRect)rect
{
CGRect box = CGRectInset(self.bounds, self.bounds.size.width * 0.1f, self.bounds.size.height * 0.1f);
UIBezierPath *ballBezierPath = [UIBezierPath bezierPathWithOvalInRect:box];
[[UIColor whiteColor] setStroke];
[[UIColor colorWithRed:0.734 green:0.000 blue:0.000 alpha:1.000] setFill];
@ferbass
ferbass / gist:281947f23f47fb1a6011
Created July 21, 2014 16:47
Disable iTunesHelper
sudo mv /Applications/iTunes.app/Contents/MacOS/iTunesHelper.app /Applications/iTunes.app/Contents/MacOS/iTunesHelper-disable.app
@ferbass
ferbass / gist:3ecc06a8ae992365bf73
Created September 20, 2014 03:04
Xcode failed to download. Use the Purchases page to try again.
Steps:
Open Terminal.
Run the following command:
defaults write com.apple.appstore ShowDebugMenu -bool true
Relaunch the App Store.
Choose the menu item Debug → Reset Application.
@ferbass
ferbass / gist:c5a6993cb7b8b56fadbe
Created November 28, 2014 02:12
gitignore previously tracked files
git ls-files --ignored --exclude-standard | xargs git rm --cached
label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];