Skip to content

Instantly share code, notes, and snippets.

View shvechikov's full-sized avatar

Leonid Shvechikov shvechikov

View GitHub Profile
#!/bin/python3
def get_direction(n, m, x, y):
if y == 0 and x != n - 1:
return '>', n-x-1
if y == m - 1 and x != 0:
return '<', x
if x == 0:
return '^', y
if x == n - 1:
def print_matrix(matrix):
for line in matrix:
print(' '.join(map(str, line)))
def empty(n, m):
matrix = []
for i in range(m):
matrix.append(['.'] * n)
return matrix
@shvechikov
shvechikov / simple-git-branching-model.md
Last active October 23, 2020 06:17
a simple git branching model

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@shvechikov
shvechikov / vim_last_position
Created July 6, 2010 15:08
Vim: Return to last edit position
" Put to .vimrc
" Return to last edit position (You want this!) *N*
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif