Skip to content

Instantly share code, notes, and snippets.

View joelotz's full-sized avatar

Joe Lotz joelotz

View GitHub Profile
@joelotz
joelotz / MyTaggingPresets.xml
Created August 22, 2022 23:11
My JOSM tag preset file
<?xml version="1.0" encoding="UTF-8"?>
<presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"
author="Joe Lotz"
version="0.1"
description="My personal preset file for the tags that I frequently use">
<group name="A-MyPresets">
<item name="Sidewalk" type="way">
<link wiki="Tag:footway%3Dsidewalk" />
<label text="Inserting a unidirectional sidewalk" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joelotz
joelotz / install_imagemagic_with_heic.sh
Last active July 3, 2022 13:13
How to install ImageMagick with HEIC and WEBP support on Ubuntu 20.04
# -- Credits --
# copied from https://gist.github.com/hurricup/e14ae5bc47705fca6b1680e7a1fb6580
# which in turn was inspired by https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd
# 1. Remove old bundled ImageMagick program
sudo apt remove imagemagick -y
# 1b. Update and install libraries for buidling from source
sudo apt update
sudo apt install build-essential
@joelotz
joelotz / convert_pelican_to_pandoc.py
Created February 1, 2021 16:25
This is a quick little script that converts pelican metadata syntax into pandoc metadata syntax. This is simply as you just need to fence it in with 3-dashes. This adds this to all files in current dir with .md extension.
"""This is a quick little script that converts pelican metadata syntax into
pandoc metadata syntax. This is simply as you just need to fence it in with 3-dashes.
This adds this to all files in current dir with .md extension
"""
from os import walk
def list_files(directory, extension):
for (dirpath, dirnames, filenames) in walk(directory):
return (f for f in filenames if f.endswith('.' + extension))
@joelotz
joelotz / cue2labels.py
Last active July 26, 2024 08:08
Convert a music .cue file into a label file. This module will accept an optional string attribute that specifies the input .cue file. If this file is not provided in the call then file-select box will be presented to the user. Output is a .txt file of labels that can be input into Audacity.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Convert a music .cue file into a label file.
This module will accept an optional string attribute that specifies the input
.cue file. If this file is not provided in the call then file-select box will
be presented to the user. Output is a .txt file of labels that can be input
into Audacity.
Examples:
div.admonition {
padding: 0;
margin-bottom: 20px;
background-color: #fcf8e3;
border: 1px solid;
border-bottom-left-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
}
div.admonition p {
@joelotz
joelotz / logweight
Last active June 11, 2020 16:06
A stupid shell script that inputs my weight a writes to a log file.
#!/bin/sh
# A shell script to log personal body weights into /mnt/DataDrive/Documents/WeightLog.txt file
# Written by: Joe Lotz
# Last updated: 2020/June/11
#
# logweight --help
# --------------------------------------------------------------
# Set vars
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joelotz
joelotz / SWS
Created October 21, 2014 18:30
{
"metadata": {
"name": "",
"signature": "sha256:f8edf9c1663e0e67e6fbbbfbfc78f83f1f702f53194b9792e22bda26e5b094e5"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import pandas as pd
data = pd.DataFrame.from_csv('askmefi_category_year.tsv', sep='\t')
categories = data.category.unique()
mydata = {}
for i in categories: