Skip to content

Instantly share code, notes, and snippets.

@aleciogomes
aleciogomes / Project-Info.plist
Created October 16, 2014 15:05
iOS 8 Location Services request
<!-- All the string tags can, but shouldn't, be empty -->
<!-- When your app uses location when active (foreground) -->
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used in &apos;Near Me&apos; and &apos;Directions&apos;</string>
<!-- When your app uses location always (including background) -->
<key>NSLocationAlwaysUsageDescription</key>
<string>Used to track your location and inform your GF in case of cheating.</string>
@aleciogomes
aleciogomes / Roteiro
Last active August 29, 2015 14:01
Nginx script
# SSH into machine
# Update packages
sudo yum update
# Create deploy user
sudo adduser deploy
# Install system-wide RVM
\curl -sSL https://get.rvm.io | sudo bash -s stable
@aleciogomes
aleciogomes / CLAuthorizationStatus
Created March 2, 2014 19:27
Exemplo para checar se o status o Serviço de Localização.
CLAuthorizationStatus authorization = [CLLocationManager authorizationStatus];
if ([CLLocationManager locationServicesEnabled] && authorization != kCLAuthorizationStatusAuthorized) {
// Ativado, mas não está autorizado para o app
} else if (![CLLocationManager locationServicesEnabled]) {
// Desativado
}
@aleciogomes
aleciogomes / gist:3906032
Created October 17, 2012 15:04
UITableView animated update
// ...
@property (nonatomic) NSMutableArray* rowDescriptions;
// ...
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.rowDescriptions.count;
}
// ...