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 { | |
ApolloClient, | |
createHttpLink, | |
InMemoryCache, | |
ApolloLink, | |
} from "@apollo/client"; | |
import fetch from "cross-fetch"; | |
/** | |
* Shopify x-request-id header logger |
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
server { | |
listen 80; | |
server_name localhost; | |
root /home/pi/projects/MirrorMirror/public; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location / { |
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 withDb from '../../middleware/withDb' | |
import { get } from 'lodash' | |
import httpProxyMiddleware from "next-http-proxy-middleware"; | |
import allowCors from "middleware/allowCors"; | |
import jwt from "jsonwebtoken"; | |
export const config = { | |
api: { | |
bodyParser: false, | |
}, |
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
files: | |
"/opt/elasticbeanstalk/support/conf/sidekiq.conf": | |
mode: "000755" | |
content: | | |
description "Elastic Beanstalk Sidekiq Upstart Manager" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
# explained above | |
respawn |
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
async function createTextSearchIndex(db) { | |
db.collection("customers").createIndex({ | |
firstName: "text", | |
lastName: "text", | |
email: "text", | |
phone: "text" | |
}); | |
} | |
async function createRegexSearchIndex(db) { |
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
const vouched = window.Vouched({ | |
appId: { process.env.VOUCHED_API_KEY }, | |
additionalSteps: [ | |
((priorStep, nextStep)) => { | |
// priorStep is a callback to go back 1 step | |
// nextStep is a callback that will go to the next step, if none then vouched.onComplete is called | |
return ( | |
<div> | |
<h2>Please provide your signature</h2> |
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
ansible-playbook playbook.yml -i hosts.yml -u ubuntu |
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
module.exports = { | |
env: { | |
NEXT_PUBLIC_SENTRY_DSN: process.env.NEXT_PUBLIC_SENTRY_DSN, | |
NEXT_PUBLIC_SHOPIFY_API_PUBLIC_KEY: process.env.NEXT_PUBLIC_SHOPIFY_API_PUBLIC_KEY, | |
}, | |
}; |
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
let formData = new FormData(); | |
formData.append("upload_preset", "<your preset from Cloudinary Dashboard here> * Required"); | |
formData.append("file", <instance of a File here>); | |
axios | |
.post( | |
"https://api.cloudinary.com/v1_1/<your Cloudinary cloud name here>/image/upload", | |
formData, | |
{ |
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
// Create the searchable checks index | |
db.collection("checks") | |
.createIndex({ shopName: 1, firstName: "text", lastName: "text" }) | |
.then((res) => { | |
console.log("checks text index created"); | |
}) | |
.catch((err) => console.log("checks text index creation failed", err)); | |
const checks = await db |