Skip to content

Instantly share code, notes, and snippets.

View Gr1N's full-sized avatar
🚴‍♂️

Nikita Grishko Gr1N

🚴‍♂️
View GitHub Profile
@Gr1N
Gr1N / Airplay on RaspberryPi
Last active August 29, 2015 14:01
Airplay on RaspberryPi
# Change default audio port and test alsa
% amixer cset numid=3 1
% speaker-test -t sine
# Install dependencies
% apt-get install libao-dev libssl-dev avahi-utils libwww-perl libcrypt-openssl-rsa-perl libio-socket-inet6-perl libmodule-build-perl
# Install Perl Net-SDP (more information: https://github.com/njh/perl-net-sdp)
% git clone https://github.com/njh/perl-net-sdp.git
% cd ./perl-net-sdp/
@Gr1N
Gr1N / Mount TimeCapsule on RaspberryPi
Created May 13, 2014 13:41
Mount TimeCapsule on RaspberryPi
# Install dependencies
% apt-get install cifs-utils
# Create mount point folder
% mkdir /mnt/capsule
# Create credentials file
% touch /root/.cifs/capsule
% cat /root/.cifs/capsule
username=username
@Gr1N
Gr1N / gist:3515209795b91ff862a4
Last active July 18, 2017 14:09
Setting up Sublime Text for development

Preferences

Sublime Text > Preferences > Settings – User

{
    "always_show_minimap_viewport": true,
    "auto_complete_triggers":
    [
        {

"characters": ".",

@Gr1N
Gr1N / complexitypython.txt
Created January 30, 2016 11:03
Complexity of Python Operations
Complexity of Python Operations
In this lecture we will learn the complexity classes of various operations on
Python data types. Then we wil learn how to combine these complexity classes to
compute the complexity class of all the code in a function, and therefore the
complexity class of the function. This is called "static" analysis, because we
do not need to run any code to perform it.
------------------------------------------------------------------------------
import enum
import uuid
import arrow
import msgpack
@enum.unique
class Code(enum.IntEnum):
DATETIME_ISO8601 = 0
@Gr1N
Gr1N / .gitlab-ci.yml
Created July 12, 2017 19:23
.gitlab-ci.yml example
image: themattrix/tox-base:latest
stages:
- test
py36-isort:
stage: test
script:
- tox -e py36-isort
tags:
@Gr1N
Gr1N / bitbucket-pipelines.yml
Last active March 26, 2021 08:59
Why Drone CI can be interesting for you? Example of Bitbucket Pipelines configuration
definitions:
caches:
poetry-path: /root/.poetry
poetry-venv: /root/.cache/pypoetry/virtualenvs
pipelines:
default:
- step:
name: deps-3.7
image: python:3.7
@Gr1N
Gr1N / bitbucket-pipelines.yml
Created December 8, 2019 13:42
Why Drone CI can be interesting for you? Example of Bitbucket Pipelines configuration using YAML anchors and aliases
definitions:
caches:
poetry-path: /root/.poetry
poetry-venv: /root/.cache/pypoetry/virtualenvs
steps:
- step: &step-37
image: python:3.7
caches:
- poetry-path
@Gr1N
Gr1N / .drone.jsonnet
Created December 8, 2019 13:46
Why Drone CI can be interesting for you? Example of Drone CI configuration using Jsonnet
local
volume_cached_poetry_path = 'cached-poetry',
volume_cached_poetry_deps = 'cached-deps',
command_install = 'poetry install -vv',
command_test = 'poetry run pytest .',
step(name, commands, version='3.8') = {
name: '%s-%s' % [name, version],
image: 'python:%s' % version,
@Gr1N
Gr1N / gh-actions-matrix-builds.yml
Created January 12, 2020 12:11
10 things I love about GitHub Actions (matrix-builds)
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- runs: pip install -U -r requirements.txt