Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| // See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for more details. | |
| var degrees2meters = function(lon,lat) { | |
| var x = lon * 20037508.34 / 180; | |
| var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); | |
| y = y * 20037508.34 / 180; | |
| return [x, y] | |
| } | |
| x= -77.035974 |
| <?php | |
| function longest_common_substring($words) | |
| { | |
| $words = array_map('strtolower', array_map('trim', $words)); | |
| $sort_by_strlen = create_function('$a, $b', 'if (strlen($a) == strlen($b)) { return strcmp($a, $b); } return (strlen($a) < strlen($b)) ? -1 : 1;'); | |
| usort($words, $sort_by_strlen); | |
| // We have to assume that each string has something in common with the first | |
| // string (post sort), we just need to figure out what the longest common | |
| // string is. If any string DOES NOT have something in common with the first | |
| // string, return false. |
| (* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *) | |
| tell application "Google Chrome" | |
| activate | |
| set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl" | |
| if (count every window) = 0 then | |
| make new window | |
| end if | |
| set found to false |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| # Please fork if you can improve this. (e.g. Windows support) | |
| # | |
| # Ruby 1.9 doesn't contain any SSL root certificates, neither does it read the ones | |
| # installed with your operating system. This results in an error like | |
| # | |
| # SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed | |
| # | |
| # This solution is based on http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/ | |
| # but can be used to monkey patch 3rd party tools, e.g. Github's 'gist' command. | |
| # |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
Loris is an Implementation of the IIIF (International Image Interoperability Framework) Image API specification. Loris is designed to work w/ JPEG2000 files, but this is not part of the spec.
IIIF defines a Syntax for accessing images:
/identifier/region/size/rotation/quality(.format)?
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'json' | |
| require 'google/api_client' | |
| require 'active_support/core_ext/hash' | |
| # 1. Go to Google Cloud Console (https://cloud.google.com/console) | |
| # 2. Create Service Account with P12 File | |
| # 3. Enable the Admin SDK in APIs. |
| (function () { | |
| var e = {}, t = {}, n = 0, | |
| r = { | |
| refreshStylesheets: function () { | |
| function i(e) { | |
| var t = document.location, | |
| n = new RegExp("^\\.|^/(?!/)|^[\\w]((?!://).)*$|" + t.protocol + "//" + t.host); | |
| return e.match(n) | |
| } | |
| var n = document.getElementsByTagName("head")[0], |