Inspiration: Deis Commit Style Guide
I often quote Deis in sections below.
It makes going back and reading commits easier. It also allows you to spend less time thinking about what your commit message should be.
Inspiration: Deis Commit Style Guide
I often quote Deis in sections below.
It makes going back and reading commits easier. It also allows you to spend less time thinking about what your commit message should be.
| from django.contrib.auth.mixins import LoginRequiredMixin | |
| class SetUserMixin(LoginRequiredMixin): | |
| """ | |
| Automatically add `self.request.user` to a specified `user_field`. `use_field` defaults to "user" | |
| """ | |
| user_field = "user" |
| class BlogForm(GetRequestFromFormMixin, forms.ModelForm): | |
| class Meta: | |
| model = Blog | |
| fields = ("name, description",) | |
| def clean(self): | |
| print(self.request) # we can now access the request! | |
| return super().clean() |
This contains a collection of common errors people make when coding Django apps, and how to fix them.
| # | |
| # ddcutil https://www.ddcutil.com/ | |
| # | |
| # If you don't like commands there's a GUI available too: https://www.ddcutil.com/#ddcui | |
| # 1 Getting our monitors | |
| ddcutil detect | |
| # This will return the monitors detected by ddcutil, we need this first in case we only want to change a single monitor |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service