Skip to content

Instantly share code, notes, and snippets.

View biancadanforth's full-sized avatar

Bianca Danforth biancadanforth

View GitHub Profile

What happens after Outreachy?

Disclaimer: These thoughts are my own (Bianca Danforth) based on my experience starting as an Outreachy at Mozilla and now working as a Senior Software Engineer.

Congratulations! You’ve just completed your Outreachy internship. You may be wondering: Where do I go from here? How do I get a job in software engineering? Below are a set of steps I recommend based on my own experience.

Introspect

  • Identify goals
    • What are your professional goals?
    • If you're not sure where to start, ask other people you admire what their professional goals are.
  • Identify skills
  • What skills do you need to achieve your goals (those you already have, those that you need to improve, and those you need to learn)?
@biancadanforth
biancadanforth / Algorithms Coursera Part II Programming Assignment 1.js
Last active July 13, 2023 04:30
Algorithms Coursera Part II Programming Assignment 1.js
/* eslint-env node */
/**
* The file contains the edges of a directed graph. Vertices are labeled
* as positive integers from 1 to 875714. Every row indicates an edge,
* the vertex label in first column is the tail and the vertex label in
* second column is the head (recall the graph is directed, and the edges
* are directed from the first column vertex to the second column vertex).
* So for example, the 11th row looks like: "2 47646". This just means
* that the vertex with label 2 has an outgoing edge to the vertex with
* label 47646
@biancadanforth
biancadanforth / Algorithms Coursera Part II Programming Assignment 4.js
Last active February 7, 2023 19:08
Algorithms Coursera Part II Programming Assignment 4.js
/* eslint-env node */
/**
* The goal of this problem is to implement a variant of the 2-SUM algorithm
* covered in this week's lectures.
*
* The file contains 1 million integers, both positive and negative (there
* might be some repetitions!).This is your array of integers, with the ith
* row of the file specifying the ith entry of the array.
*
// Course: https://www.coursera.org/learn/algorithms-divide-conquer/home/welcome
// Assignment: https://www.coursera.org/learn/algorithms-divide-conquer/exam/YLbzP/programming-assignment-2
/**
* Maximum number of inversions: "n choose 2", where n = 100000; i.e. if array of numbers were
* sorted in descending order (worst case scenario), rather than ascending (best case scenario,
* 0 inversions).
* "n choose 2" = [n * (n - 1)]/2
*/
@biancadanforth
biancadanforth / fxa-4418-unknown.diff
Last active January 11, 2022 12:37
FXA-4418 chore(auth): set state as "unknown" if it can't be determined
diff --git a/packages/fxa-auth-server/lib/payments/stripe.ts b/packages/fxa-auth-server/lib/payments/stripe.ts
index 23ef5812a..84be94e75 100644
--- a/packages/fxa-auth-server/lib/payments/stripe.ts
+++ b/packages/fxa-auth-server/lib/payments/stripe.ts
@@ -833,24 +833,9 @@ export class StripeHelper {
customerId: string;
postalCode: string;
country: string;
- }): Promise<boolean> {
- try {
@biancadanforth
biancadanforth / article-ruleset.js
Created January 5, 2022 23:08
Fathom article webpage ruleset
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable max-len, arrow-body-style */
import {linearScale} from "fathom-web/utilsForFrontend";
import {dom, out, rule, ruleset, score, type} from "fathom-web";
const coefficients = {
"paragraph": [
@biancadanforth
biancadanforth / temp-fxa-3907-script.ts
Created September 20, 2021 14:53
FXA-3907 exploration: How many users are affected by off-session SCA?
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { AuthLogger } from 'fxa-auth-server/lib/types';
import { ACTIVE_SUBSCRIPTION_STATUSES } from 'fxa-shared/subscriptions/stripe';
import { StatsD } from 'hot-shots';
import stripe from 'stripe';
import Container from 'typedi';
import { CurrencyHelper } from '../lib/payments/currencies';
@biancadanforth
biancadanforth / proration_formula.md
Created June 10, 2021 17:08
Formula for computing a prorated upgrade charge amount in Stripe

If upgrading (say from a $10/month to a $20/month plan 3 days into the subscription):

  1. Calculate the fraction of the period used to this point under the previous plan, x.
3 days /30 days = 0.1 = x

Note: This is approximate, since months can have different numbers of days, there are leap years, etc.

  1. Multiply x by the previous plan's billing amount, amount_prev to get how much to credit the customer back, credit.
@biancadanforth
biancadanforth / call-paypal-api-requiring-bearer-token.js
Last active December 23, 2020 23:08
Fetching an ephemeral OAuth2 bearer token from PayPal sandbox when we don't have one or it's expired and then calling a PayPal API that requires the token.
const fetch = require("node-fetch");
const { getPayPalBearerToken } = require("../../github/bin/get-oauth2-token/bin/getOAuth2Token");
const PAYPAL_SANDBOX_BASE_URL = "https://api-m.sandbox.paypal.com";
async function postToPayPalAPI(apiPath, body) {
const bearerToken = await getPayPalBearerToken();
const metadata = {
body,
headers: {
const fetch = require("node-fetch");
const config = {
paypal: require("./paypal-config")["DEV"],
};
const PAYPAL_SANDBOX_NVP_BASE_URL = "https://api-3t.sandbox.paypal.com/nvp";
const nvpUrl = new URL(PAYPAL_SANDBOX_NVP_BASE_URL);
const params = {
USER: config.paypal.USER, // Merchant username
PWD: config.paypal.PWD, // Merchant password