Skip to content

Instantly share code, notes, and snippets.

View fostergn's full-sized avatar

Gavin Foster fostergn

View GitHub Profile
const { deterministicPartitionKey } = require("./dpk");
// naive hash check
const isHash = (string) => string.length === 128;
const testEvent = {
partitionKey: 123,
}
describe("deterministicPartitionKey", () => {
@fostergn
fostergn / dpk.js
Last active January 24, 2023 08:03
const crypto = require("crypto");
/**
* deterministicPartitionKey() returns a deterministic partition key for a given event.
* @param {object} event
* @returns {string} partition key
*
**/
exports.deterministicPartitionKey = (event) => {
const TRIVIAL_PARTITION_KEY = "0";
@fostergn
fostergn / ticket-breakdown.md
Last active January 24, 2023 07:27
Ticket Breakdown
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
"Shop ID","Campaign Name","Segment Name","User Filters","Campaigns in Drip"
"372","VDAY Promo: 2+ Purchase Old Subscriber","Total Spend $70-$7000 - US","(total_spent_cents ge 10000 OR num_of_orders gt 1 OR subscriber_clicked_campaign_id in 331264 OR subscriber_keywords in 90417 OR subscriber_has_received_automation in 210872) AND (country_code,eq,US)","3"
"372","70-7000 Purchase Old Subscriber (copy)","Total Spend $70-$7000 - US","(total_spent_cents ge 10000 OR num_of_orders gt 1 OR subscriber_clicked_campaign_id in 331264 OR subscriber_keywords in 90417 OR subscriber_has_received_automation in 210872) AND (country_code,eq,US)","3"
"372","new campaign","Total Spend $70-$7000 - US","(total_spent_cents ge 10000 OR num_of_orders gt 1 OR subscriber_clicked_campaign_id in 331264 OR subscriber_keywords in 90417 OR subscriber_has_received_automation in 210872) AND (country_code,eq,US)","3"
"374","VALENTINES DAY SALES '22 SECOND","ENGAGED 2021","(subscriber_clicked_campaign_id in 97873 OR subscriber_clicked_campaign_
@fostergn
fostergn / banned-words.json
Last active December 9, 2021 22:21
SHAFT Banned Words
{
"sex": [
"aroused",
"arousal",
"pussy",
"sextoy",
"dildo",
"sensual",
"sexual",
"orgasm"
@fostergn
fostergn / ps-head.html
Created October 6, 2021 18:48
ps-head
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="profile" href="https://gmpg.org/xfn/11">
<style type="text/css"> .heateorSssInstagramBackground{background:radial-gradient(circle at 30% 107%,#fdf497 0,#fdf497 5%,#fd5949 45%,#d6249f 60%,#285aeb 90%)}
.heateor_sss_horizontal_sharing .heateorSssSharing,.heateor_sss_standard_follow_icons_container .heateorSssSharing{
color: #fff;
border-width: 0px;
border-style: solid;
@fostergn
fostergn / css-examples.md
Last active December 9, 2020 20:25
CSS Instructions

Custom Popup Styles

We provide an interface to change popup styles with custom code using an editor in the app. If you know how to write CSS you can flexibly enhance the styles of your popup. Even if you aren't a developer or have never written code before, there are some simple changes you can make to start customizing your popup. The two we will cover are adding a custom font and changing the size of the headline.

[provide loom to interface]

Make sure to preview any live changes in your browser, since our preview is an approximation!

Custom Font

We provide a selection of font options that work well with a variety of shopify themes, but you might use a different font. Here's how you can include a custom google font.

@fostergn
fostergn / functional-spec.md
Created June 5, 2020 06:10
Functional Specification

Functional Spec

Specification about the functionality of the fitness app. It is organized based on screens and their functionality.

We can make use of minimal state management since this app will mostly only display data. For example, for most views we can just make individual API calls etc.

Workout Routines

Routine List

Routine Single

Routine Day Single

Routine Day Exercise Single

it('Checks popup status', () => {
cy.server();
cy.route(`https://dev-api.test.io/public/popup/`).as('checkStatus');
cy.wait('@checkStatus').then((event) => {
console.log('event: ', event)
expect(event.response.body).to.eql({
enabled: true
});
});
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
'plugin:prettier/recommended'