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
// 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);
}
@motiko
motiko / inde.html
Created August 8, 2015 17:19
Autoreload static HTML/JS/CSS
<script src="http://livejs.com/live.js"></script>
@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.
@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 / tech blogs
Last active July 19, 2019 17:25
Javascript and react
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/ --