It's much better simply implementing the callbacks on_success
/ on_failure
.
import dramatiq
@dramatiq.actor
def identity(x):
return x
# https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/#webhooks | |
# Securing Webhooks | |
# To ensure the authenticity of event requests, Mailgun signs them and posts the signature alongside the webhook's event-data. | |
# A signature takes the following form: | |
# Parameter Type Description | |
# timestamp int Number of seconds passed since January 1, 1970. | |
# token string Randomly generated string with length of 50. | |
# signature string String with hexadecimal digits generated by an HMAC algorithm |
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; |