| Function | Shortcut |
|---|---|
| New Tab | ⌘ + T |
| Close Tab or Window | ⌘ + W (same as many mac apps) |
| Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
| Go to Split Pane by Direction | ⌘ + Option + Arrow Key |
| Cycle iTerm Windows | ⌘ + backtick (true of all mac apps and works with desktops/mission control) |
This file contains hidden or 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
| # init, add and commit | |
| git init | |
| git add . | |
| git commit -m "initial commit" | |
| # add remote repo | |
| git remote add origin https://*.git | |
| # fix it | |
| git push origin master |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| """Example Google style docstrings. | |
| This module demonstrates documentation as specified by the `Google Python | |
| Style Guide`_. Docstrings may extend over multiple lines. Sections are created | |
| with a section header and a colon followed by a block of indented text. | |
| Example: | |
| Examples can be given using either the ``Example`` or ``Examples`` | |
| sections. Sections support any reStructuredText formatting, including |
This file contains hidden or 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 sqlalchemy import ( | |
| create_engine, Column, Integer, BigInteger, Text, Boolean, Identity, ) | |
| from sqlalchemy.ext.declarative import ( | |
| declarative_base, ) | |
| from sqlalchemy.orm import ( | |
| sessionmaker, scoped_session, ) | |
| # Импортируем инициализированные переменные среды | |
| from app.config import ( | |
| URL, DB_USER, DB_PASS, DB_NAME, DB_HOST, DB_PORT, ) |
This file contains hidden or 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 sqlalchemy import MetaData | |
| ''' | |
| SQLAlchemy рекомендует использовать единый формат для генерации названий для | |
| индексов и внешних ключей. | |
| source: https://docs.sqlalchemy.org/en/13/core/constraints.html#configuring-constraint-naming-conventions | |
| ''' | |
| convention = { | |
| 'all_column_names': lambda constraint, table: '_'.join([ | |
| column.name for column in constraint.columns.values() |
This file contains hidden or 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
| -- add | |
| git submodule add https://github.com/user/repo.git | |
| or in the folder/ folder | |
| git submodule add https://github.com/user/repo.git folder/ | |
| -- sync all submodules | |
| git submodule sync |
This file contains hidden or 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
| -- docs: https://git-secret.io/ | |
| -- Before start | |
| git --version | |
| gpg --version | |
| brew install git-secret | |
| have created a gpg RSA key-pair | |
| -- Hide files | |
| git secret init # `git secret` will add needed files in .gitignore |
This file contains hidden or 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
| -- Remove the history from | |
| rm -rf .git | |
| -- recreate the repos from the current content only | |
| git init | |
| git add -A | |
| git commit -am "Initial commit" | |
| -- push to the github remote repos ensuring you overwrite history | |
| git remote add origin https://github.com/<YOUR ACCOUNT>/<YOUR REPOS>.git |