Skip to content

Instantly share code, notes, and snippets.

version: 2.1
orbs:
jira: circleci/jira@1.0.5
workflows:
build_test_check_deploy:
jobs:
- test:
context: development
ARG PYTHON_VERSION=3.7.2-alpine
FROM python:${PYTHON_VERSION} as base
WORKDIR /app
RUN apk add --no-cache \
build-base
COPY Pipfile Pipfile.lock ./
def label_datapoints(axes, percent=False):
if percent:
precision = 2
extra = '%'
else:
precision = 0
extra = ''
for patch in axes.patches:
axes.text(x=patch.get_x() + patch.get_width() / 2.,
y=patch.get_height(),
def label_datapoints(axes, percent=False):
if percent:
precision = 2
extra = '%'
else:
precision = 0
extra = ''
for patch in axes.patches:
axes.text(x=patch.get_x() + patch.get_width() / 2.,
y=patch.get_height(),
from sqlalchemy.dialects import postgresql
query.statement.compile(
dialect=postgresql.dialect(),
compile_kwargs={"literal_binds": True}))
@austinmcconnell
austinmcconnell / postmortem.md
Created April 24, 2019 14:31 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym

Keybase proof

I hereby claim:

  • I am austinmcconnell on github.
  • I am austinmcconnell (https://keybase.io/austinmcconnell) on keybase.
  • I have a public key whose fingerprint is AD0E FDBD 8AB8 C942 B24F 45EB D10D 0D7D E28C E6C6

To claim this, I am signing this object:

@austinmcconnell
austinmcconnell / statistics.sql
Created August 9, 2018 18:18 — forked from ruckus/statistics.sql
Postgres statistics queries
** Find commmonly accessed tables and their use of indexes:
SELECT relname,seq_tup_read,idx_tup_fetch,cast(idx_tup_fetch AS numeric) / (idx_tup_fetch + seq_tup_read) AS idx_tup_pct FROM pg_stat_user_tables WHERE (idx_tup_fetch + seq_tup_read)>0 ORDER BY idx_tup_pct;
Returns output like:
relname | seq_tup_read | idx_tup_fetch | idx_tup_pct
----------------------+--------------+---------------+------------------------
schema_migrations | 817 | 0 | 0.00000000000000000000
user_device_photos | 349 | 0 | 0.00000000000000000000
@austinmcconnell
austinmcconnell / create_sftp_user.txt
Created February 1, 2018 20:57
Linux helper function to create an sftp user
# usage: create_sftp_user <username>
function create_sftp_user() {
# create user
sudo adduser --disabled-password --gecos "" $1
# prevent ssh login & assign SFTP group
sudo usermod -g sftpaccess $1
sudo usermod -s /bin/nologin $1
# chroot user (so they only see their directory after login)
command+delete Send Hex Code: 0x15 kill line backward
command+shift+delete Send Hex Code: 0x0B kill line forward
option+delete Send Hex Code: 0x17 kill word backward
option+shift+delete Send Escape Sequence: Esc+d kill word forward
command+left Send Hex Code: 0x01 move to start of line
command+right Send Hex Code: 0x05 move to end of line
option+left Send Escape Sequence: Esc+b move word backward
option+left Send Escape Sequence: Esc+f move word forward