Skip to content

Instantly share code, notes, and snippets.

@jarek
jarek / osm overpass ipyleaflet.ipynb
Last active November 17, 2019 03:00
osm overpass ipyleaflet notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jarek
jarek / toronto creeks.geojson
Last active November 6, 2023 03:47
toronto lost creeks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jarek
jarek / toronto streetcar tracks.geojson
Last active November 6, 2023 04:05
toronto streetcar tracks from OSM - work in progress
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 7 columns, instead of 5. in line 9.
date_system,date_pe,wind_pe,oil_pe,exch_pe,date_nb,exch_nb
2018-05-02 19:18:59.669208+00:00,2018-05-02 19:01:01+00:00,51.54,0,110.93,2018-05-02 19:18:00+00:00,91.0
2018-05-02 19:22:03.604494+00:00,2018-05-02 19:01:01+00:00,51.54,0,110.93,2018-05-02 19:22:00+00:00,91.0
2018-05-02 19:23:03.580133+00:00,2018-05-02 19:01:01+00:00,51.54,0,110.93,2018-05-02 19:23:00+00:00,91.0
2018-05-02 19:24:03.671867+00:00,2018-05-02 19:01:01+00:00,51.54,0,110.93,2018-05-02 19:24:00+00:00,91.0
2018-05-02 19:25:04.025070+00:00,2018-05-02 19:11:01+00:00,58.99,0,103.14999999999998,2018-05-02 19:25:00+00:00,91.0
2018-05-02 19:26:03.688525+00:00,2018-05-02 19:11:01+00:00,58.99,0,103.14999999999998,2018-05-02 19:26:00+00:00,91.0
2018-05-02 19:27:03.936384+00:00,2018-05-02 19:11:01+00:00,58.99,0,103.14999999999998,2018-05-02 19:27:00+00:00,91.0
2018-05-02 19:28:03.745912+00:00,2018-05-02 19:11:01+00:00,58.99,0,103.14999999999998,2018-05-02 19:28:00+00:00,91.0
2018-05-02 19:29:03.835466+00:00,2018-05-02 19:11:01+00:00,58.99,0,103.149999
@jarek
jarek / 2018-03-24 analysis of HVDC_RTX_20180302-20180302.csv
Created March 24, 2018 21:36
Philippines - Visayas electricity on 2018-03-02
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 25 columns, instead of 10. in line 8.
DATE,HOUR,,ID,"RUN TYPE","HVDC RTX MW",scraped:,"Vis demand","generation total",,"MPS load ex-post sum","MPS gen ex-post sum",,,"Luzon demand","generation total",,,,,,,,,
2018/02/03,1,2018/03/02,HVDC,RTX,162.33,,1309.1,1053,256.0999999999999,1259.2,1440.1,,,7565,6866,699,,,,,,,,
2018/02/03,2,"2018/03/02 01:00:00",HVDC,RTX,198.96,,1244.2,979,265.20000000000005,,1417,,,7300,6634,666,,,,,,,,
2018/02/03,3,"2018/03/02 02:00:00",HVDC,RTX,219.89,,1193.7,1010,183.70000000000005,,1417.6,,,7251,6503,748,,,,,,,,
2018/02/03,4,"2018/03/02 03:00:00",HVDC,RTX,237.99,,1195.7,1012,183.70000000000005,,1419.9,,,7185,6438,747,,,,,,,,
2018/02/03,5,"2018/03/02 04:00:00",HVDC,RTX,201.86,,1226.8,1014,212.79999999999995,,1422.3,,,7221,6503,718,,,,,,,,
2018/02/03,6,"2018/03/02 05:00:00",HVDC,RTX,161.9,,1283.3,1062,221.29999999999995,,1427.5,,,7394,6674,720,,,,,,,,
2018/02/03,7,"2018/03/02 06:00:00",HVDC,RTX,247.21,,1206,1031,175,,1442.4,,,7073,6318,755,,,,,,,,
2018/02/03,8,"2018/03/02 07:00:00",HVDC,RTX,195.92,,1307.2,1124,183.2000000
@jarek
jarek / SV.py
Created August 21, 2017 18:45
SV parser beginnings
# -*- coding: utf-8 -*-
# for https://github.com/tmrowco/electricitymap/issues/678
from bs4 import BeautifulSoup
from pprint import pprint
import requests
import json
url = 'http://estadistico.ut.com.sv/OperacionDiaria.aspx'
@jarek
jarek / 2017-06-18 canada electricity.ipynb
Created June 18, 2017 18:42
Canadian electricity carbon intensity investigation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// inner data-parsing code from view-source:https://w3.sev.fo/framleidsla/36177_SEV_El-orka-i-foroyum.hyperesources/36177sevelorkaiforoyum_hype_generated_script.js?15852
// extracted and beautified
// there is another script for "LoadXMLMobil", it appears to do the same thing except for specifying different DOM IDs
// (e.g. "heyga_vandstand_1Mobil" instead of "heyga_vandstand_1")
// original code below
// ---
function(hypeDocument, element, event) {
@jarek
jarek / lastfm-export.py
Created October 10, 2016 19:54
last fm export script - author unknown, will update when known
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@jarek
jarek / analyze.py
Created August 25, 2016 15:25
parking and trip charting/plotting code 2016-08-25
#!/usr/bin/env python2
# coding=utf-8
from __future__ import print_function
import sys
import simplejson as json
import datetime
import numpy as np
import matplotlib.pyplot as plt