Skip to content

Instantly share code, notes, and snippets.

@mikkohei13
mikkohei13 / ykj_svg_map.py
Last active February 10, 2024 16:47
Reads EPSG:2393 (KKJ / Finland Uniform Coordinate System) coordinates with optional color and draws them as dots on a SVG map.
# Reads EPSG:2393 (KKJ / Finland Uniform Coordinate System) coordinates with optional color and draws them as dots on a SVG map.
# Depends on:
# GeoJSON data from https://gist.github.com/mikkohei13/0acf09633a1635b5363d47c5603fd789
# Sample data from https://gist.github.com/mikkohei13/d03316b75393a1718be5232986e0e2eb
import re
import json
def extract_polygons_from_geojson(file_path):
require 'date'
class FirebasePush
PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'
def initialize
@prev_ts = 0
@rand_chars = Array.new(12)
end
import urllib
import urllib2
try:
# Base url for the TNRS match_names API
url = 'http://api.opentreeoflife.org/v2/tnrs/match_names'
# Encode data value to be looked up as an array of names:
data = '{"names": ["'+value+'"]}'
print "Looking up: " + data
# Set HTTP headers:
@rdmpage
rdmpage / index.html
Last active August 29, 2015 13:58
Edit point location (with georeferencing)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Edit point location (with georeferencing)</title>
<style type="text/css">
body {
margin: 0;
padding: 40px;
@handerson
handerson / LICENSE
Created May 15, 2012 16:19
a very basic Pubmed search API in ruby
Copyright (c) 2012 Heath Anderson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O