Skip to content

Instantly share code, notes, and snippets.

View aydrian's full-sized avatar

Aydrian Howard aydrian

View GitHub Profile
@aydrian
aydrian / movr_serverless.md
Last active January 25, 2023 18:33
CockroachDB serverless MovR Set up

CockroachDB serverless MovR Set up

Generate schemas and data for MovR and start the demo workload

  1. Download ccloud CLI using Homebrew brew install cockroachdb/tap/ccloud
  2. Create a new Cluster using ccloud quickstart (Choose AWS, us-east-1)
    1. Choose AWS
    2. Choose us-east-1
  3. Create New SQL User: superblocks

CockroachDB Serverless Remix Demo Script

Remixing a Stack to Use CockroachDB Serverless

  1. Create a new Remix Indie Stack application npx create-remix --template remix-run/indie-stack Template calls prisma generate, migrate deploy, and seed.
  2. Download ccloud CLI using Homebrew brew install cockroachdb/tap/ccloud
  3. Create a new Cluster using ccloud quickstart (Choose AWS, us-east-1)
  4. Choose AWS
@aydrian
aydrian / javascript.json
Created January 27, 2021 18:38
Courier Node.js Send VS Code Snippet
{
"Courier Send (Node.js SDK)": {
"prefix": "csj",
"body": [
"const { messageId } = await ${1:courier}.send({",
"\teventId: \"${2}\",",
"\trecipientId: \"${3}\",",
"\tprofile: {},",
"\tdata: {}",
"});"
@aydrian
aydrian / send_sendgrid_inline_images.js
Created January 5, 2021 13:44
Send an email using Courier with SendGrid that includes an inline image.
/*
Required environment variables:
COURIER_AUTH_TOKEN
This will grab an image and convert it to a base64 encoded string.
Use `cid:bulbasaur.png` as the image path in the Courier Notification Designer.
*/
require("dotenv").config();
const { CourierClient } = require("@trycourier/courier");
const fs = require("fs");
@aydrian
aydrian / send_sparkpost_inline_images.js
Created January 5, 2021 13:28
Send an email using Courier with SparkPost that includes an inline image.
/*
Required environment variables:
COURIER_AUTH_TOKEN
This will grab an image and convert it to a base64 encoded string.
Use `cid:bulbasaur.png` as the image path in the Courier Notification Designer.
*/
require("dotenv").config();
const { CourierClient } = require("@trycourier/courier");
const fs = require("fs");
@aydrian
aydrian / courier_send_s3_attachment_with_aws-ses.js
Created November 12, 2020 16:01
Send an email using Courier with an attachment from AWS S3 with AWS SES.
/*
Required environment variables:
COURIER_AUTH_TOKEN
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
*/
require("dotenv").config();
const S3 = require("@aws-sdk/client-s3");
const { CourierClient } = require("@trycourier/courier");
@aydrian
aydrian / .env
Created August 4, 2020 17:39
Fetch all public Slack Channels for a workspace and create a Courier Profile for each one.
# https://api.slack.com/apps
# Slack App must be granted channels:read and chat:write scopes
SLACK_TOKEN="YOUR_SLACK_TOKEN"
# Sign into your Courier Account and go to https://www.trycourier.app/settings
COURIER_AUTH_TOKEN=YOUR_COURIER_TOKEN
@aydrian
aydrian / create_brand.py
Created July 31, 2020 15:03
Courier Brands Demo using the Python SDK
import pprint
from trycourier import Courier
from trycourier.exceptions import CourierAPIException
pp = pprint.PrettyPrinter(indent=2)
client = Courier()
brand_settings = {
'colors': {
@aydrian
aydrian / cosmosdb.js
Last active May 15, 2020 15:08
CosmosDB work around for Aggregation Pipeline deficiency
/*
Recipient Document
{
_id: "5eb465210e56cee76582f9a3",
tz: "America/New_York",
islanderName: "Aydrian",
islandName: "Echo Creek"
}
*/
@aydrian
aydrian / mongodb.js
Last active May 11, 2020 17:48
Aggregation Pipeline for TimeZones
/*
Recipient Document
{
_id:5eb465210e56cee76582f9a3,
tz:"America/New_York",
islanderName:"Aydrian",
islandName:"Echo Creek"
}
*/