Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Hacking through

Moti Korets motiko

🎧
Hacking through
View GitHub Profile
@motiko
motiko / tech blogs
Last active Jul 19, 2019
Javascript and react
View tech blogs
https://ctrlq.org/code -- GoogleApps Google Script
https://www.matthewgerstman.com/tech/ -- frontend (redux)
http://dt.in.th/talks/ -- Thai talks <3
https://overreacted.io/ -- Dan Abramov's blog
https://www.robinwieruch.de/ --
View postgres_queries_and_commands.sql
-- 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%'
View gist:9753b205e6f0704e5d2af9a91a2951be

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.
@motiko
motiko / inde.html
Created Aug 8, 2015
Autoreload static HTML/JS/CSS
View inde.html
<script src="http://livejs.com/live.js"></script>
View SFDC TZ Salesforce TimeZone Offset
// http://www.laceysnr.com/2011/02/time-zones-hurt-my-brain-one-way-to-get.html
// by Matt Lacey
string strOffset = System.now().format('Z');
string strOffsetHours = strOffset.substring(0,3);
if(strOffsetHours.startsWith('+'))
{
strOffsetHours = strOffsetHours.substring(1);
}