title | tags | description | slideOptions | ||
---|---|---|---|---|---|
Oleg @ OpenDataBeer 12 |
dribdat |
View the slide with "Slide Mode". |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adapted from https://github.com/idris-maps/swiss-projection | |
// https://gist.github.com/loleg/06ad3db0cbbfadb200be7fc0b1451c35/revisions | |
// https://www.swisstopo.admin.ch/content/swisstopo-internet/en/online/calculation-services/_jcr_content/contentPar/tabs/items/documents_publicatio/tabPar/downloadlist/downloadItems/19_1467104393233.download/ch1903wgs84_e.pdf | |
// Convert the projection coordinates E (easting) and N (northing) in LV95 into the civilian system (Bern = 0 / 0) and express in the unit [1000 km] | |
var getY2FromE = function (E) { return (E - 2600000) / 1000000; }; | |
var getX2FromN = function (N) { return (N - 1200000) / 1000000; }; | |
// Convert the projection coordinates y and x in LV03 into the civilian system (Bern = 0 / 0) and express in the unit [1000 km] | |
var getY2FromY = function (y) { return (y - 600000) / 1000000; }; | |
var getX2FromX = function (x) { return (x - 200000) / 1000000; }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Select a table containing a "Sort Order" number column | |
const TABLE_NAME = "<Your Table Name Here>" | |
// A time limit comfortably within the allowable script runtime | |
const MAX_TIME = 25; | |
// Maximize shuffle within the time limit | |
const startTime = new Date(); | |
function timeElapsed() { | |
const endTime = new Date().getTime(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Geocoding utility script by @loleg | |
* Latest version: https://gist.github.com/loleg/2e38752732e29472993dd74da988d7e6 | |
* | |
* - fills location coordinates based on an "Address" field | |
* - uses the open data API service of swisstopo (Switzerland only) | |
* - currently auto-throttled by Airtable, with fetch limits | |
* - retries continuously to let you fix addresses in your table | |
* - add this to a "create record" automation and also limit by time | |
* | |
* Required fields: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @name DDA graphics algorithm | |
* @description A simple implementation of line rasterization using the Digital differential analyzer. | |
* Press the mouse button on any two points to draw a line. A color will be picked at random. | |
* See https://en.wikipedia.org/wiki/Digital_differential_analyzer_(graphics_algorithm) | |
*/ | |
let i = x1 = y1 = x2 = y2 = dx = dy = step = 0; | |
let pickStart = pickEnd = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv, io | |
# Configuration | |
input_addresses = "Gebaeudeadressen_1636760957021_53445 - Gebäudeadressen.csv" | |
egidcol_addresses = "Eidg. Gebäude-ID (EGID)" | |
input_opendata = "V20211111.csv" | |
egidcol_opendata = "egid" | |
output_filename = "combined.csv" | |
# Preload address file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. Go to any emoji list page on Emojipedia, e.g. | |
https://emojipedia.org/google/ | |
2. Scroll down until every icon has loaded | |
3. Run this script in your console | |
4. Print! | |
*/ | |
$('li a img').each(function() { nm = $(this).attr('title'); $(this).parent().append('<ttl>' + nm + '</ttl>') }); | |
$('header,.ad-header,.ad-footer,section,.vsfilter,.sidebar,footer').hide(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
""" | |
Ye olde Secret Santa script based on https://gist.github.com/will-bainbridge/a4666a196fb5833cf37035647b74c064 | |
You will need to prepare a "people file", which is in CSV format (UTF-8, comma delimited) and has the following columns (without a header row) | |
Name, E-mail, Extra content 1, Extra content 2 | |
We used the postal address as extra content 1 and a link to Google Street View as extra content 2. Then you can specify a plain text message file which includes %s for the buyer name, recipient name, recipient extra 1, and recipient extra 2 (in that order!). For example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just getting my hands dirty with Arduino! Please don't be upset ... | |
/* Sources: | |
* | |
* https://github.com/gand417/mz2020_audio/blob/main/mz2020_audio.ino | |
* https://github.com/make-zurich/makezurich-hardware-intro/blob/master/Arduino/Neno33BleSense_CoronaAppScanner/Neno33BleSense_CoronaAppScanner.ino | |
*/ | |
#include <Adafruit_NeoPixel.h> | |
#include <ArduinoBLE.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> { |