Skip to content

Instantly share code, notes, and snippets.

View encetamasb's full-sized avatar

Bence Tamas encetamasb

  • Budapest, Hungary
View GitHub Profile
@encetamasb
encetamasb / mypy_dj_plugin.py
Last active October 15, 2025 10:38
django-stubs, mypy_django_plugin, vim, ALE, report "Error constructing plugin instance of MyDjangoPlugin" on first row
import sys
from mypy_django_plugin.main import NewSemanalDjangoPlugin
"""
in mypy.ini:
plugins = ./mypy_dj_plugin.py
"""
FROM thespaghettidetective/web:base-1.1
ARG TSD_UID=0
ARG TSD_GID=0
ARG TSD_USER=root
ARG TSD_GROUP=root
ARG WITH_NODE=0
ARG WITH_SQLITE=0
RUN if [[ "${WITH_NODE}" == 1 ]]; then \
@encetamasb
encetamasb / hooks.lua
Created September 9, 2019 10:46
haproxy lua action. total response size
function res_hook(txn)
local total = 0
local in_len
-- a bit costly way to check whether
-- we are finished or not,
-- dup() returns nil when its done
while txn.res:dup() ~= nil do
in_len = txn.res:get_in_len()