Skip to content

Instantly share code, notes, and snippets.

View derhuerst's full-sized avatar

Jannis R derhuerst

View GitHub Profile
@weiland
weiland / circulation.jsonc
Created April 27, 2022 10:02
wifi.normandie.fr in-train Wifi
// https://wifi.normandie.fr/router/api/train/circulation
{
"number": "3105",
"circulationCode": "66979ae819749c3a785adc4e657a3fbe",
"origin": {
"name": "Paris Saint-Lazare",
"code": "OCE87384008"
},
"destination": {
"name": "Le Havre",
// https://onboard.sbb.ch/api/v2/content?tag=versioned_flavour_config&tag=v3&lang=en&r=1649759266348&contentType=mpd
[
{
"id": "flavour_config_sbb_v3",
"contentType": "versioned_flavour_config",
"domain": [
"staging-auth.sbb.gomedia.io",
"sbb.mst.gonet",
"test-sbb.mst.gonet",
"sbb.stg.gonet",
@weiland
weiland / info.jsonc
Last active February 10, 2024 07:46
portalefrecce.it (InTrain Wifi 🇮🇹)
// https://www.portalefrecce.it/BobHttpLogger/status/train
// somtimes comes as XML or JSON
{
"BobStatus": {
"Train": {
"Id": "9653",
"Token": "IhRbCoYDMQDm0OVbZbIqXw==",
"MealStatus": "on"
}
}
@roehrt
roehrt / transit_network_germany.csv
Last active May 6, 2022 18:56
Edge list of Germany's transit network (including metropolitan to far-distance transit) weighted by minimum journey time in seconds. This edge list is neither 100 % complete nor official. Based on data from DELFI (2022) and stop data from Deutsche Bahn (2020, https://data.deutschebahn.com/dataset/data-haltestellen.html).
evaA evaB min_duration
8000001 8000084 1560
8000001 8000207 2160
8000001 8000208 2040
8000001 8000404 180
8000001 8000406 120
8000001 8002806 780
8000001 8003363 2220
8000001 8070704 120
8000002 8000170 3840
@kevinkub
kevinkub / incidence.js
Last active June 27, 2023 12:53
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
class IncidenceWidget {
constructor() {
this.previousDaysToShow = 31;
this.apiUrlDistricts = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,GEN,cases7_bl_per_100k,cases7_per_100k,BL&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
this.apiUrlDistrictsHistory = (districtId) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/ArcGIS/rest/services/Covid19_hubv/FeatureServer/0/query?where=IdLandkreis%20%3D%20%27${districtId}%27%20AND%20Meldedatum%20%3E%3D%20TIMESTAMP%20%27${this.getDateString(-this.previousDaysToShow)}%2000%3A00%3A00%27%20AND%20Meldedatum%20%3C%3D%20TIMESTAMP%20%27${this.getDateString(1)}%2000%3A00%3A00%27&outFields=Landkreis,Meldedatum,AnzahlFall&outSR=4326&f=json`
this.stateToAbbr = {
@simonkuhn
simonkuhn / geo.vcl
Last active January 7, 2022 12:16
Fastly VCL for geoip json output
sub vcl_recv {
#FASTLY recv
# We don't do other methods
if (req.method != "GET") {
return(error);
}
# Handle IPv4 or IPv6 provided in url path (nothing extraneous allowed, perform basic matching)
if (req.url.path ~ "^/([a-f0-9:.]+)$") {
set client.geo.ip_override = re.group.1;
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@tmohrbach
tmohrbach / ble-covid19-filter.sql
Last active July 16, 2020 04:27
SQL Filter for Service UUID Exposure Notification
SELECT
datetime(locations.timestamp, 'unixepoch', 'localtime') AS 'Timestamp',
devices.service_data AS 'R. Prox. Identifier',
locations.rssi AS 'RSSI',
locations.latitude AS 'Latitude',
locations.longitude AS 'Longitude'
FROM
devices
INNER JOIN locations ON devices.id = locations.device_id
WHERE
@derhuerst
derhuerst / gtfs-time.md
Last active May 27, 2023 18:16
note about GTFS Time values

Note: An Issue has been opened in the Google Transit repo to clarify the meaning of stop_timezone & agency_timezone.


Time - Time in the HH:MM:SS format (H:MM:SS is also accepted). The time is measured from "noon minus 12h" of the service day (effectively midnight except for days on which daylight savings time changes occur). For times occurring after midnight, enter the time as a value greater than 24:00:00 in HH:MM:SS local time for the day on which the trip schedule begins. Example: 14:30:00 for 2:30PM or 25:35:00 for 1:35AM on the next day.

GTFS field types

Fun fact: if your transit system has a bus starting at 00:30:00 local wall time, then the only proper way I know to encode such bus in GTFS (static) is by defining it as 24:30:00 of the previous day. It is otherwise impossible to encode this bus on a day when time is moved back by 1 hour (that is, the calendar day, when

@n0emis
n0emis / haf_attrib.properties
Last active February 6, 2020 19:30
VSN HaFas APP-Config
BR=0
BT=1
BW=1
FB=2
FK=2
FR=11
FU=2
J2=3
K2=3
KK=4