Skip to content

Instantly share code, notes, and snippets.

View suTerminus's full-sized avatar

Berkay suTerminus

View GitHub Profile
const { Octokit } = require("@octokit/rest");
const config = require("./config.json");
// config = {
// "repositories": [
// {
// "slug": "owner/repository",
// "maintainers": [
// "TeamA",
// "TeamB"
@suTerminus
suTerminus / postgres_queries_and_commands.sql
Created May 10, 2022 15:12 — 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%'
@suTerminus
suTerminus / commit-message.sh
Created March 22, 2022 08:38
small script which uses branch names to automatically set "<type>[optional scope]" according to conventional commit guidelines.
#!/bin/bash
if [ -z "$2" ]
then
t=$(git branch --show-current | awk -F/ '{$NF=""} 1' | awk '{s=($1=="fix" || $1=="hotfix")?"fix":"feat";print s;}')
m=$1
else
t=$1
m=$2
fi
i=$(git branch --show-current | awk -F/ '{print $2}' | awk -F- '{print $1"-"$2}')