select
(age/10)*10 as from_age, -- Bucket unique
((age/10)*10)+10 as to_age,
count(*),
repeat('=', (count(*) * 30 / max(count(*)) over ())::int) as bar
from users
group by 1
order by 1;
########################################################################################################################
psql ... -Xf ~/q.sql --csv > /tmp/TODO.csv
\copy (
) to '/tmp/TODO.csv' csv header
########################################################################################################################
From Getting Started
- Configure the web browser to use
localhost:8080
as proxy. - Start
mitmproxy
. - If not done before, go to
http://mitm.it/
and install the CA cert. - To intersect requests press and use
~u <regex> & ~q
(see the docs)
Eg. for localhost:3000
mitmproxy -p 4000 --set console_focus_follow --mode reverse:http://localhost:3000/ --set modify_headers="/~q/Origin/http://localhost:3000"
########################################################################################################################
Example: Merging on staging is difficult because of diverging histories. You could cherry-pick each commit, or:
# Ensure staging is up-to-date
git checkout staging
git pull
# Ensure my-branch is up-to-date with master (optional but good)
git checkout my-branch
git rebase origin/master
# Make a temp branch from my-branch
git checkout -b temp
# Rebase it from it's chosen parent (here origin/master but can use other to cut
# in a different place, or when not having rebase before) on top of staging.
# Now temp is `origin/staging --> your-commits` which is what you want staging
# to look like
git rebase --onto origin/staging origin/master
# Go staging and reset the pointer to temp. Done
git checkout staging
git reset --hard temp
# Let the world know...
git push