Skip to content

Instantly share code, notes, and snippets.

View Bertware's full-sized avatar

Bertware Bertware

View GitHub Profile
@Bertware
Bertware / Sweden_AL7_OSM.geojson
Last active August 3, 2020 16:57
This script adds the municipality (kommun) to every stop in a stops.txt file based on the coordinates and OSM administrative borders data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Wireless protocol for 433MHz thermometers

Wireless thermometers are cheap, last years on a single set of batteries, and are made to be exposed to the elements. Because of this, they are a good alternative to building your own wireless temperature sensor. The following document describes the wireless signal and protocol for one type of these thermometer types.

Compatible devices

This is a non exhaustive list of devices for which the following specifications should work. You can recognize the outdoor temperature sensor by its distinguished shape.

Example brands for this thermometer:

{
"responseId": "3e969628-cf8e-4d99-9bb3-4788f22a0866",
"queryResult": {
"queryText": "when is the next train from Stockholm",
"action": "get-next-departure",
"parameters": {
"transportation-method": "train",
"location": "Stockholm"
},
"allRequiredParamsPresent": true,
@Bertware
Bertware / datasets_config.json
Created November 20, 2018 16:10
Demo configuration for linked-connections-server for almost half of sweden, using https://gist.github.com/Bertware/5255b8e6ad316415c697a1c6ace67e19 to create GTFS files
{
"storage": "/var/www/se.lc.bertmarcelis.be/storage",
"datasets":[
{
"companyName": "ul",
"downloadUrl": "./splitGtfs/ul.zip",
"downloadOnLaunch": true,
"updatePeriod": "0 0 0 0 1 *",
"fragmentSize": 500000,
"realTimeData": false,
@Bertware
Bertware / gtfsToStationsLd.php
Last active November 20, 2018 16:19
Prototype PHP script to convert a GTFS archive into a
<?php
/**
* Ćreate a stations list, agencies list, stations list per agency, stops files from GTFS.
* Due to a lack of time this doesn't output 100% valid linked data (yet), but it's good enough for now
*
* Free to use, adapt, modify, redistribute however you want at your own responsibility.
*
* Requirements:
* php-zip
@Bertware
Bertware / eat.html
Last active December 18, 2018 11:53
Liveboard, Train and Earliest Arrival Time demos based on Linked Connections
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Linked Connections Trains</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<style>
tr:first-of-type {
background-color: #c7292933 !important;
@Bertware
Bertware / heatmap-vt-sj.html
Last active December 6, 2018 13:33
Linked Connections to isochrone or heatmap map
<!Doctype html>
<html prefix="dct: http://purl.org/dc/terms/
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
foaf: http://xmlns.com/foaf/0.1/
og: http://ogp.me/ns#">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>LC2Heat</title>
@Bertware
Bertware / splitGtfs.php
Last active October 17, 2018 13:30
Split GTFS files into one file per transport operator
<?php
const GTFS_PATH = '/tmp/gtfs/';
const TARGET_DIR = './splitGtfs/';
@mkdir(GTFS_PATH);
@mkdir(TARGET_DIR);
if (! file_exists(GTFS_PATH . "sweden.zip")){
echo 'getting GTFS...';
@Bertware
Bertware / Aantal_vertrekken.eps
Last active June 20, 2019 18:41
Master thesis scripts and intermediary results
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 567 340
%%Pages: 0
%%Creator: LibreOffice 5.1
%%Title: none
%%CreationDate: none
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
%%BeginResource: procset SDRes-Prolog 1.0 0
@Bertware
Bertware / vrtnu_scraper.php
Created March 21, 2018 13:13
Quick-and-dirty PHP script to Scrape information on all available episodes from vrtnu.be. create a json representation for each page, and a list which puts everything together
<?php
function file_put_contents_rec($file, $data)
{
$file = ltrim($file, '/');
$folder = substr($file, 0, -1 * strlen(basename($file)));
if (!is_dir($folder)) {
// dir doesn't exist, make it
mkdir($folder, 0777, true);
}