Skip to content

Instantly share code, notes, and snippets.

View IsFilimonov's full-sized avatar
🌪️
Any chaos is orderly, even though it's intricate

Ilia Filimonov IsFilimonov

🌪️
Any chaos is orderly, even though it's intricate
View GitHub Profile
@IsFilimonov
IsFilimonov / git-init-directory.sh
Last active October 3, 2023 14:59
git-init-directory
# 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
@IsFilimonov
IsFilimonov / docstrings.py
Created January 16, 2023 07:54 — forked from redlotus/docstrings.py
Google Style Python Docstrings
# -*- 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
@IsFilimonov
IsFilimonov / kcyDYku.gif
Last active October 27, 2022 09:36
Meow world!
kcyDYku.gif
@IsFilimonov
IsFilimonov / iterm2.md
Created November 9, 2021 12:44 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

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)
@IsFilimonov
IsFilimonov / cli_hints.md
Last active November 9, 2021 12:31
Any hints for command line interface

Clear full line

iTerm 2 -> Preferences -> Profiles -> Keys -> Key mappings -> + -> Natural text editing.

Shortcut: cmd + Backspace
Action: Send hex code
Value: 0x15

@IsFilimonov
IsFilimonov / models.py
Created September 20, 2021 14:35
Быстрое использование SQLAlchemy
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, )
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()
-- 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
@IsFilimonov
IsFilimonov / git-secret-workflow
Created September 29, 2020 15:42
A git-secret workflow
-- 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
@IsFilimonov
IsFilimonov / git-clear-history
Last active November 3, 2021 14:53 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/GitHub and GitHub Gist repository
-- 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