Skip to content

Instantly share code, notes, and snippets.

View ewdurbin's full-sized avatar
🌮
eatin' tacos

Ee Durbin ewdurbin

🌮
eatin' tacos
View GitHub Profile
BEGIN MESSAGE.
wbrEzoDJmpVyOkj qpmJZ0PIx9oix1r Re33Tbju91osXum FxhDXc3FH1cEG40
HCjyXJ7YDswmKhv wPdSAT2nt2tTCKq 6Xr2MZHgg6XMn9Y 8LAZ1DhaWetZETb
PZrmmLZqrCR7rSr RHgLVnZh4vkGZjD ltHYOdDVqnteBmA eafYdvDNo2HRfl3
zs6QGHD2tXoN5Ed sLuvNNaFbViGqk9 hdWbd0Qz5Z.
END MESSAGE.
@ewdurbin
ewdurbin / PSF_CLA
Last active January 7, 2019 17:08
Python Software Foundation Contributor License Agreement
# Contributor Agreement
This Contributor Agreement is between Python Software Foundation (“PSF”) and the individual or other entity identified below (“the Contributor”).
Contributor offers to license certain software (a “Contribution” or multiple “Contributions”) to PSF, and PSF agrees to accept said Contributions, under the terms of the open source license identified below (the "Initial License").
Contributor understands and agrees that PSF shall have the irrevocable and perpetual right to make and distribute copies of any Contribution, as well as to create and distribute collective works and derivative works of any Contribution, under the Initial License or under any other open source license approved by a unanimous vote of the PSF board. Contributor shall identify each Contribution by placing the following notice in its source code adjacent to Contributor's valid copyright notice: "Licensed to PSF under a Contributor Agreement."
The currently acceptable licenses are:
@ewdurbin
ewdurbin / README.md
Last active February 17, 2018 00:29
Twitter-Pollin

Twitter Poll...

I was doing some pair programming with someone with a different background and we were implementing a dict like class for on disk storage of key value pairs.

We reached a point where we had a discussion over the difference between the following implementations:

UPDATE: Note that the question is which method should call which :) It is toy code, written in minutes, without tests. Focus on the differences between the implementations and their flows, not edge cases and bugs.

Option A:

Keybase proof

I hereby claim:

  • I am ewdurbin on github.
  • I am ewdurbin (https://keybase.io/ewdurbin) on keybase.
  • I have a public key whose fingerprint is 22AD AE0F C41E 160A D159 6B11 8F8E 4231 6892 8420

To claim this, I am signing this object:

@ewdurbin
ewdurbin / 0-Conference-Beverages.md
Last active January 14, 2018 00:31
Conference Beverages Summarization.

See blog post at https://ernest.ly/blog/conference-beverages

Collection of data

parse.py and the Pipfile can take an HTML dump of a tweet permalink and dump out the basics like reply count, likes, retweets, and the tweet body, just install Python 3.7, pipenv and execute pipenv run python parse.py after dropping a replies.html in your current working directory. This will probably break next time twitter changes the avatar shape or something.

Unfortunately you need to go through manually or via some JavaScript (exercise left to reader) to click all the daggon "show more" buttons before copying out the HTML with your favorite tool.

The resulting responses.csv file was manually cleaned of off-topic responses and other "meta" conversation.

@ewdurbin
ewdurbin / LICENSE
Last active September 18, 2018 20:59
Little bit of magic to send your DataDog dogstatsd metrics to CloudWatch
Simplified BSD License
Copyright (c) 2016-2017, Ernest W. Durbin III
Copyright (c) 2016-2017, The Groundwork LLC.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,

aws-cli bash helper functions

The official AWS command line tools, have support for configuration profiles. See Configuring the AWS Command Line Interface - Named Profiles.

Managing multiple profiles with the AWS CLI itself is relatively straight forward, switching between them with --profile flag on the command line or the AWS_PROFILE environment variable.

These helpers extend that functionality for convenience with other tools in the ecosystem.

aws-profile

upstream s3proxy {
server localhost:18000;
}
upstream pipsy {
server localhost:5000;
}
server {
mysql_install_db --basedir=$(dirname $(mysql_config --variable=pkglibdir)) --datadir=/tmp/lol
mysqld --datadir=/tmp/lol --port=65530 --socket=/tmp/lol/mysql.sock --basedir=$(dirname $(mysql_config --variable=pkglibdir)) &
sleep 5
echo "CREATE DATABASE km3;" | mysql -u root -h 127.0.0.1 -P 65530
mysql -u root -h 127.0.0.1 -P 65530 km3 < core_db.sql
for migration in migrations/*; do mysql -u root -h 127.0.0.1 -P 65530 km3 < $migration; done
echo "show tables;" | mysql -u root -h 127.0.0.1 -P 65530 km3
echo "DROP DATABASE km3;" | mysql -u root -h 127.0.0.1 -P 65530
kill %1
rm -rf /tmp/lol