Skip to content

Instantly share code, notes, and snippets.

@rybkinn
rybkinn / .gitignore
Last active January 31, 2023 16:06
gitignore example
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@rybkinn
rybkinn / urls.py
Created April 3, 2021 10:47
Fix django debug toolbar display for windows
if settings.DEBUG:
import debug_toolbar
import mimetypes
mimetypes.add_type("application/javascript", ".js", True)
urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@rybkinn
rybkinn / init.vim
Last active October 17, 2022 11:06
my neovim config
" <space>rn - mass funciton rename
set mouse=a " enable mouse
set encoding=utf-8
set number
set noswapfile
set scrolloff=7
set tabstop=4
set softtabstop=4
set shiftwidth=4
@rybkinn
rybkinn / pipenv_pip_error.txt
Last active May 6, 2022 16:49
Pipenv (use pip) error.
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
@rybkinn
rybkinn / pyenv_bash_error.txt
Created May 6, 2022 16:00
Pyenv 'bash\r' error
(/usr/bin/env: ‘bash\r’: No such file or directory)
$ pyenv --vrsion
/usr/bin/env: ‘bash\r’: No such file or directory
$ cd ~/.pyenv && find . -type f | xargs sed -i $'s/\r$//' && cd -
$ pyenv --version
pyenv 1.2.21e
@rybkinn
rybkinn / win_docker_volumes_path.txt
Last active May 13, 2022 14:59
Windows WSL2 path for Docker volumes
# Paste to Windows file explorer
\\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes
@rybkinn
rybkinn / rename_model_field.md
Created July 11, 2022 16:53
Переименовать поле модели Django
  1. Изменить имя поля в модели (но запомнить старое имя для 3 шага!)
  2. Создать пустую миграцию
$ python manage.py makemigrations --empty myApp
  1. Отредактировать новый файл пустой миграции он находится в папке миграции в папке вашего приложения и будет последней миграцией) добавив:
operations = [
        migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'),
 ]
@rybkinn
rybkinn / rename_model.md
Created July 11, 2022 16:56
Переименование модели Django

Шаг 1: отредактируйте соответствующие имена полей в models.py

class Bar(models.Model):
    name = models.CharField(unique=True, max_length=32)
    description = models.TextField(null=True, blank=True)


class AnotherModel(models.Model):
    bar = models.ForeignKey(Bar)  # <-- changed field name
    is_awesome = models.BooleanField()
@rybkinn
rybkinn / 1-Discord Rich Presence for Neovim(WSL2).md
Last active August 25, 2022 15:44
instructions for install discord rich presence for neovim(WSL2)