Skip to content

Instantly share code, notes, and snippets.

View Dr-Denzy's full-sized avatar

Dennis Akpenyi Dr-Denzy

View GitHub Profile
@Dr-Denzy
Dr-Denzy / descriptors.py
Created September 22, 2019 04:17 — forked from jsborjesson/descriptors.py
Python descriptors made easy
import re
from weakref import WeakKeyDictionary
class AdvancedDescriptor(object):
"""
Base class for descriptors, is hard to understand but works for most cases.
from https://www.youtube.com/watch?v=P92z7m-kZpc
"""
def __init__(self, name=None):
@Dr-Denzy
Dr-Denzy / postgres_queries_and_commands.sql
Created November 28, 2018 09:41 — 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%'
@Dr-Denzy
Dr-Denzy / prompt
Created November 7, 2018 00:05 — forked from sams/prompt
dual line color prompt with date & gitstatus
### PROMPT ###
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# name: bobthefish
#
# bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome.
#
# You will need a Powerline-patched font for this to work:
#
# https://powerline.readthedocs.org/en/master/installation.html#patched-fonts
#
# I recommend picking one of these:
#