Skip to content

Instantly share code, notes, and snippets.


Nick Janetakis nickjj

View GitHub Profile
View Makefile
.PHONY: help
@printf "%s\n" "Useful targets:"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m make %-15s\033[0m %s\n", $$1, $$2}'
.PHONY: db-reset
db-reset: ## Reset the database
docker-compose exec web flask db reset --with-testdb
.PHONY: routes
nickjj /
Created Feb 16, 2021
A zero dependency Python 3 CLI script to increment file names. This script is explained on video at:
# 1. Create the file inc-file-names anywhere on your dev box
touch inc-file-names
# 2. Make it executable
chmod +x inc-file-names
# 3. Copy the script below into the file you just created
# 4. Move it onto your system path
sudo mv inc-file-names /usr/local/bin
nickjj / cron-sendy-backup
Last active Apr 21, 2021
An example of creating a database backup and restore script for MySQL, MariaDB and PostgreSQL. It is focused on backing up and restoring a Sendy database (working example from but you can apply it for any database with slight modifications.
View cron-sendy-backup
30 0 * * * root /usr/local/bin/sendy-backup > /dev/null 2>&1
nickjj /
Last active Jul 16, 2020
List of DigitalOcean slugs for images, sizes and regions.
# Listed generated on 2020-07-16 at 11:45am EST
curl -s -X GET -H "Content-Type: application/json" \
-H "Authorization: Bearer ${DIGITALOCEAN_ACCESS_TOKEN}" \
"" \
| jq '.images[].slug' | sort
nickjj /
Last active May 19, 2020 — forked from geerlingguy/
Ansible Role Test Shim Script
# Ansible role test shim.
# Taken from this gist by Jeff Geerling on May 10th 2018:
# Usage: [OPTIONS] ./tests/
# - distro: a supported Docker distro version (default = "ubuntu1804")
# - playbook: a playbook in the tests directory (default = "test.yml")
View GitGutter.sublime-settings
// This would go in $sublime_dir/Packages/User/GitGutter.sublime-settings
"live_mode": false,
"focus_change_mode": false