This Gist: http://is.gd/dokkudjango
DigitalOcean: https://www.digitalocean.com/
Dokku: https://github.com/progrium/dokku
Dokku-Postgres: https://github.com/Kloadut/dokku-pg-plugin
| // countryNames.ts | |
| import countryNames from './country-names.json'; | |
| export function getCommonCountryName(inputName: string): string | undefined { | |
| const normalizedInput = inputName.replace(/\s*\(the\)\s*/i, '').trim(); | |
| return countryNames[normalizedInput] || undefined; | |
| } | |
| // countryNames.test.ts |
| import json | |
| import urllib.request | |
| import re | |
| def main(): | |
| url = 'https://raw.githubusercontent.com/mledoze/countries/refs/heads/master/countries.json' | |
| response = urllib.request.urlopen(url) | |
| data = json.loads(response.read().decode()) | |
| mapping = {} |
| Commodity code,Suffix,HS Level,Indent,Description,SID,Parent SID | |
| 01,,,,Animals; live,01,TOTAL | |
| 0101,,,,"Horses, asses, mules and hinnies; live",0101,01 | |
| 010121,80,,,"Horses; live, pure-bred breeding animals",010121,0101 | |
| 010129,80,,,"Horses; live, other than pure-bred breeding animals",010129,0101 | |
| 010130,80,,,Asses; live,010130,0101 | |
| 010190,80,,,Mules and hinnies; live,010190,0101 | |
| 0102,,,,Bovine animals; live,0102,01 | |
| 010221,80,,,"Cattle; live, pure-bred breeding animals",010221,0102 | |
| 010229,80,,,"Cattle; live, other than pure-bred breeding animals",010229,0102 |
| #!/bin/sh | |
| # Cleanup docker files: untagged containers and images. | |
| # | |
| # Use `docker-cleanup -n` for a dry run to see what would be deleted. | |
| untagged_containers() { | |
| # Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1. | |
| # NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6). | |
| # Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470 | |
| docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}' |
This Gist: http://is.gd/dokkudjango
DigitalOcean: https://www.digitalocean.com/
Dokku: https://github.com/progrium/dokku
Dokku-Postgres: https://github.com/Kloadut/dokku-pg-plugin
| sudo apt-get update | |
| sudo apt-get install python-software-properties | |
| sudo add-apt-repository ppa:pitti/postgresql | |
| sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
| sudo apt-get update |