Skip to content

Instantly share code, notes, and snippets.

@RTLer
RTLer / postgres_queries_and_commands.sql
Created December 4, 2018 15:51 — 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%'
@RTLer
RTLer / app.js
Last active March 25, 2019 01:59
vueJs flash message component (alert)
Vue.component('child', {
ready(){
// send flash message
this.$root.$broadcast('flashMessage',{
text: 'Better check yourself, you\'re not looking too good.',
type: 'warning',//optional
important: false,//optional
timeout: 5000//optional
});
/**
* codekata
*
* @param null $number1
* @param null $number2
* @param null $number3
* @param array $notIn
* @return array
*/
function generator($number1 = null, $number2 = null, $number3 = null, $notIn = [])
@RTLer
RTLer / index.js
Created March 22, 2016 07:56
node-spider site mapper
var Spider = require('node-spider');
var list = [];
var errors = [];
var map = [];
var spider = new Spider({
concurrent: 10,
delay: 0,
logs: process.stderr,
allowDuplicates: false,