-
Diff particular file on two branches
git diff mybranch master -- myfile.cs
-
Show names of changed files between branches
# utils.py | |
from typing import List, Tuple, Union, Dict, Any, Optional | |
def isnotebook() -> bool: | |
try: | |
shell = get_ipython().__class__.__name__ # type:ignore | |
if shell == "ZMQInteractiveShell": | |
return True # Jupyter notebook or qtconsole | |
elif shell == "TerminalInteractiveShell": |
" Author: Dhruvesh Patel <[email protected]> | |
" Description: darglint support for optional python typechecking | |
"echo loaded | |
call ale#Set('python_darglint_executable', 'darglint') | |
"call ale#Set('python_mypy_ignore_invalid_syntax', 0) | |
call ale#Set('python_darglint_options', '') | |
call ale#Set('python_darglint_use_global', get(g:, 'ale_use_global_executables', 0)) | |
call ale#Set('python_darglint_auto_pipenv', 0) | |
function! ale_linters#python#darglint#GetExecutable(buffer) abort |
# convert glove to word2vec format | |
from gensim.scripts.glove2word2vec import glove2word2vec | |
glove2word2vec(glove_input_file="emb.txt", word2vec_output_file="emb_word2vec_format.txt") | |
import gensim | |
import torch | |
model = gensim.models.KeyedVectors.load_word2vec_format('emb_word2vec_format.txt') | |
weights = torch.FloatTensor(model.vectors) | |
# Ref: https://stackoverflow.com/questions/37793118/load-pretrained-glove-vectors-in-python |
Diff particular file on two branches
git diff mybranch master -- myfile.cs
Show names of changed files between branches
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c
and [c
.
Choose which version you want to keep with :diffget //2
or :diffget //3
(the //2
and //3
are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
task | command |
---|---|
spell on | :set spell |
spell off | :set nospell |
check spellings in syntax items as well | :syntax spell toplevel |
add spell file to save spelling exceptions | $ mkdir -p ~/.vim/spell/ |
set the spell file | :set spellfile=~/.vim/spell/en.utf-8.add |
see spell suggestions | z= |
add exception to spell file | zg |
The connection failed because by default psql
connects over UNIX sockets using peer
authentication, that requires the current UNIX user to have the same user name as psql
. So you will have to create the UNIX user postgres
and then login as postgres
or use sudo -u postgres psql database-name
for accessing the database (and psql
should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres
(as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf
* line:
from
{ | |
"data": { | |
"__schema": { | |
"queryType": { | |
"name": "Query" | |
}, | |
"mutationType": { | |
"name": "Mutation" | |
}, | |
"types": [ |
query repo_info($owner: String!, $name: String!){ | |
repository(owner: $owner, name: $name) { | |
...RepoFragment | |
} | |
} | |
fragment RepoFragment on Repository { | |
name | |
stargazers { | |
totalCount |