Skip to content

Instantly share code, notes, and snippets.

View phibo23's full-sized avatar

Philipp Bohnenstengel phibo23

View GitHub Profile
@phibo23
phibo23 / fb2ical.php
Last active October 5, 2015 12:47 — forked from cognitom/fb2ical.php
Export ical format for Facebook page's events by cognitom. Modifications: pageId as parameter, restriction to public events, improved timezone adjustment, ignore exceptions
<?php
/*
original code by cogitom: https://gist.github.com/997980/
This script reads future events (plus several days into the past) from Facebook pages
and creates a subscribable iCalendar
Improvements upon the original version:
- fixed start and endtime reading
- timezone adjustment done on facebook's side (more reliable)
@phibo23
phibo23 / spn19.cpp
Last active June 3, 2019 13:45
Schlangenprogrammiernacht GPN19
// You can use the entire C/C++ standard library, just add the relevant
// #includes. We recommend math.h ;-)
#include <algorithm>
#include <string>
#include "usercode.h"
/*
* This is your bot's startup function. Here you can set your snake's colors,
* set up persistent variables, etc.
*/
@phibo23
phibo23 / rc3.world-map-bookmarklet
Created December 29, 2020 22:03
rc3.world map bookmarklet
javascript:(function(){ var patharray=location.pathname.split('/');var mapurl='https://raw.githubusercontent.com/MichaelKreil/rc3-map-scraper/master/image/https___' + patharray.slice(-1*(patharray.length-patharray.indexOf('global')-1)).join('_').replaceAll('.','_') + '.png';if(!patharray.includes('lobby')){mapurl=mapurl.replace('rc3_world_','rc3_world__')}window.open(mapurl)})();
@phibo23
phibo23 / iceportal.js
Created January 3, 2024 15:10
ICE Portal iOS Widget with Scriptable App
const widget = new ListWidget()
const request = new Request('https://iceportal.de/api1/rs/status')
// {"connection":true,"serviceLevel":"AVAILABLE_SERVICE","gpsStatus":"LAST_KNOWN_POSITION","internet":"MIDDLE","latitude":50.9862425,"longitude":9.572488166666666,"tileY":109,"tileX":-2,"series":"412","serverTime":1704210660163,"speed":189.0,"trainType":"ICE","tzn":"ICE9474","wagonClass":"FIRST","connectivity":{"currentState":"HIGH","nextState":"UNSTABLE","remainingTimeSeconds":4800},"bapInstalled":true}
const json = await request.loadJSON()
const { speed } = json
widget.addText(speed?.toLocaleString('de', {
style: 'unit',
unit: 'kilometer-per-hour'
}))
@phibo23
phibo23 / README.MD
Last active March 15, 2025 20:46
ODD2025 Nextbike

Analyzing Nextbike Data

The dataset consists of a huge directory of json files

My goal was to create timeseries for the amount of available and booked bikes in Karlsruhe.

DuckDB (https://duckdb.org/) was used to convert data from the list of JSON files to a single csv file. Running the following query on ~60GB of files on a USB flash drive took about 5 minutes on a 2021 MacBook pro (M1 Pro CPU, 32 GB RAM)