It's much better simply implementing the callbacks on_success / on_failure.
import dramatiq
@dramatiq.actor
def identity(x):
return x| Lets say you have a form, with multiple submit buttons: | |
| <form method="POST"> | |
| <button type="submit" name="save"> | |
| save | |
| </button> | |
| <button type="submit" name="send-all"> | |
| send all | |
| </button> | |
| </form> |
| import urllib | |
| # 'a=%3F' | |
| urllib.urlencode({'a': 'Á'}, 'utf-8') |
It's much better simply implementing the callbacks on_success / on_failure.
import dramatiq
@dramatiq.actor
def identity(x):
return x| #!/bin/sh | |
| set -o errexit | |
| set -o pipefail | |
| # exec command: [..] from docker-compose.yml / stack.yml | |
| exec "$@" | |
| # Wait for any process to exit | |
| wait -n |
| # Simple server: debian, simple firewall, ssh access using existing ssh key pre registered in hetzner panel | |
| # https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/server | |
| # https://docs.hetzner.cloud/#networks | |
| # https://www.hetzner.com/cloud/ | |
| # Configure the Hetzner Cloud Provider | |
| provider "hcloud" { | |
| token = var.hcloud_token | |
| } |
| Virtual box cant enumerate | |
| Virtual box no usb devices detected | |
| sudo usermod -aG vboxusers $USER |
| FROM python:3.11-alpine3.17 | |
| ENV PATH=$PATH:$HOMEAPP/.local/bin | |
| ENV PYTHONPATH=$HOMEAPP:$PROJECT_NAME | |
| # Python packages build dependencies | |
| RUN apk add --no-cache --virtual .build-dependencies \ | |
| # Essentials | |
| gcc musl-dev openssl-dev openssl \ | |
| # Pillow / PIL build dependencies |
| # Let's say you want to access the Collection instance for a Image in a Django Admin Inline | |
| from django.contrib import admin | |
| from app.models import Image, Collection | |
| class ImageInline(admin.StackedInline): | |
| model = models.Image | |
| extra = 1 |
| /* https://getbootstrap.com/docs/5.0/components/toasts/ */ | |
| .toast-container { | |
| position: fixed; | |
| right: 20px; | |
| top: 20px; | |
| } | |
| .toast:not(.showing):not(.show) { | |
| display: none !important; |
| jQuery(document).ready(function ($) { | |
| $input = $('#my-form') | |
| .tagify() | |
| .on('change', function (e, tagData) { | |
| if (tagData === undefined) { | |
| return; | |
| } | |
| // string [{"value":"test"}', '{"value":"test2"}] to JSON Object | |
| var tags = JSON.parse(tagData); | |
| // Converts into a simple array ["test", "test2"], then convert to string "test,test2" |