Skip to content

Instantly share code, notes, and snippets.

Avatar

Alice wheresalice

  • 08:09 (UTC +01:00)
View GitHub Profile
@wheresalice
wheresalice / imgur-to-rimgo.user.js
Last active February 10, 2023 19:43
Redirect Imgur links to rimgo to avoid endless hate scrolling. Working version as of January 2023
View imgur-to-rimgo.user.js
/*
DESCRIPTION: This is a file that after installing a greasemonkey
extension can be used to convert imgur to any rimgo instance.
NOTE: I might change this really often because instances may fail.
----
Copyright (C) 2021 Zortazert and other contributors
This program is free software: you can redistribute it and/or modify
View script.sh
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
@wheresalice
wheresalice / settings.yml
Created March 13, 2022 10:56
Searxh settings
View settings.yml
general:
debug : False # Debug mode, only for development
instance_name : "searx" # displayed name
contact_url: False # mailto:contact@example.com
enable_stats: False # activate /stats page - note: it may leak usage data
brand:
git_url: https://github.com/searx/searx
git_branch: master
issue_url: https://github.com/searx/searx/issues
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 June 12, 2020 18:23
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 June 8, 2020 18:20
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 June 4, 2020 16:20
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 19:55
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 September 30, 2019 04:37
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