Skip to content

Instantly share code, notes, and snippets.

@sheac
sheac / ScaleDown
Last active December 25, 2015 17:59
def scale_down(iw, ih, dw, dh)
# 1. determining which dimension is the one that needs to be
# scaled the most
limiting_dim = (iw / ih) > (dw / dh) ? "width" : "height"
# 2. then figure out how much that scaling actually is
if limiting dim == "width"
scale_by = dw / iw
else
#!/usr/bin/env python
"""
This script monitors Github repos for an organization ("company") and squash-merges pull
requests if someone has commented with the ":shipit:" emoji.
Why would you want to squash pull requests? It makes it very easy to get a high-level overview
of your master/deploy/release branch without getting bogged down in miniature type commits. Also
, on the off chance you need to, rolling back whole features is dead simple. Finally, you can
still retain proper git history if you keep the feature branch that the PR came in on.
@sheac
sheac / dont-trust-a-context.md
Created November 7, 2017 00:07
Problems with PA-12308

Hey @here

So I've taken on board some useful guidance by @rory and @eric concerning the "right" way to generate a context.Context instance for use by Mothership guts.

I'm given to believe that:

  • if we want to trace a DB query, it needs a Context
  • if we want the DB query to succeed, that Context has to have been generated in the right way:
handler.Transact(func(ctx context.Context) {...})

Known Causes

  1. Duplicate steps/fields within a single job

    • haven't confirmed any problems resulting from field-sharing yet
    • results from adding the same template multiple times
    • same DB row, but different jobBaseStepIds
  2. Shared steps/fields between clone/duplicate jobs and their originals/sources

    • haven't confirmed any problems resulting from field-sharing yet
  • results from JobController#CreateFromOffline
@sheac
sheac / pa-13238-results.md
Last active April 2, 2018 23:20
PA-13238 :: Result of Kafka Failed Message Investigation
@sheac
sheac / something.md
Last active April 12, 2018 21:45
QA'ing PA-14359 and PA-14361

The problem we encountered earlier was that thrift-api used its own default limit of 50. This would happen if an options map was present, but no limit was entered.

This is now fixed.

Here's the request:

curl -X POST \
 https://api.pow.sera-dev.co/api/messages \
@sheac
sheac / dev-accepting-PA-14782.md
Created May 4, 2018 00:25
dev-accepting-PA-14782.md

Dev-Accepting PA-14782

See PA-14782

  1. Accept Shea's invitation to the Pow team shea-team

  2. Use 'Advanced' options to ignore the SSL certificate problems, so you can access the website

  3. Ensure you can log in to the web view with a password

Goal: Side-by-side comparison of the same jobs, but two different views

We're introducing a new UI that will be feature-flagged. In order to determine that the new UI doesn't depart from the old UI in the wrong ways (e.g. not showing documents, or leaving off steps) we need to compare the new and old UIs when presenting the same jobs We'll select the three most-used recurring jobs from the six most active customers for this purpose.

Proposal: Two teams with identical jobs in a non-production environment

In environment E, we have two teams, T1 and T2. T1 has the new-UI feature flag on, but T2 doesn't.