Skip to content

Instantly share code, notes, and snippets.

@bhaibel
bhaibel / postMetrics.js
Created October 30, 2018 01:04
metrics & async/await snippet 7
function postMetrics(eventName, metadata) {
fetch(METRICS_URL, {method: 'POST', data: { eventName, metadata }}).catch(noop);
}
@bhaibel
bhaibel / postMetrics.js
Last active October 30, 2018 01:06
metrics & async/await snippet 6
async function postMetrics(eventName, metadata) {
return fetch(METRICS_URL, {method: 'POST', data: { eventName, metadata }}).catch(noop);
}
@bhaibel
bhaibel / showPrice.js
Created October 30, 2018 01:02
metrics & async/await snippet 5
async function showPrice(item) {
// beginning of function
showUserTotal(totalPrice);
postMetrics('userCheckoutStep3', totalPrice);
return totalPrice;
}
@bhaibel
bhaibel / showPrice.js
Created October 30, 2018 01:01
Metrics & async/await snippet 4
async function showPrice(item) {
// beginning of function
await postMetrics('userCheckoutStep3', totalPrice);
return totalPrice;
}
@bhaibel
bhaibel / showPrice.js
Created October 30, 2018 01:00
Metrics & Async/Await -- snippet 3
async function showPrice(item) {
const priceWithoutShipping = onSale ? salePrice(item) : item.price;
const shippingCost = await shippingRate(item);
const totalPrice = priceWithoutShipping + shippingCost;
showUserTotal(totalPrice);
return totalPrice;
await postMetrics('userCheckoutStep3', totalPrice);
}
async function showPrice(item) {
const priceWithoutShipping = onSale ? salePrice(item) : item.price;
const shippingCost = await shippingRate(item);
const totalPrice = priceWithoutShipping + shippingCost;
showUserTotal(totalPrice);
await postMetrics('userCheckoutStep3', totalPrice);
}
@bhaibel
bhaibel / showPrice.js
Last active October 30, 2018 00:59
Metrics, Async/Await, and Really Big Hammers -- snippet 1
async function showPrice(item) {
const priceWithoutShipping = onSale ? salePrice(item) : item.price;
const shippingCost = await shippingRate(item);
const totalPrice = priceWithoutShipping + shippingCost;
await postMetrics('userCheckoutStep3', totalPrice);
showUserTotal(totalPrice);
}

This list now exists over at http://juliepagano.com/blog/2013/11/02/101-off-limits/ and will be updated there.

I keep saying that impromptu, unwanted feminism 101 discussions are exhausting and not a good use of my resources. Then people ask what I mean by 101, so I'm starting to make a list. This list will change over time - I recommend checking back.

I highly recommend checking this list before engaging with me about feminism if you're new to it. It'll save both of us a lot of time and frustration.

Diversity in tech

Women aren't equally represented in tech because biology

Nope. This argument is bad and the science does not support it. Unfortunately, every time you say this out loud, you are contributing to cultural problems that do decrease the number of women in tech.