- Baltimore county
- US Navy
- Disney
- Microsoft
- Adobe
- npr
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
const {MongoClient} = require('mongodb'); | |
let db, posts; | |
async function init() { | |
let uri = process.env.URI | |
const client = await MongoClient.connect(uri, { useNewUrlParser: true, useUnifiedTopology: true }); | |
return await client.db('cms'); | |
} |
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
Show hidden characters
{ | |
"presets": ["@babel/preset-env", "@babel/preset-react"] | |
} |
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 = { | |
generateId: function() { | |
// Generate a semi-unique id | |
return '_' + Math.random().toString(36).substr(2, 9); | |
}, | |
byteToString: function(blob) { | |
// Turn an arraybuffer into a base64 string | |
return btoa(new Uint8Array(blob).reduce(function (data, byte) { | |
return data + String.fromCharCode(byte); | |
}, '')) |
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
const webpack = require('webpack'); | |
const path = require('path'); | |
const autoprefixer = require('autoprefixer'); | |
const cssnano = require('cssnano'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin') | |
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | |
module.exports = { |
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
const Discord = require('discord.js'); | |
... | |
const rss = require('./module.js'); | |
// Check for new youtube videos from a channel | |
client.setInterval(() => { | |
let guild = client.guilds.find(g => g.id === <guild_id>); //Or, let guild = client.guilds.find(g => g.name === <guild_name>); | |
let channel = guild.channels.find(ch => ch.name === <channel_name>); | |
rss.updateFeed(channel); |
NewerOlder