Vimtutor:
Tips & Tricks
:source $MYVIMRC Reload .vimrc without restart vim, after reload run :e
:e Reload buffer and trigger FileType event
Modes:
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
Vimtutor:
Tips & Tricks
:source $MYVIMRC Reload .vimrc without restart vim, after reload run :e
:e Reload buffer and trigger FileType event
Modes:
------------------------------------------------------------------------------ | |
2.3. NERD tree Mappings *NERDTreeMappings* | |
Default Description~ help-tag~ | |
Key~ | |
o.......Open files, directories and bookmarks....................|NERDTree-o| | |
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go| | |
t.......Open selected node/bookmark in a new tab.................|NERDTree-t| | |
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T| |
function arrayDiff(a1, a2) { | |
var diff = {}; | |
for (var i = 0; i < a1.length; i++) { | |
diff[a1[i]] = true; | |
} | |
for (var i = 0; i < a2.length; i++) { | |
if (diff[a2[i]]) { | |
delete diff[a2[i]]; |
CSPRNG (Cryptographically Secure Pseudo-Random Number Generator) functions:
os.urandom(n)
: return a string of n random bytes.random.SystemRandom()
: provides random functions that uses os.urandom()
.Note: Don't use random
module for PRNG for security purposes.
#!/bin/sh | |
# | |
# This will remove the trailing whitespaces from the files and add it again to be committed. | |
# | |
# Put this into ~/.git-templates/hooks/pre-commit, and chmod +x it. | |
# Detect platform | |
platform="win" | |
uname_result=`uname` | |
if [ "$uname_result" = "Linux" ]; then |
[core] | |
editor = /usr/bin/vim | |
autocrlf = input | |
[alias] | |
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg3 = log --graph --abbrev-commit --decorate --date=relative --all | |
lg = !"git lg1" | |
[init] | |
templatedir = ~/.git-templates |