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 / 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;
/*
* 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
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",,,
6528,"00CA","small_airport","Goldstone /Gts/ Airport",35.350498199499995,-116.888000488,3038,"NA","US","US-CA","Bar
@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
00ID,small_airport,Delta Shores Airport,48.145301818847656,-116.21399688720703,2064,US,Clark Fork
@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
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
Delta Shores Airport,48.145301818847656,-116.21399688720703,US,Clark Fork,2064
@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 / MinimalHTTPServer.scala
Last active March 28, 2016 04:44
minimal scala HTTP server (proof of concept, for courses)
package scala.examples.web
import java.net.InetSocketAddress
import java.util.concurrent.Executors
import com.sun.net.httpserver.HttpExchange
import com.sun.net.httpserver.HttpHandler
import com.sun.net.httpserver.HttpServer
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.InetAddress
@seralf
seralf / classes_usage.scala
Last active March 29, 2016 23:02
examples with simple Scala "bean" classes
package examples.scala.php
object MainProve extends App {
Predef println "Hello world!"
val p1 = new Person1("John", "Doe")
println(p1)
val p2 = new Person2("John", "Doe")
@seralf
seralf / node-and-npm-in-30-seconds.sh
Created July 7, 2016 10:18 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh