This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)layoutSubviews { | |
| [super layoutSubviews]; | |
| float indentPoints = self.indentationLevel * self.indentationWidth; | |
| if (indentPoints > 0) { | |
| [self.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | |
| UIView *view = (UIView *)obj; | |
| CGFloat width = CGRectGetWidth(view.frame); | |
| if (width > indentPoints * 2) | |
| width -= indentPoints; | |
| CGFloat x = CGRectGetMinX(view.frame); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSArray *receivedInstances = [[[request responseString] JSONValue] valueForKeyPath:@"groups.instances"]; | |
| NSMutableArray *ids = [NSMutableArray array]; | |
| for (NSDictionary *dict in receivedInstances) { | |
| [ids addObject:[dict valueForKey:@"id"]]; | |
| } | |
| //Do something with the ids... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [placeRequest setPredicate:[NSPredicate predicateWithFormat:@"longitude BETWEEN %@ && latitude BETWEEN %@", | |
| [NSArray arrayWithObjects: | |
| [NSExpression expressionForConstantValue: | |
| [NSNumber numberWithDouble:(self.locationManager.location.coordinate.longitude - 0.35f)]], | |
| [NSExpression expressionForConstantValue: | |
| [NSNumber numberWithDouble:(self.locationManager.location.coordinate.longitude + 0.35f)]], | |
| nil], | |
| [NSArray arrayWithObjects: | |
| [NSExpression expressionForConstantValue: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :database do | |
| task :start do | |
| pid_file = File.open("#{Rails.root}/tmp/pids/postgres.pid", 'a+') | |
| pid = pid_file.gets.to_i | |
| begin | |
| Process.kill('TERM', pid.to_i) unless pid.nil? | |
| rescue | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface MyObject : NSObject { | |
| BOOL publicBoolean; | |
| @private | |
| BOOL privateBoolean | |
| } | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MyObject *object = [[MyObject alloc] init]; | |
| [object->someRetainedProperty release]; | |
| object->someRetainedProperty = [aProperty retain]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| function retina-resize-image { | |
| IMAGES=$@ | |
| RADIUS='1' | |
| SIGMA='0.0' | |
| FILTER=Catrom | |
| for image in $IMAGES; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)layoutSubviews { | |
| [self.fullNameLabel sizeToFit]; | |
| [self.bioTitleLabel sizeToFit]; | |
| [self.emailLabel sizeToFit]; | |
| self.profilePictureView.frame = CGRectOffset(self.profilePictureView.bounds, 15, 15); | |
| self.fullNameLabel.frame = CGRectOffset(self.fullNameLabel.bounds, CGRectGetMaxX(self.profilePictureView.frame) + 10, | |
| CGRectGetMidY(self.profilePictureView.frame) - 25); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (self.rightItem == item) { | |
| item.layer.anchorPoint = CGPointMake(1, 0.5); | |
| } else { | |
| item.layer.anchorPoint = CGPointMake(0, 0.5); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Place all the behaviors and hooks related to the matching controller here. | |
| # All this logic will automatically be available in application.js. | |
| # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script | |
| $.morpheus = require("morpheus") | |
| $.sugare = require("sugar") | |
| class PHIntroList | |
| PHIntroList.prototype.setPageView = (pageviewEl) -> | |
| @pageView = pageviewEl |