Skip to content

Instantly share code, notes, and snippets.

View aausch's full-sized avatar
💭
everyday I'm hustlin'

Alex Ausch aausch

💭
everyday I'm hustlin'
View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
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%'
@brad-anton
brad-anton / requests_connect_with_headers.py
Last active October 24, 2019 00:23
Certain proxy servers require the Full HTTP request to be included in the same packet as the HTTP CONNECT, however requests seems to split these up into multiple packets. This work around combines the headers and connect into a single send(). Documented here: https://github.com/requests/requests/issues/4884
"""
requests_connect_with_headers.py
@brad_anton
Certain proxy servers require the Full HTTP request to be included in
the same packet as the HTTP CONNECT, however requests seems to split
these up into multiple packets. This work around combines the headers
and connect into a single send().
Documented here: https://github.com/requests/requests/issues/4884
@gauchy
gauchy / notion2Habitica.py
Last active April 24, 2024 03:31
Notion to Habitica Sync tool
import requests, json
#Notion's token and databaseId
token = 'XXX'
databaseId = 'XXX'
#Notion's headers
headers = {
"Authorization": "Bearer " + token,
"Content-Type": "application/json",