Loading...
More JavaScript Posts
const jwt = require("jsonwebtoken");const authToken = (req, res, next) => {const token = req.headers["x-auth-token"];try {req.user = jwt.verify(token, process.env.ACCESS_TOKEN_SECRET);next();} catch (err) {console.log(err.message);res.status(401).json({ msg: "Error authenticating token" });}};module.exports = authToken;
const getTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone;// ExamplegetTimezone();
function formatDate(date) {return date.toLocaleDateString();}function Comment(props) {return (<div className="Comment"><div className="UserInfo"><imgclassName="Avatar"src={props.author.avatarUrl}alt={props.author.name}/><div className="UserInfo-name">{props.author.name}</div></div><div className="Comment-text">{props.text}</div><div className="Comment-date">{formatDate(props.date)}</div></div>);}const comment = {date: new Date(),text: 'I hope you enjoy learning React!',author: {name: 'Hello Kitty',avatarUrl: 'https://placekitten.com/g/64/64',},};ReactDOM.render(<Commentdate={comment.date}text={comment.text}author={comment.author}/>,document.getElementById('root'));
# Acronyms## Computer Numerical Control (CNC)- Typicalldfdfsdffdafdasgfdgfgfdfdafdasfdafda
//Use at https://mee6.xyz/leaderboard/732262089447702588//Higher the spammy stat, the more spammy that person is.//This is because mee doesn't give experience to people who post more comments in a minute.function statBlock(title, value){let elm = document.createElement("div");elm.className = "leaderboardPlayerStatBlock";let titleElm = document.createElement("div");titleElm.className = "leaderboardPlayerStatName";titleElm.textContent = title;let valueElm = document.createElement("div");valueElm.className = "leaderboardPlayerStatValue";valueElm.textContent = value;elm.appendChild(titleElm);elm.appendChild(valueElm);elm.remove = function(){this.parentElement.removeChild(this);}return elm;}for(let player of Array.from(document.getElementsByClassName("leaderboardPlayer"))){if(player.spamminess) player.spamminess.remove();let messages = null;let experience = null;const statBlockArray = Array.from(player.querySelectorAll(".leaderboardPlayerStatBlock"));for(let statBlock of statBlockArray){const statName = statBlock.querySelector(".leaderboardPlayerStatName").textContent;const text = statBlock.querySelector(".leaderboardPlayerStatValue").textContent;const number = ((text.includes("k"))? (text.replace("k","") * 1000.0) : +(text));if(statName.includes("MESSAGES")){messages = number;}else if(statName.includes("EXPERIENCE")){experience = number;}}const stats = player.querySelector(".leaderboardPlayerStats");const messagesElement = stats.firstChild;const spamminess = ((messages/experience)*2000.0).toFixed(2);player.spamminess = stats.insertBefore(statBlock("SPAMMINESS", spamminess), messagesElement);}
"use strict";const nodemailer = require("nodemailer");// async..await is not allowed in global scope, must use a wrapperasync function main() {// Generate test SMTP service account from ethereal.email// Only needed if you don't have a real mail account for testinglet testAccount = await nodemailer.createTestAccount();// create reusable transporter object using the default SMTP transportlet transporter = nodemailer.createTransport({host: "smtp.ethereal.email",port: 587,secure: false, // true for 465, false for other portsauth: {user: testAccount.user, // generated ethereal userpass: testAccount.pass, // generated ethereal password},});// send mail with defined transport objectlet info = await transporter.sendMail({subject: "Hello ✔", // Subject linetext: "Hello world?", // plain text bodyhtml: "<b>Hello world?</b>", // html body});console.log("Message sent: %s", info.messageId);// Message sent: <[email protected]>// Preview only available when sending through an Ethereal accountconsole.log("Preview URL: %s", nodemailer.getTestMessageUrl(info));// Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...}main().catch(console.error);