Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
| # Ruby opposite of array intersection... or maybe the method is missing from my brain bc not enough coffee | |
| # http://twitter.com/soawesomeman/status/8035087261 | |
| def awesome(ar_1, ar_2) | |
| (ar_1 + ar_2) - (ar_1 & ar_2) | |
| end | |
| awesome([1,2,3,4], [3,4,5,6]) # => [1, 2, 5, 6] | |
| git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d |
| require 'bundler/setup' | |
| # From: https://gist.github.com/drogus/6087979 | |
| require 'active_record' | |
| include ActiveRecord::Tasks | |
| db_dir = File.expand_path('../db', __FILE__) | |
| config_dir = File.expand_path('../config', __FILE__) |
| 1. Download US Tigerline ZCTA shapefiles (I pulled entire US, 2013 version at time of this gist) | |
| 2. Ensure GDAL is installed w/ postgresql flags | |
| // see http://gis.stackexchange.com/questions/33346/how-can-i-update-ogr2ogr-to-include-the-postgresql-driver | |
| brew uninstall gdal (if installed) | |
| brew install gdal --with-postgresql | |
| 3. Convert and import ogr2ogr (my db name is gis_data) | |
| // -nlt MULTIPOLYGON needed b/c it will try to import as regular POLYGON and fail | |
| // NOTE: this will fail if table already exists w/same name (use --append or delete the table to start over) |
| --colour | |
| -I app |
| For those of you who get this error after upgrading to mountain lion: | |
| Installing rmagick (2.13.1) with native extensions | |
| Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. | |
| /Users/user/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby extconf.rb | |
| checking for Ruby version >= 1.8.5... yes | |
| extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config. | |
| checking for /usr/bin/gcc-4.2... no |