Skip to content

Instantly share code, notes, and snippets.

View godspeedelbow's full-sized avatar

Eelke Boezeman godspeedelbow

View GitHub Profile

How to use 1Password and 2FA with eTrade

IMPORTANT!
As of May 17, 2020, python-vipaccess stopped working for provisioning new Symantec VIP Access tokens (which was its raison d'être).
As of May 27, 2020, it's working again.
It might stop working again. and we might not be able to get it to work again (see #39)

Note: Your password cannot be more than 26 characters for you to use 2FA in general. eTrade makes you enter your 2FA code appened to your password to login and limits the length of password input to 32 characters, thus further restricting the maximum length of your actual password.

const run = (userId) => {
let user;
let posts;
getUser(user, (err, _user) => {
if (err) return done(err);
user = _user;
if (posts) pleaseContinue(); // `posts` already fetched? continue
});
getPosts(posts, (err, _posts) => {
const run = (userId) => {
async.waterfall([
callback => {
async.parallel([
cb => getUser(userId, cb),
cb => getPosts(userId, cb),
], callback);
},
([user, posts], callback) => {
getComments(posts, (err, comments) => callback(err, user, posts, comments));
const run = (userId) => {
Promise.all([
getUser(userId),
getPosts(userId),
]).then([user, posts, comments] => {
getComments(posts).then(comments => {
parsePostsWithComments(user, posts, comments).then(postsWithComments => {
console.log('postsWithComments', postsWithComments);
});
});
const run = async userId => {
const [user, posts] = await Promise.all([
getUser(userId),
getPosts(userId),
]);
const comments = await getComments(posts);
return await parsePostsWithComments(user, posts, comments);
}
// 'await' the Promise to resolve and assign result to `user`
const user = await getUserPromise(userId);
console.log('user', user);
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math