Skip to content

Instantly share code, notes, and snippets.

View incanus's full-sized avatar

Justin R. Miller incanus

View GitHub Profile

Native OS X OpenStreetMap editing app

Reasoning

Prompted by:

Who wants to write a Mac-native OSM editor with me?

— Ian Dees (@iandees) February 9, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

And a few more key followups:

Keybase proof

I hereby claim:

  • I am incanus on github.
  • I am incanus (https://keybase.io/incanus) on keybase.
  • I have a public key whose fingerprint is 2231 DFF0 869E E3A5 885A E7D4 F787 7A2B C9C4 0C31

To claim this, I am signing this object:

@incanus
incanus / aeropress.md
Last active August 29, 2015 14:02
This is how I brew coffee in an AeroPress.
  • For one regular mug / two shots, use one cup of water (bottom line) and two scoops of beans.
  • For my Peregrine mug / three shots, use 1.5 cups of water (between the two lines) and three scoops of beans.
  • For a Klean Kanteen / four shots, use two cups of water (top line) and four scoops of beans.

Make sure all the equipment is dry, or else keep the grounds in the grinder lid until right before brewing.

Setup a mug or glass with the press and filter. Put the funnel in the top.

Microwave the water on full power.

@incanus
incanus / wifitricks.md
Last active August 29, 2015 14:08
OS X wifi tricks

Two useful shortcuts for managing known wifi networks on OS X.

If you've got a modern Mac with no Ethernet, your wifi interface is en0. Otherwise, it is en1, so replace that below.

alias wifils='networksetup -listpreferredwirelessnetworks en0'

This lets you list (and possibly grep) all known, previously connected wireless networks. Just type wifils.

@incanus
incanus / gist:808151
Created February 2, 2011 18:41
This is a shell script to open the current Git repository on GitHub in the default browser. Only works at the top level of the working copy and on Mac OS X (for now).
grep github ./.git/config | sed -e 's/^.*\(github.com.*\)\.git$/\1/' -e 's/.*github\.com:*\/*/https:\/\/github.com\//' | xargs open
@incanus
incanus / gist:926686
Created April 19, 2011 02:21
live move of UIPopoverController
// check that popover won't try to move off-screen; dismiss if so
//
CGFloat pX = newAttachPoint.x;
CGFloat pY = newAttachPoint.y;
CGFloat pWidth = balloon.popoverContentSize.width;
CGFloat pHeight = balloon.popoverContentSize.height;
CGFloat mWidth = map.bounds.size.width;
CGFloat mHeight = map.bounds.size.height;
UIPopoverArrowDirection d = balloon.popoverArrowDirection;
@incanus
incanus / gist:1045095
Created June 24, 2011 16:07
constrained override for -[RMMapContents moveBy:] in route-me
- (void)moveBy:(CGSize)delta
{
// Adjust delta as necessary to constrain latitude, but not longitude.
//
// This is largely borrowed from -[RMMapView setConstraintsSW:NE:] and -[RMMapView moveBy:]
//
RMProjectedRect sourceBounds = [self.mercatorToScreenProjection projectedBounds];
RMProjectedSize XYDelta = [self.mercatorToScreenProjection projectScreenSizeToXY:delta];
CGSize sizeRatio = CGSizeMake(((delta.width == 0) ? 0 : XYDelta.width / delta.width),
@incanus
incanus / gist:1108777
Created July 27, 2011 06:09
This is my /etc/apache2/other/svn.conf for making Subversion play with the Mac's system Apache. On Lion, I had to install CollabNet's Subversion package (the 10.6 one) to get stuff into /opt.
LoadModule dav_svn_module /opt/subversion/lib/svn-apache/mod_dav_svn.so
LoadModule authz_svn_module /opt/subversion/lib/svn-apache/mod_authz_svn.so
<Location "/svn">
DAV svn
SVNParentPath /usr/local/svnroot
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/other/htpasswd
Require valid-user
</Location>
NSArray *colorNames = [NSArray arrayWithObjects:@"red", @"blue", @"yellow", @"green", @"brown", @"purple", @"cyan", @"orange", @"magenta", nil];
NSMutableArray *madeColors = [NSMutableArray array];
for (int c = 0; c < [colorNames count]; c++)
[madeColors addObject:[[UIColor class] performSelector:NSSelectorFromString([NSString stringWithFormat:@"%@Color", [colorNames objectAtIndex:c]])]];
@incanus
incanus / gist:1227259
Created September 19, 2011 18:51
symbolicate a stack trace snippet from TestFlight crash reports
cat ~/Desktop/crash1.log | awk '{ print $3 }' | xargs atos -arch armv7 -o MapBox.app.dSYM/Contents/Resources/DWARF/MapBox