Skip to content

Instantly share code, notes, and snippets.

View whogood's full-sized avatar

Sergey Ermolaev whogood

View GitHub Profile
@whogood
whogood / .gitignore
Created March 26, 2025 08:35 — forked from karmi/.gitignore
Example Nginx configurations for Elasticsearch (https://www.elastic.co/blog/playing-http-tricks-nginx)
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/
@whogood
whogood / postgres_queries_and_commands.sql
Created November 11, 2021 21:23 — 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%'
@whogood
whogood / child_process.js
Created January 31, 2017 09:20
how to workers
var exec = require('child_process').exec;
var child = exec('node ./commands/server.js');
child.stdout.on('data', function(data) {
console.log('stdout: ' + data);
});
child.stderr.on('data', function(data) {
console.log('stdout: ' + data);
});
child.on('close', function(code) {
console.log('closing code: ' + code);
@whogood
whogood / app.css
Last active November 5, 2015 16:58
File list widget with drag and drop actions
.list {
vertical-align: top;
display: inline-block;
padding: 10px;
width: 500px;
background: #f5f5f5;
}
.list--droppable {
background: #ffdada;