Skip to content

Instantly share code, notes, and snippets.

View moskrc's full-sized avatar

Vitalii moskrc

  • Spain
View GitHub Profile
@moskrc
moskrc / celery.sh
Created August 1, 2023 14:14 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@moskrc
moskrc / build-tensorflow.sh
Created December 1, 2021 19:27 — forked from muendelezaji/build-tensorflow.sh
Script to build TensorFlow from source. Platform is ARM64 (aka aarch64) with OpenCL support via Codeplay SYCL SDK
#!/bin/bash
# =============================================================
# UPDATE SOURCE
# =============================================================
# git clone https://github.com/tensorflow/tensorflow
# git checkout -- .
# git pull origin master
# TF_BRANCH=r1.8
TF_ROOT=/home/tensorflow
@moskrc
moskrc / validators.py
Last active August 31, 2018 11:54 — forked from dokterbob/validators.py
Validator for files, checking the size, extension and mimetype. Modified to work with Django 2.0.6 and Python 3.6.4
from os.path import splitext
import mimetypes
from django.core.exceptions import ValidationError
from django.template.defaultfilters import filesizeformat
from django.utils.translation import ugettext_lazy as _
from django.utils.deconstruct import deconstructible
@deconstructible
@moskrc
moskrc / next_previous.py
Created June 26, 2012 10:50 — forked from dokterbob/next_previous.py
Django template tag to efficiently get the next or previous object in the Django queryset, with regards to the item specified.
from django import template
register = template.Library()
from templatetag_sugar.register import tag
from templatetag_sugar.parser import Constant, Variable, Name
from .utils import get_next_or_previous
"""
Efficient and generic get next/previous tags for the Django template language,