This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will allow to autocomplete tests in Terminal like this: | |
$ pytest tests/test_user_management.py::[TAB] | |
$ pytest tests/test_user_management.py::TestUserManagement[TAB] | |
$ pytest tests/test_user_management.py::TestUserManagement::test_user_create | |
# Add command writing fully qualified names of all test functions to a file | |
# conftest.py: | |
def pytest_addoption(parser): | |
parser.addoption( | |
"--collect-tests", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from django.contrib.auth.models import User | |
from django.urls import reverse | |
from rest_framework.test import APIClient | |
@pytest.fixture(scope="class") | |
def user(django_db_setup, django_db_blocker): | |
with django_db_blocker.unblock(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import mutagen | |
import six | |
from mediafile import StorageStyle, MediaField, MediaFile | |
Popularimeter = collections.namedtuple('Popularimeter', ['rating', 'count']) | |
class PopmMediaField(MediaField): | |
def __init__(self, *styles, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL := /bin/bash | |
PWD = $(shell pwd) | |
UNAME := $(shell uname) | |
ARCH := $(shell uname -m) | |
USER := $(shell echo $$USER) | |
USERDIR := $(shell echo $$HOME) | |
# Synology ignores | |
ifeq ($(UNAME),Linux) | |
FOLDER := .SynologyDrive/SynologyDrive.app/conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.7 | |
# | |
# Move and resize window into screen corners. | |
# works with multiple, horizontally aligned displays. | |
# | |
# Requirements: | |
# * Python3.7 (for dataclass) | |
# * wmctrl | |
# * xdotool | |
# pip: screeninfo, click |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------- | |
have_const: checking for SSL_MODE_REQUIRED in mysql.h... -------------------- yes | |
"gcc -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/usr/include/mysql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.3-C6gbp8/ruby2.3-2.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c conftest.c" | |
checked program was: | |
/* begin */ | |
1: #include "ruby.h" | |
2: | |
3: #include <mysql.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mysql:latest | |
RUN apt-get update | |
RUN apt-get install -y rubygems ruby-mysql2 wget build-essential libmysqlclient-dev ruby2*-dev sqlite3 libsqlite3-dev | |
RUN gem install sequel mysql2 sqlite3 | |
RUN mkdir /temp | |
WORKDIR /temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Fetches latest MYSQL dump from radio-browser.info, converts it to SQLite. | |
# Usage: | |
# docker build -t radiobrowser-converter . | |
# docker run -v $PWD:/temp -it --rm radiobrowser-converter | |
# | |
FROM mysql:latest | |
RUN apt-get update | |
RUN apt-get install -y rubygems ruby-mysql2 wget build-essential libmysqlclient-dev ruby2*-dev sqlite3 libsqlite3-dev | |
RUN gem install sequel mysql2 sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
RUN apt-get update --fix-missing | |
RUN apt-get install -y git make g++ libsndfile1-dev libpng++-dev libpng12-dev libboost-program-options-dev | |
RUN apt-get install -y libxvidcore4 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-fluendo-mp3 gstreamer1.0-libav | |
RUN git clone https://github.com/beschulz/wav2png | |
WORKDIR /wav2png/build | |
RUN make all | |
RUN ln -s /wav2png/bin/Linux/wav2png /usr/bin/wav2png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gets or sets popularimeter ID3 rating tag for Traktor. | |
# Needs mutagen for ID3 tag manipulation: | |
# pip install mutagen | |
import logging | |
import os | |
import sys | |
import click | |
import mutagen | |
import mutagen.id3 |