Skip to content

Instantly share code, notes, and snippets.

View seralf's full-sized avatar
🎯
Focusing

Alfredo Serafini seralf

🎯
Focusing
View GitHub Profile
@seralf
seralf / geonames.sql
Created October 9, 2015 21:20
geonames
/*
* geonames.db dump
* taken from http://geonames.db.94y.info/
*
* SEE:
* https://github.com/mjradwin/geonames-sqlite
* https://github.com/robotamer/geonames-to-sqlite
*/
@seralf
seralf / airports.csv
Created September 14, 2015 01:57
airports elevations by country
We can't make this file beautiful and searchable because it's too large.
name,latitude_deg,longitude_deg,iso_country,municipality,elevation_ft
Lowell Field,59.94919968,-151.695999146,US,Anchor Point,450
Epps Airpark,34.86479949951172,-86.77030181884766,US,Harvest,820
Cordes Airport,34.305599212646484,-112.16500091552734,US,Cordes,3810
Goldstone /Gts/ Airport,35.350498199499995,-116.888000488,US,Barstow,3038
Cass Field,40.62220001220703,-104.34400177001953,US,Briggsdale,4830
Grass Patch Airport,28.64550018310547,-82.21900177001953,US,Bushnell,53
River Oak Airport,27.230899810791016,-80.96920013427734,US,Okeechobee,35
Lt World Airport,33.76750183105469,-84.06829833984375,US,Lithonia,700
@seralf
seralf / airports.csv
Last active September 4, 2015 17:48
an example to visualize elevations of airports
We can't make this file beautiful and searchable because it's too large.
name,latitude_deg,longitude_deg,iso_country,municipality,elevation_ft
Lowell Field,59.94919968,-151.695999146,US,Anchor Point,450
Epps Airpark,34.86479949951172,-86.77030181884766,US,Harvest,820
Cordes Airport,34.305599212646484,-112.16500091552734,US,Cordes,3810
Goldstone /Gts/ Airport,35.350498199499995,-116.888000488,US,Barstow,3038
Cass Field,40.62220001220703,-104.34400177001953,US,Briggsdale,4830
Grass Patch Airport,28.64550018310547,-82.21900177001953,US,Bushnell,53
River Oak Airport,27.230899810791016,-80.96920013427734,US,Okeechobee,35
Lt World Airport,33.76750183105469,-84.06829833984375,US,Lithonia,700
Delta Shores Airport,48.145301818847656,-116.21399688720703,US,Clark Fork,2064
@seralf
seralf / airports.csv
Last active October 26, 2023 02:48
example 02 with D3
We can't make this file beautiful and searchable because it's too large.
ident,type,name,latitude_deg,longitude_deg,elevation_ft,iso_country,municipality
00AK,small_airport,Lowell Field,59.94919968,-151.695999146,450,US,Anchor Point
00AL,small_airport,Epps Airpark,34.86479949951172,-86.77030181884766,820,US,Harvest
00AZ,small_airport,Cordes Airport,34.305599212646484,-112.16500091552734,3810,US,Cordes
00CA,small_airport,Goldstone /Gts/ Airport,35.350498199499995,-116.888000488,3038,US,Barstow
00CO,small_airport,Cass Field,40.62220001220703,-104.34400177001953,4830,US,Briggsdale
00FA,small_airport,Grass Patch Airport,28.64550018310547,-82.21900177001953,53,US,Bushnell
00FL,small_airport,River Oak Airport,27.230899810791016,-80.96920013427734,35,US,Okeechobee
00GA,small_airport,Lt World Airport,33.76750183105469,-84.06829833984375,700,US,Lithonia
We can't make this file beautiful and searchable because it's too large.
"id","ident","type","name","latitude_deg","longitude_deg","elevation_ft","continent","iso_country","iso_region","municipality","scheduled_service","gps_code","iata_code","local_code","home_link","wikipedia_link","keywords"
6523,"00A","heliport","Total Rf Heliport",40.07080078125,-74.93360137939453,11,"NA","US","US-PA","Bensalem","no","00A",,"00A",,,
6524,"00AK","small_airport","Lowell Field",59.94919968,-151.695999146,450,"NA","US","US-AK","Anchor Point","no","00AK",,"00AK",,,
6525,"00AL","small_airport","Epps Airpark",34.86479949951172,-86.77030181884766,820,"NA","US","US-AL","Harvest","no","00AL",,"00AL",,,
6526,"00AR","heliport","Newport Hospital & Clinic Heliport",35.608699798583984,-91.25489807128906,237,"NA","US","US-AR","Newport","no","00AR",,"00AR",,,
6527,"00AZ","small_airport","Cordes Airport",34.305599212646484,-112.16500091552734,3810,"NA","US","US-AZ","Cordes","no","00AZ",,"00AZ",,,
/*
* A parser combinator SPARQL grammar for Scala.
* Written in November 2009 by Arto Bendiken <http://ar.to/>
*
* This is free and unencumbered software released into the public domain.
* For more information, please refer to <http://unlicense.org/>
*/
package org.datagraph.sparql
import java.io.FileReader
@seralf
seralf / MinimalHttpServer.java
Last active May 9, 2017 18:10
Jetty9 / Jersey2 / minimal http server (with Java and Scala)
package example.server.embedded;
import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.eclipse.jetty.server.Server;
import org.glassfish.jersey.jetty.JettyHttpContainerFactory;
import org.glassfish.jersey.server.ResourceConfig;
var yasqe = YASQE(document.getElementById("yasqe"), {
sparql: {
showQueryButton: true
}
});
var yasr = YASR(document.getElementById("yasr"), {
//this way, the URLs in the results are prettified using the defined prefixes in the query
getUsedPrefixes: yasqe.getPrefixesFromQuery
});
@seralf
seralf / json_data.json
Created April 2, 2014 22:20
Idea on how to render data to CSV from JSON, using mustache syntax: http://mustache.github.io/mustache.5.html
{
"items": [
{"name": "nome", "surname": "cognome", "city": "Rome", "header": true},
{"name": "Mario", "surname": "Rossi", "city": "Rome"},
{"name": "Paperino", "surname": "Paolino", "city": "Paperopoli"}
]
}
@seralf
seralf / TestTinkerpopVirtuosoSPARQL.java
Last active January 8, 2016 08:38
Testing virtuoso with Tinkerpop, via Sail
public class TestTinkerpopVirtuosoSPARQL {
public static void main(String[] args) throws Exception {
Graph graph = new SparqlRepositorySailGraph("http://localhost:8890/sparql");
int i = 0;
Iterable<Edge> edges = graph.getEdges();
for (Edge edge : edges) {
System.out.println(edge);