This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remix App on Heroku |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from pythonjsonlogger import jsonlogger | |
from datetime import datetime | |
import time | |
import sympy | |
class JsonFormatter(jsonlogger.JsonFormatter): | |
def add_fields(self, log_record, record, message_dict): | |
super(JsonFormatter, self).add_fields(log_record, record, message_dict) | |
if not log_record.get("timestamp"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default async function (event, context, logger) { | |
logger.info(`Invoking Datafunction with payload ${JSON.stringify(event.data || {})}`); | |
const redis = await redisConnect(); | |
let cached = {}; | |
// Check Redis for cached entry first | |
let big_biz_count = await redis.get(`big_biz`); | |
if (big_biz_count) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This is the file to create COMPANY table and to populate it with 500 records. | |
-- Just copy and paste this into the psql prompt. | |
DROP TABLE COMPANY; | |
CREATE TABLE COMPANY( | |
ID INT PRIMARY KEY NOT NULL, | |
NAME TEXT NOT NULL, | |
EMPLOYEES INT NOT NULL, | |
ADDRESS CHAR(50), | |
MONEY REAL | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Our dialog name | Description | |
---|---|---|
Default | The default dialog when a user sends a message. We’ll modify it to greet the user and forward them to “Send location”, “Send menu”, or “Send rewards info” based on user input. | |
Send location | Sends the user a Google Maps link and address, then proceeds to the “Ask to end chat” dialog. | |
Send menu | Sends the user a link to an online menu, then proceeds to the “Ask to end chat” dialog. | |
Send rewards info | Sends the user a link to create a rewards account, then proceeds to the “Ask to end chat” dialog. | |
Ask to end chat | Asks the user if they need anything else, then ends chat or forwards to “User wants more info” based on user input. | |
User wants more info | Asks the user “How else can I help?” then forwards them to “Send location”, “Send menu”, or “Send rewards info” based on user input. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# From your Marqeta Developer dashboard page | |
MQ_APPLICATION_TOKEN="INSERT YOUR APPLICATION TOKEN HERE" | |
MQ_ADMIN_ACCESS_TOKEN="INSERT YOUR ADMIN ACCESS TOKEN HERE" | |
# Create a mockbin at https://mockbin.org, then insert mockbin URL here | |
MOCKBIN_URL="INSERT YOUR MOCKBIN URL HERE" | |
# Make sure to remove trailing slash from the URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure you have added @sendgrid/mail to your Node.js project. | |
// | |
// Example Usage: | |
// API_KEY=SG.123456789 CUSTOM_URL=https://www.example.com?campaign_id=my-campaign RECIPIENT_EMAIL=johndoe@gmailx.com node index.js | |
const sgMail = require('@sendgrid/mail') | |
sgMail.setApiKey(process.env.API_KEY) | |
const text = `Please click this link for my email campaign: ${process.env.CUSTOM_URL}` | |
const html = `Please click <a href="${process.env.CUSTOM_URL}"}this link</a> for my email campaign.` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"first_name": "Mike", | |
"last_name": "John", | |
"token": "mike_john", | |
"email": "example@example.com", | |
"password": "P@ssw0rd", | |
"identifications": [ | |
{ | |
"type": "SSN", | |
"value": "111234444" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# USAGE: APPLICATION_TOKEN=<insert app token> ADMIN_ACCESS_TOKEN=<insert admin token> python3 marqeta-core-api-demo.py | |
# | |
import os | |
from marqeta import Client | |
application_token = os.environ.get('APPLICATION_TOKEN') | |
admin_access_token = os.environ.get('ADMIN_ACCESS_TOKEN') | |
base_url = "https://sandbox-api.marqeta.com/v3/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"token":"card-product-01", | |
"name":"Card Product (no funding source)", | |
"start_date": "2021-10-01", | |
"config": { | |
"card_life_cycle": { | |
"activate_upon_issue": true | |
}, | |
"fulfillment": { | |
"shipping": { |
NewerOlder