Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # Bulk convert shapefiles to geojson using ogr2ogr | |
| # For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/ | |
| # Note: Assumes you're in a folder with one or more zip files containing shape files | |
| # and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere) | |
| #geojson conversion | |
| function shp2geojson() { | |
| ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp" | |
| } | 
I use iTerm 2.
I use 15pt Menlo Regular for Powerline, available here.
| #!/usr/bin/python | |
| # GoogleMapDownloader.py | |
| # Created by Hayden Eskriett [http://eskriett.com] | |
| # | |
| # A script which when given a longitude, latitude and zoom level downloads a | |
| # high resolution google map | |
| # Find the associated blog post at: http://blog.eskriett.com/2013/07/19/downloading-google-maps/ | |
| import urllib | |
| import Image | 
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')
From here on out, use Package Control to install everything. ⌘+Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.
| <p class="results"></p> | |
| <ol> | |
| <li> | |
| <p>Name: Alabama</p> | |
| <p>Capital Name: Montgomery</p> | |
| <p>Capital Latitude: 32.361538</p> | |
| <p>Capital Longitude: -86.279118</p> | |
| </li> | |
| <li> | |
| <p>Name: Alaska</p> | 
| /** Vertical Align element **/ | |
| .element { | |
| position: relative; | |
| top: 50%; | |
| transform: translateY(-50%); | |
| } | 
| function distance(lat1,lon1,lat2,lon2) { | |
| var R = 6371; // km (change this constant to get miles) | |
| var dLat = (lat2-lat1) * Math.PI / 180; | |
| var dLon = (lon2-lon1) * Math.PI / 180; | |
| var a = Math.sin(dLat/2) * Math.sin(dLat/2) + | |
| Math.cos(lat1 * Math.PI / 180 ) * Math.cos(lat2 * Math.PI / 180 ) * | |
| Math.sin(dLon/2) * Math.sin(dLon/2); | |
| var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); | |
| var d = R * c; | |
| if (d>1) return Math.round(d)+"km"; | 
| { | |
| # this is a comment | |
| "a": "hello", | |
| # this is another comment | |
| "b": -1, | |
| "c": [ | |
| true, | |
| "test", | |
| null | |
| ], | 
| function parseVideo (url) { | |
| // - Supported YouTube URL formats: | |
| // - http://www.youtube.com/watch?v=My2FRPA3Gf8 | |
| // - http://youtu.be/My2FRPA3Gf8 | |
| // - https://youtube.googleapis.com/v/My2FRPA3Gf8 | |
| // - Supported Vimeo URL formats: | |
| // - http://vimeo.com/25451551 | |
| // - http://player.vimeo.com/video/25451551 | |
| // - Also supports relative URLs: | |
| // - //player.vimeo.com/video/25451551 |