Skip to content

Instantly share code, notes, and snippets.

View myell0w's full-sized avatar
🙌

Matthias Tretter myell0w

🙌
View GitHub Profile
@myell0w
myell0w / gist:3006517
Created June 27, 2012 20:05
Objective-C Annotations Syntax Example
@interface AnnotationTest : NSObject
@MyAnnotation (type="surname")
@property (nonatomic, copy) NSString *name;
@end
@myell0w
myell0w / gist:1373050
Created November 17, 2011 12:41
MTLocation How-To
// MTLocation How-To
- (void)viewDidLoad {
[super viewDidLoad];
// 1. Create MapView
self.mapView = [MKMapView mapViewInSuperview:self.view];
// 2. Create BarButtonItem
self.locationItem = [MTLocateMeBarButtonItem userTrackingBarButtonItemForMapView:self.mapView]; // @property (nonatomic, strong) UIBarButtonItem *locationItem;
@myell0w
myell0w / gist:966302
Created May 11, 2011 11:21
MKMapView Annotations
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
// .. Code for other annotations …
if ([annotation isMemberOfClass:[SPCluster class]]) {
MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:kClusterAnnotationViewIdentifier];
if (!annotationView) {
annotationView = [[SPClusterView alloc] initWithAnnotation:annotation reuseIdentifier:kClusterAnnotationViewIdentifier];
}
-- Start Genius for current playing track and display Growl Notification
tell application "iTunes"
activate
set curr_track to name of current track
set curr_artist to artist of current track
set visible of front browser window to true
end tell
tell application "System Events"