Skip to content

Instantly share code, notes, and snippets.

Artur Barseghyan barseghyanartur

Block or report user

Report or block barseghyanartur

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@barseghyanartur
barseghyanartur / .travis.yml
Created Nov 22, 2019 — forked from shaypal5/.travis.yml
Comprehensive Python testing on Travis CI
View .travis.yml
language: python
# ===== Linux ======
dist: xenial
python:
- 2.7
- 3.5
- 3.6
- 3.7
matrix:
include:
View git_logs_between_2_commits.md
git log --oneline 7de7970..master

OR

git log --oneline 7de7970..4cb34a9

Above command will give all logs between commit A and commit B including commit A and commit B.

@barseghyanartur
barseghyanartur / .gitignore
Created Oct 24, 2019 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@barseghyanartur
barseghyanartur / random_data_generators.rst
Created Oct 1, 2019
Random bank number and address generators (for the Netherlands)
View random_data_generators.rst
View typing_mixins.md

As proposed by Guido van Rossum himself here:

from typing import *
T = TypeVar('T')

class Base:
    fit: Callable

class Foo(Base):
View string_enums_graphene.md

This works for me:

from enum import Enum
import graphene


class NoValue(Enum):

    def __repr__(self):
@barseghyanartur
barseghyanartur / django_union_snippet.rst
Last active Aug 22, 2019
Django: Select 3 most recent Post objects from 3 different users in a single database query
View django_union_snippet.rst

Task

Given:

  • There are a lot of Post objects.
  • There are 3 users.

What we want:

  • Select 3 most recent Post objects from 3 different users.
View find_python_2_7_code.rst
pip install black
black . --target-version=py36 --check --quiet
@barseghyanartur
barseghyanartur / index.rst
Created May 28, 2019
Body weight/height BMI calculation
View index.rst

BMI is weight divided by height in the power of two.

bmi = weight / height**2

Body Mass Index Scale

  • Underweight: less than 18.5
  • Normal weight: 18.5 - 25
View expose_local_port_to_the_world.md
You can’t perform that action at this time.