Skip to content

Instantly share code, notes, and snippets.

Avatar

Igor Davydenko playpauseandstop

View GitHub Profile
@playpauseandstop
playpauseandstop / README.rst
Last active Jul 14, 2020
Check latest GitHub actions releases.
View README.rst

check-latest-actions

Check latest GitHub actions releases.

Requirements

View Dockerfile.pip19
FROM playpauseandstop/docker-python:3.2.0-py38
RUN pip install pip==19.2.3
RUN pip install pyheif==0.4
CMD ["python"]
View pyproject.toml
[tool.black]
exclude = "^.*/migrations/.*$"
line_length = 79
target_version = ["py37"]
[tool.poetry]
name = "project"
version = "1.0.0"
description = "Project"
authors = ["Team <team@googlegroups.com>"]
@playpauseandstop
playpauseandstop / show-hook-dependencies.sh
Last active Oct 29, 2019
Show latest pre-commit hook dependencies.
View show-hook-dependencies.sh
#!/bin/bash
#
# Script to show list of dependencies for pre-commit hook.
#
# Requirements
# ============
#
# - [curl](https://curl.haxx.se/)
# - [jq](https://stedolan.github.io/jq/)
# - [npm](https://www.npmjs.com/)
@playpauseandstop
playpauseandstop / README.md
Created Jul 10, 2019
Script to update Python version for projects with pyenv & poetry
View README.md

update-python.sh

Script to update Python version for projects with pyenv & poetry

Pre-requisites

This script intended to be run for projects which,

  1. Has .pyenv-version file (Python version managed by pyenv)
  2. Can be installed with make install (or make install-api)
@playpauseandstop
playpauseandstop / env-pip-check
Last active Jul 9, 2016
Tiny wrapper around pip-check cmd, to run it inside venv Python first
View env-pip-check
#!/bin/bash
#
# Tiny shell script to run ``pip-check`` cmd inside of venv or fallback to
# global ``pip-check`` after.
#
# `pip-check <https://github.com/bartTC/pip-check/>`_ is a tool for checking
# outdated versions installed in your Python virtual environment or global
# site packages.
#
# Usage
@playpauseandstop
playpauseandstop / Makefile
Last active Jun 5, 2019
Setup aiohttp web app with Session Middleware to use Redis Storage and run under Gunicorn.
View Makefile
.PHONY: clean distclean install run
ENV ?= env
VENV = $(shell python -c "import sys; print(int(hasattr(sys, 'real_prefix')));")
ifeq ($(VENV),1)
GUNICORN = gunicorn
else
GUNICORN = $(ENV)/bin/gunicorn
endif
@playpauseandstop
playpauseandstop / pip-list-updates.sh
Last active Aug 29, 2015
Check out available updates for virtual environment or system libraries with pip
View pip-list-updates.sh
#!/bin/bash
#
# Check out available updates for virtual environment or system libraries with
# `pip <http://pip.pypa.org/>`_.
#
# Requirements
# ============
#
# * GNU/Linux, Mac OS X
# * `pip`_ 1.4 or higher
@playpauseandstop
playpauseandstop / arange.py
Last active Aug 29, 2015
Range function for Decimals and floats and any other objects which supports addition
View arange.py
import operator
def arange(start, stop=None, step=None):
"""
Implement range function not only for integers as Python's builtin
function, but for Decimals and floats as well.
Returns generator with arithmetic progession, not list.
@playpauseandstop
playpauseandstop / posterous-to-blogger.py
Created Apr 25, 2013
Import posts from Posterous backup to Blogger account.
View posterous-to-blogger.py
#!/usr/bin/env python
#
# Import posts from Posterous backup to Blogger account.
#
# Requirements
# ============
#
# * `Python <http://www.python.org/>` 2.6 or 2.7
# * `GData <http://pypi.python.org/pypi/gdata>`_ 2.0.17 or higher
#
You can’t perform that action at this time.