Skip to content

Instantly share code, notes, and snippets.

View mauritsl's full-sized avatar

Maurits Lawende mauritsl

View GitHub Profile
import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3';
import { resolve } from 'path';
const s3 = new S3Client({ region: 'S3_REGION' });
const s3Params = {
Bucket: 'S3_BUCKET_NAME',
Key: 'router-paths.txt'
};
const TTL = 10000;
@mauritsl
mauritsl / airtable-webhook-payloads.ts
Created December 21, 2022 18:55
Airtable webhook payloads
export async function script1({baseId, webhookId, secret}: {
baseId: string;
webhookId: string;
secret: string;
}): Promise<{
payloads: {
timestamp?: string;
baseTransactionNumber?: number;
actionMetadata?: {
source: string;
@mauritsl
mauritsl / airtable-webhook.ts
Created December 21, 2022 18:50
Airtable webhook payloads type
export type Payload = {
timestamp?: string;
baseTransactionNumber?: number;
actionMetadata?: {
source: string;
sourceMetadata: {
user: {
id: string;
email: string;
permissionLevel: string;
@mauritsl
mauritsl / results.csv
Created October 24, 2019 15:38
Starbucks offers
type reward difficulty duration web email mobile social usage turnover first_offer
discount 5 20 10 1 1 0 0 5 1 7
bogo 10 10 7 0 1 1 1 9 2 1
discount 2 10 10 1 1 1 1 3 3 3
discount 2 10 7 1 1 1 0 6 4 5
bogo 5 5 7 1 1 1 0 7 5 8
bogo 10 10 5 1 1 1 1 10 6 2
bogo 5 5 5 1 1 1 1 8 7 4
discount 3 7 7 1 1 1 1 4 8 6
informational 0 0 4 1 1 1 0 1 9 9
@mauritsl
mauritsl / portfolio.csv
Created October 21, 2019 19:55
Starbucks offers
channels offer_type reward difficulty duration
0 ['email', 'mobile', 'social'] bogo 10 10 7
1 ['web', 'email', 'mobile', 'social'] bogo 10 10 5
2 ['web', 'email', 'mobile'] informational 0 0 4
3 ['web', 'email', 'mobile'] bogo 5 5 7
4 ['web', 'email'] discount 5 20 10
5 ['web', 'email', 'mobile', 'social'] discount 3 7 7
6 ['web', 'email', 'mobile', 'social'] discount 2 10 10
7 ['email', 'mobile', 'social'] informational 0 0 3
8 ['web', 'email', 'mobile', 'social'] bogo 5 5 5