This file contains hidden or 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 nc from "next-connect"; | |
const { setQueues, BullAdapter, router } = require("bull-board"); | |
import emailQueue from 'queues/emailQueue'; // or wherever your queues lie | |
setQueues([ | |
new BullAdapter(emailQueue), | |
]); | |
const handler = nc().use( |
This file contains hidden or 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 hidden or 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 hidden or 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 { | |
location /sonarr { | |
proxy_pass http://localhost:8989/sonarr; | |
} | |
location /radarr { | |
proxy_pass http://localhost:7878/radarr; | |
} | |
location /jackett { |
This file contains hidden or 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 |
This file contains hidden or 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 | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
This file contains hidden or 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
class ChangeCollationDbWide < ActiveRecord::Migration[5.2] | |
def change | |
db = ActiveRecord::Base.connection | |
tables = ActiveRecord::Base.connection.tables.map { |t| t.to_sym } | |
tables.each do |t| | |
Lhm.change_table(t) do |table| | |
table.ddl "ALTER TABLE `#{table.name}` DEFAULT CHARACTER SET utf8mb4, DEFAULT COLLATE utf8mb4_unicode_ci" | |
end | |
end |
This file contains hidden or 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
FROM ruby:2.6-slim | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
curl \ | |
gnupg \ | |
git \ | |
# substitute 12.x with whichever Node version you require: | |
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \ | |
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ |
This file contains hidden or 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
// require('koa') or require('express') whatever fits your fancy | |
const { Connection } = require('./db'); | |
Connection.connectToMongo().then(() => { | |
// initialize your app and register routes | |
router.get('whatever', async(ctx) => { | |
const result = await Connection.db.collectionName.find({ id: ctx.params.id }); | |
ctx.res.body = result; | |
This file contains hidden or 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
FROM node | |
WORKDIR /app | |
ENV PATH /app/node_modules/.bin:$PATH | |
COPY package.json /app/package.json | |
RUN npm i | |
RUN npm i -g @angular/cli --unsafe |