Skip to content

Instantly share code, notes, and snippets.

@loganwright
loganwright / regionForCoords.m
Last active August 29, 2015 14:11 — forked from robmooney/gist:923301
Map Region Encompassing Coords w/ Padding
- (MKCoordinateRegion)regionForCoords:(NSArray *)coords withPaddingFactor:(CGFloat)paddingFactor {
CLLocationDegrees minLat = 90.0;
CLLocationDegrees maxLat = -90.0;
CLLocationDegrees minLon = 180.0;
CLLocationDegrees maxLon = -180.0;
for (NSValue *val in coords) {
CLLocationCoordinate2D coord = [val MKCoordinateValue];
if (coord.latitude < minLat) {
@loganwright
loganwright / 0_reuse_code.js
Created May 23, 2014 23:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console