jQuery snippet to display a timestamp in local time zone and language
$(function() {
$.each($('.timestamp'), function(i, v) {
ts = $(v)
ts.text((new Date(ts.text())).toLocaleString());
})
});
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
# Project Euler 13 | |
data = <<~DATA | |
37107287533902102798797998220837590246510135740250 | |
46376937677490009712648124896970078050417018260538 | |
74324986199524741059474233309513058123726617309629 | |
91942213363574161572522430563301811072406154908250 | |
23067588207539346171171980310421047513778063246676 | |
89261670696623633820136378418383684178734361726757 | |
28112879812849979408065481931592621691275889832738 |
jQuery snippet to display a timestamp in local time zone and language
$(function() {
$.each($('.timestamp'), function(i, v) {
ts = $(v)
ts.text((new Date(ts.text())).toLocaleString());
})
});
#!/bin/sh | |
# Fetch new remote branches, prune deleted remote branches | |
git remote update -p | |
# Delete local branches for which the remote branch has been deleated | |
git branch --merged | awk '/^ /' | xargs -I $ git branch -d $ |