Skip to content

Instantly share code, notes, and snippets.

View agsha's full-sized avatar

Sharath Gururaj agsha

View GitHub Profile
@agsha
agsha / converturl.py
Created August 31, 2020 19:50
This gist takes a markdown input and generates a Table of contents from the headings
import inspect
import json
import logging
import os
import re
import sys
import subprocess
import threading
from urllib import request
import socket
@agsha
agsha / postgres bulk percentiles calculation
Created March 30, 2020 13:16 — forked from evan-burke/postgres bulk percentiles calculation
Postgres bulk percentile calculation with generate_series() and percentile_cont()
This will return the percentiles in order.
-- #1
select unnest(
percentile_cont(
(select array_agg(s) from generate_series(0, 1, 0.2) as s)
) WITHIN GROUP (ORDER BY SIZE))
from mytable