Skip to content

Instantly share code, notes, and snippets.

View jackbillstrom's full-sized avatar
🇺🇦
slava ukraini 🔱

Jack Billström jackbillstrom

🇺🇦
slava ukraini 🔱
View GitHub Profile
#Import
import urllib.request as urllib, simplejson as json, requests
###################
##REKOGNITION API##
###################
api_key = "J6Ae2VVVGb1cyAbg" #Rekognition API
api_secret = "hffKwlkifKuhTTAG" #Rekognition Secret
file_path = "https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/526864_633402230024779_1245785159_n.jpg" #Identify this face
namespace = "multify" #Rekognition namespace
@jackbillstrom
jackbillstrom / KML2JSON.py
Created August 11, 2013 22:00
Converts a *.kml file to *.json, removes height. Working on to switch places with arrays. Python 3.3.2
#!/usr/bin/python
import simplejson as json, re
print ("KML to JSON")
filename = input("Select file: ")
outputFile = input("Desired filename for output: ")
fileObj = open(outputFile + ".json","w")
output = (json.dumps(dict( (entry[0].strip(), entry[1].strip())
for entry in re.findall('<name>(.*?)</name>.*?<coordinates>(.*?)</coordinates>(?s)', open(filename + ".kml").read() ) )))
clean1 = output.replace(",0 ",",")
@jackbillstrom
jackbillstrom / explodera.php
Last active December 20, 2015 08:19
Papi JSON
<?php
$dwarf = "17.34502870451717,62.46137370987033,17.34501402936927,62.46123453616544,17.34525377433593,62.4610178881864,17.34546663705899,62.46099839740604,17.34566621273138,62.46098822009279,17.34597592883743,62.46095756568258,17.34640474509069,62.46088952586003,17.34716518911271,62.46074877399711,17.34761576297073,62.46066074389314,17.34879498242363,62.46038741792914,17.34915317094747,62.4603161298562,17.35056519306063,62.46000305573813,17.35230022003604,62.45963217038926,17.35346274155991,62.45934921267594,17.3543138909648,62.45911726244587,17.35472558279992,62.45899992155124,17.35523470402396,62.45883676400465,17.35601926542549,62.45857027754547,17.35676652393044,62.45833373872782,17.35680234727865,62.45817663420456,17.35669419069984,62.45817985064164,17.35607741240524,62.45826581079719,17.3552555003528,62.45833077313102,17.35450014552348,62.45836448752974,17.35375776975728,62.45836139642434,17.35200635209792,62.45834763502941,17.35080761277317,62.45833739654373,17.34975014413408,62.45832665770
"stations": [
{ "point": [ 62.392121,17.309204 ], "name":"Sundsvall busstation Navet" },
{ "point": [ 62.392248,17.309964 ], "name":"FD Sundsvall busstation" },
{ "point": [ 62.392029,17.304462 ], "name":"Sundsvall Ågatan" },
{ "point": [ 62.393593,17.305062 ], "name":"Sundsvall Norrmalmsgatan" },
{ "point": [ 62.394682,17.31144 ], "name":"Sundsvall Kommunhuset" },
{ "point": [ 62.389331,17.307517 ], "name":"Sundsvall Trädgårdsgatan" },
{ "point": [ 62.39524,17.306285 ], "name":"Sundsvall Tivolibacken" },
{ "point": [ 62.395072,17.312678 ], "name":"Sundsvall Vårdcentralen" },
{ "point": [ 62.389148,17.304492 ], "name":"Sundsvall Thulegatan" },
{
"Kristinelund": "62.393027,17.253883",
"Nackstaskolan": "62.393056,17.259538",
"Nacksta Centrum": "62.392022,17.26399",
"Vinkeltået": "62.390505,17.271229",
"Östra Långgatan": "62.388104,17.29991",
"Bussnavet": "62.392169,17.309103",
"Nackstavägen 38": "62.39147,17.249656",
"Nackstavägen 22": "62.389367,17.252607",
"Värmeverket": "62.387221,17.269038",