Skip to content

Instantly share code, notes, and snippets.

View sagidM's full-sized avatar
🏠
Working from home

Sagid M sagidM

🏠
Working from home
  • Remote
View GitHub Profile
@sagidM
sagidM / global.gitconfig
Created April 9, 2024 12:22
Override Git Config for specific path
# ~/.gitconfig
[includeIf "gitdir:~/projects/service1/"]
path = ~/projects/service1/.gitconfig
[includeIf "gitdir:~/projects/service2/"]
path = ~/projects/service2/.gitconfig
[user]
name = Sagid Magomedov
@sagidM
sagidM / pg_dump_restore.sh
Last active October 20, 2024 16:54
The correct way to dump & restore (aka download) the PostgreSQL Database
# This dumps to a binary file
pg_dump "postgres://<USERNAME>:<PASSWORD>@<HOST>:<PORT>/vkdoc" -Fc -f <ANY_FILENAME>
pg_restore -d postgres -U <USERNAME> -h <HOST> -p <PORT> --no-owner -c --if-exists <ANY_FILENAME>
# Example
pg_dump "postgres://postgres:1234@localhost:5432/mydb" -Fc -f mydb.o
pg_restore -d mydb -U postgres -h localhost -p 5432 --no-owner -c --if-exists mydb.o
@sagidM
sagidM / .vimrc
Created October 12, 2022 09:10
Vim Config
syntax on
set ruler
set smartindent expandtab
set tabstop=4 shiftwidth=4
set incsearch
filetype plugin on
vmap ++ <plug>NerdCommenterToggle
qwe