Skip to content

Instantly share code, notes, and snippets.

View avioli's full-sized avatar

Evo Stamatov avioli

View GitHub Profile
@avioli
avioli / loadgtfs.cql
Created July 3, 2017 03:26 — forked from rvanbruggen/loadgtfs.cql
Loading and Querying GTFS data
//LOAD CSV script for GFTS data
create constraint on (a:Agency) assert a.id is unique;
create constraint on (r:Route) assert r.id is unique;
create constraint on (t:Trip) assert t.id is unique;
create index on :Trip(service_id);
create constraint on (s:Stop) assert s.id is unique;
create index on :Stoptime(stop_sequence);
create index on :Stop(name);
schema await
WordPress 2.9+
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,3c;"
"_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;"
"esc_html_e;esc_html_x:1,2c\n"
__
_e
_ex:1,2c
_n:1,2
// From: https://hacks.mozilla.org/2017/03/internationalize-your-keyboard-controls/
window.addEventListener('keydown', function(e) {
if (e.defaultPrevented) {
return;
}
// We don't want to mess with the browser's shortcuts
if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) {
return;
#!/usr/bin/env bash
test -n "$2" && EXT=$2 || EXT=${1##*.}
INTEGRITY=$(curl -sL "$1" | openssl dgst -sha384 -binary | openssl enc -base64 -A)
if [ "$EXT" = "css" ]; then
echo '<link rel="stylesheet" href="'$1'" integrity="sha384-'$INTEGRITY'" crossorigin="anonymous">'
else
echo '<script src="'$1'" integrity="sha384-'$INTEGRITY'" crossorigin="anonymous"></script>'
brew install libexif
# note: vips fails make install without libexif for some reason.
brew install homebrew/science/vips \
--with-python3 \
--with-webp \
--without-fftw \
--without-gobject-introspection \
--without-libgsf \
--without-little-cms2 \
--without-orc \
@avioli
avioli / README.md
Last active October 25, 2016 23:26
Harvest Redirect - Overview to Timesheets

Harvest Redirect - Overview to Timesheets

A Google Chrome extension

How to install

  1. Open Google Chrome and navigate to chrome://extensions.
  2. Enable Developer mode
  3. Select Load unpacked extension...

[based on a true story]

So. Your friend's about to teach you how to make a website. Great!

You make a file, and you save it as 'index.html'. Why it's called 'index' isn't really explained to you, but whatever.

You type the following.

hello world
@avioli
avioli / anz.rates.sh
Created September 29, 2016 22:54
A basic fetcher for ANZ bank loan rates
#!/usr/bin/env bash
## NOTE(evo): `brew install jq`
if test -z "$JQ_BIN"; then
hash jq 2>/dev/null || { echo "jq is required: brew install jq"; exit 1; }
fi
test -z "$JQ_BIN" && JQ_BIN=jq
@avioli
avioli / srt.awk
Created September 29, 2016 22:17
A SubRip subtitle fixer
# SRT fixer
# Version: 1.0
# Author: Evo Stamatov <aviolito@gmail.com>
# USAGE:
########
# To re-number the lines and do whitespace trimming:
# cat <filename>.srt | awk -f path/to/srt.awk

Preparing a PBF file for Open Trip Planner

Osmosis

You can refer to Osmosis' installation guide.

TMPDIR=/tmp
BINDIR=/usr/local/bin
OPTDIR=/opt