This is a collection of commands and resources that were useful for me with the initial setup of my MacBook.
xcode-select --install
alias g='git'
alias gc='git checkout'
alias gco='git commit'
alias gs='git status'
alias gp='git pull'
alias dc='docker-compose'
alias up='docker-compose up'
alias down='docker-compose down'
With htmx is possible to build dynamic Webapps without REST-APIs and JavaScript. Just simple Django views that returns html.
You can learn more about it in this interesting Django chat podcast episode with the htmx creator Carson Gross.
I really like the idea and I wanted since a while to try htmx working together with Django and finally, I managed to work on that. I created this repository with some implementations with Django of the code examples from the htmx docs page.
**Update: **also this website has some htmx magic on it. For example the post pagination or the search function are built with htmx.
This demonstrates how to use a variable as image for the Dockerfile FROM statement.
Given this docker-compose.yml / Dockerfile setup:
docker-compose.yml
version: '3'
services:
postgres:
build:
context: .
dockerfile: ./compose/postgres/Dockerfile
volumes:
- postgres_data:/var/lib/postgresql/data
env_file:
- .env
volumes:
postgres_data:
Dockerfile
FROM postgres:12.3
The Postgres service will always use the same FROM image defined in the Dockerfile. If we want instead to set the FROM image using a variable, we can do the following:
Docker-compose.yml
version: '3'
services:
postgres:
build:
context: .
dockerfile: ./compose/postgres/Dockerfile
args:
build_image: "${BUILD_IMAGE:-postgres:12.3}"
volumes:
- postgres_data:/var/lib/postgresql/data
env_file:
- .env
volumes:
postgres_data:
Dockerfile
# this will be the default image
ARG build_image="postgres:12.3"
# The default image will be overriden if other build image is passed as ARG
ARG build_image=$build_image
FROM $build_image
.env
BUILD_IMAGE=postgis:9.6