Skip to content

Instantly share code, notes, and snippets.

View loleg's full-sized avatar

Oleg Lavrovsky loleg

View GitHub Profile
@loleg
loleg / lindas-sparql-example.r
Created October 23, 2020 18:09
An example of how to connect to the LINDAS service with the R package for SPARQL
library(SPARQL)
endpoint <- "https://lindas.admin.ch/query"
rdf_query <- "
PREFIX : <http://voc.zazuko.com/zack#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX gont: <https://gont.ch/>
SELECT DISTINCT ?Haltestelle WHERE
{ GRAPH <https://linked.opendata.swiss/graph/FOT/didok> {
@loleg
loleg / corona-data.user.js
Created October 6, 2020 16:37
Light mode for Corona-Data.ch (Greasemonkey script)
// ==UserScript==
// @name Corona-Data.ch Light edition
// @description This adjusts the theme of the Swiss Covid-19 data visualization by Daniel Probst
// @version 0.0.1
// @grant GM.xmlhttpRequest
// @grant GM.addStyle
// @include https://www.corona-data.ch/*
// @include https://corona-data.ch/*
// ==/UserScript==
@loleg
loleg / models.py
Created August 17, 2020 14:19
Example Wagtail model with multiple contacts
from django.db import models
from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel
from wagtail.core.models import Orderable
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
GENDER_CHOICES = (
@loleg
loleg / evalhack.css
Last active July 8, 2020 17:04
Dribdat customization for EvalHack
@import url(https://fonts.googleapis.com/css2?family=Lato);
body, p, div, span, h1, h2, h3, h4, h5, h6 { font-family:Lato }
/* Show event graphic, hiding detail info on event page */
.jumbotron.event-info * { display:none }
.jumbotron.event-info { background:url(https://blog.datalets.ch/workshops/2020/ipdet/IPDET_Hackathon-C.jpg) no-repeat center; background-size: contain; height:240px; width: 100% }
/* Customize the top navigation */
.navbar.navbar-light { background: #f7e94a; }
@loleg
loleg / submissions-#versus-virus-timeseries.csv
Created April 8, 2020 06:30
Submissions length over time at VersusVirus
Datestamp Length
04/05/2020 02:34:37 8915
04/05/2020 03:42:26 3203
04/05/2020 04:31:17 1039
04/05/2020 05:41:55 2865
04/05/2020 06:17:17 2355
04/05/2020 06:17:36 318
04/05/2020 06:18:45 379
04/05/2020 06:19:13 1896
04/05/2020 06:20:26 2219
Liebe Nachbarinnen und Nachbarn
Gerne bieten wir Ihnen während der derzeitigen Coronavirus-Pandemie unsere Unterstützung an.
Wir sind nicht krank und gehören nicht zur Risikogruppe. Wir können Ihnen unter anderem folgende Hilfeleistungen anbieten:
- Einkauf (z.B. Migros, Coop, Apotheke)
- Autofahrten
- Post
- Unterstützung bei technischen Problemen (z.B. Internet)
Sie erreichen uns am Besten per Telefon unter den untenstehenden Telefonnummern. Da viele von uns ab sofort von zuhause aus arbeiten (Homeoffice), sind wir mehrheitlich auch tagsüber gut erreichbar.
@loleg
loleg / graph.md
Created March 21, 2020 16:14
Open data flow

graph TD
X[My Data] -->|API / DSGVO| B(hack.opendata.ch)
A[OGD] -->|API / FOI| B
Y[
@loleg
loleg / hslu 2020.3.md
Last active March 13, 2020 10:40
Presentation on how to run an open data hackday at Hochschule Luzern
title tags description
hslu 2020.3
presentations
View with "Slide Mode".
<style>.reveal section.present img { border:0px; background:transparent; box-shadow:none } body { background: #444 }</style>

Oleg Lavrovsky Data Activist

@loleg
loleg / seasonsgreets.js
Created December 6, 2019 11:17
December dweet
// replace this in the editor at https://www.dwitter.net/d/16799
// it's not < 140 bytes yet, improvement suggestions welcome --> twitter.com/loleg
for(i=0;i<99;i++)for(j=0;j<50;j++){x.fillStyle=`hsl(${S(i)*(i%2?10:1500)},89%,60%,.1`;x.fillRect(i*20,j*20,40*C(t+S(i*j+t/9)^2),9*S(t/11+C(t)*T(t*2+j/t)))}
x.fillStyle='white';K=99
for(i=K;i--;)x.fillRect(i*20,800+S(i/7+t*5)*55,20,500)
x.font='17em monospace'
x.fillStyle='green'; x.fillText('Seasons Greets',115,903)
x.fillStyle='red'; x.fillText('Seasons Greets',105,900)