Skip to content

Instantly share code, notes, and snippets.

View motiko's full-sized avatar
😎
Ask GPT

Moti Koritz motiko

😎
Ask GPT
View GitHub Profile
@motiko
motiko / postgres_queries_and_commands.sql
Created November 15, 2018 08:20 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@motiko
motiko / gist:9753b205e6f0704e5d2af9a91a2951be
Last active October 10, 2018 08:59 — forked from lestoni/gist:8c74da455cce3d36eb68
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • za toggle a fold at the cursor (zo/zc)
  • zA toggle all folds at the cursor (zO/zC)
  • zm increases the foldlevel by one.
  • zM closes all open folds.
  • zr decreases the foldlevel by one.
  • zR decreases the foldlevel to zero -- all folds will be open.
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zf#j creates a fold from the cursor down # lines.