Skip to content

Instantly share code, notes, and snippets.

Avatar
😕
Why does GitHub need statuses?

Alice wheresalice

😕
Why does GitHub need statuses?
View GitHub Profile
View docker-compose.yml
version: '2'
services:
zookeeper:
image: "confluentinc/cp-zookeeper:5.4.0"
hostname: zookeeper
ports:
- '32181:32181'
environment:
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
@wheresalice
wheresalice / ezclone.sh
Last active Jun 12, 2020
A shell function for cloning a git repository into a sensible place. `ezclone <repo url>` or `ezclone golang <repo url>`
View ezclone.sh
function ezclone() {
# assumes cloning from a git@ url...
# clone to git_src by default
repo_base=~/git_src
if [[ "$1" == "golang" ]]; then
repo_base=~/go/src
shift
fi
@wheresalice
wheresalice / spec.json
Created Jun 8, 2020
NHS England Covid Deaths
View spec.json
{
"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}},
"data": {"name": "data-9f7cabe0332f8f1e8f65ae37f185d2a2"},
"mark": "bar",
"encoding": {
"color": {"type": "nominal", "field": "Condition"},
"column": {"type": "nominal", "field": "Condition"},
"tooltip": {"type": "quantitative", "field": "sum"},
"x": {"type": "nominal", "field": "Age group"},
"y": {"type": "quantitative", "field": "sum"}
@wheresalice
wheresalice / spec.json
Created Jun 4, 2020
Vega-Lite spec from Thu Jun 04 2020
View spec.json
{
"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}},
"data": {"name": "data-5c0a45d3b39e712b784c4dcdb003ced6"},
"mark": "bar",
"encoding": {
"color": {"type": "nominal", "field": "Disability"},
"x": {"type": "nominal", "field": "Police Force"},
"y": {"type": "quantitative", "field": "count"}
},
"title": "CED Usage by Force",
@wheresalice
wheresalice / index.html
Created May 7, 2020
Code review needed - I think this will list instances of the NHS Covid-19 tracker that are in range
View index.html
<html>
<head></head>
<body>
<button onclick="navigator.bluetooth.requestDevice({filters: [{services: ['c1f5983c-fa94-4ac8-8e2e-bb86d6de9b21']}]});">Click me to scan for NHS Covid-19 tracker apps nearby</button>
</body>
</html>
View state_to_geojson.py
def states_to_geojson(states):
geojson = {}
geojson['type'] = 'FeatureCollection'
geojson['features'] = []
for state in states.states:
point = {}
point['type'] = 'Feature'
point['properties'] = {'icao': state.icao24, 'callsign': state.callsign, 'origin_country': state.origin_country,
'on_ground': state.on_ground, 'velocity': state.velocity, 'spi': state.spi}
point['geometry'] = {'type': 'Point', 'coordinates': [state.longitude, state.latitude]}
@wheresalice
wheresalice / Makefile
Last active Sep 30, 2019
Produce a CSV with Tiploc code, Longitude, and Latitude using Naptan data
View Makefile
.DEFAULT_GOAL := tiploc_locations.csv
naptan.zip:
wget -O naptan.zip naptan.app.dft.gov.uk/DataRequest/Naptan.ashx?format=csv
Stops.csv: naptan.zip
unzip -o naptan.zip
tiploc_locations.csv: Stops.csv
python run.py
@wheresalice
wheresalice / docker-compose.yml
Last active Oct 7, 2019
docker-compose file for running Confluent Platform locally
View docker-compose.yml
version: '2'
services:
zookeeper:
image: "confluentinc/cp-zookeeper:5.3.0"
hostname: zookeeper
ports:
- '32181:32181'
environment:
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
View settings.xml
<settings>
<profiles>
<profile>
<id>myprofile</id>
<repositories>
<repository>
<id>confluent</id>
<url>https://packages.confluent.io/maven/</url>
</repository>
</repositories>
@wheresalice
wheresalice / openapi.yaml
Created Jun 10, 2019
OpenAPI spec for Confluent Schema Registry
View openapi.yaml
openapi: 3.0.1
info:
title: Schema Registry
version: 5.2.1
description: Schema Registry provides a serving layer for your metadata. It provides a RESTful interface for storing and retrieving Avro schemas. It stores a versioned history of all schemas, provides multiple compatibility settings and allows evolution of schemas according to the configured compatibility settings and expanded Avro support. It provides serializers that plug into Apache Kafka® clients that handle schema storage and retrieval for Kafka messages that are sent in the Avro format.
externalDocs:
url: >-
https://docs.confluent.io/current/schema-registry/develop/api.html#schemaregistry-api
description: Confluent's API reference
paths: