Skip to content

Instantly share code, notes, and snippets.

View danmash's full-sized avatar
🌎

Daniil Mashkin danmash

🌎
View GitHub Profile
@yuekui
yuekui / group_filter_set.py
Created March 2, 2022 21:54
GroupFilterSet to reduce inner joins for performance.
from django.db.models import Q
from django.db.models.constants import LOOKUP_SEP
from django_filters import rest_framework as django_filters
from django_filters.constants import EMPTY_VALUES
class GroupFilterSet(django_filters.FilterSet):
def filter_queryset(self, queryset):
"""
Group the fitlers by the first join table to
#!/usr/bin/env python3
"""
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't
@subfuzion
subfuzion / curl.md
Last active May 16, 2024 18:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: