Skip to content

Instantly share code, notes, and snippets.

@maxqwerty
maxqwerty / update_select.sql
Created August 10, 2021 15:28
UPDATE with SELECT, pgsql
UPDATE target_tagle AS target
SET col1 = col1 + other.col1,
col2 = other.col2
FROM (
SELECT id, col1, col2
FROM other_table
) AS other
WHERE target.id = other.id;
@maxqwerty
maxqwerty / git_config.sh
Last active May 13, 2024 14:40
Useful git aliases
#!/bin/bash
git config --global alias.st "status"
git config --global alias.cm "commit -m"
git config --global alias.addgi "add .gitignore"
git config --global alias.po "push -u origin"
git config --global alias.pr "pull -rebase"
git config --global alias.dt "difftool --dir-diff ."
git config --global alias.last "log -1 HEAD --stat"
git config --global alias.lg "log --graph --pretty=format:\"%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) [%an]\""