Skip to content

Instantly share code, notes, and snippets.

View mjallday's full-sized avatar
🏠
WFH

Marshall Jones mjallday

🏠
WFH
View GitHub Profile
@mjallday
mjallday / keybase.md
Created September 5, 2018 17:14
keybase.md

Keybase proof

I hereby claim:

  • I am mjallday on github.
  • I am mjallday (https://keybase.io/mjallday) on keybase.
  • I have a public key whose fingerprint is 5043 3C86 AAD6 968F 3D28 8F98 F439 FD97 E280 4455

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am mjallday on github.
  • I am mjallday (https://keybase.io/mjallday) on keybase.
  • I have a public key whose fingerprint is 5043 3C86 AAD6 968F 3D28 8F98 F439 FD97 E280 4455

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am mjallday on github.
  • I am mjallday (https://keybase.io/mjallday) on keybase.
  • I have a public key whose fingerprint is 5043 3C86 AAD6 968F 3D28 8F98 F439 FD97 E280 4455

To claim this, I am signing this object:

@mjallday
mjallday / README.md
Last active August 29, 2015 14:21
Engineering Exercise

Engineering Exercise

  1. Data parsing Please do not spend more than two hours on this task. It's not important to complete it but if you do not finish please let us know how you would have completed it given sufficient time.

Below is an ISO formatted string. 0210B238000102C080040000000000000002100000000000001700010814465469421614465701081100301000000N399915444303500019991544986020 Invalid response!!!009000095492

Tasks

  • Tell us the format of this message
@mjallday
mjallday / generate.py
Created May 7, 2015 22:55
Balanced ID Generator
def id_factory(prefix=None):
def generate():
bytes_ = hashlib.sha1(uuid.uuid1().bytes).digest()
# base62_encode comes from
# https://stackoverflow.com/questions/1119722/base-62-conversion-in-python
id_ = base62_encode(int(bytes_.encode('hex'), base=16))[:12]
if prefix:
id_ = prefix + id_
@mjallday
mjallday / gist:f07618417d1920f4e20e
Created March 15, 2015 22:14
Balanced Partial Outage Post Mortem - 2015-03-15

Balanced experienced a partial outage that affected 25% of card processing transactions between 8:40AM and 9:42AM this morning due to a degraded machine which was not correctly removed from the load balancer.

The core of the issue was in our secure vault system, which handles storage and retrieval of sensitive card data. One of the machines stopped sending messages, which cause some requests to be queued up but not processed but our automated health checks did not flag the machine as unhealthy.

We found the root cause of the issue and have resolved the problem to ensure that it will not re-occur.

We're dedicated to providing high-quality support and a culture of openness during the migration process. If you continue to experience issues, please email us at support@balancedpayments.com or tweet at @balancedstatus.

@mjallday
mjallday / README.md
Last active September 25, 2020 09:47
SQS Latency Measuring

SQS Latency testing

Run this from an ec2 instance in the us-west-1 region.

It will create two queues and feed messages into the first queue with a timestamp, this message will then be read and the difference between the message timestamp and the current time computed and pushed into a response queue. Reading these times will give you the latency between publishing to a queue and receiving the message.

# bashrc
if [ -e ${HOME}/.git-completion.bash ]; then
source ${HOME}/.git-completion.bash
git_branch () {
__git_ps1 "(%s)"
}
else
git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@mjallday
mjallday / README.md
Created July 29, 2014 23:44
New Relic python client, SQLAlchemy and psycopg2 library

If you attempt to register an extension with psycopg2 and happen to use the newrelic python client library you may get an error that looks like this

  File "/opt/balanced/embedded/lib/python2.7/site-packages/psycopg2/_json.py", line 142, in register_default_json
    loads=loads, oid=JSON_OID, array_oid=JSONARRAY_OID)
  File "/opt/balanced/embedded/lib/python2.7/site-packages/psycopg2/_json.py", line 125, in register_json
    register_type(JSON, not globally and conn_or_curs or None)
TypeError: argument 2 must be a connection, cursor or None
@mjallday
mjallday / meta.rb
Last active August 29, 2015 14:04 — forked from rserna2010/gist:2ebe2fa4f8afc7b113bb
Balanced - Filter by meta fields (Ruby)
Find By Email
Balanced::Customer.where(:email => 'jim@gmail.com').all
Find By Meta
Balanced::Debit.where('meta.orderid' => '12345').all
Combo
Balanced::Debit.where('meta.order' => '12345', "status"=>"succeeded").all
Find By Date