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 dbConnection = new Promise((resolve, reject) => setTimeout(() => resolve(true), 500)) | |
const myFunction = async (req, res) => { | |
try { | |
const result = await dbConnection(); | |
// do something with result | |
} catch (e) { | |
console.error(e) | |
} | |
} |
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 sequelize = hook.app.get('sequelizeClient'); | |
const queryExample = ``` | |
UPDATE a | |
SET [Role]= 'Admin' | |
FROM UserRoles a | |
WHERE a.[Role]= 'Administrator' | |
AND NOT EXISTS | |
( | |
SELECT NULL | |
FROM dbo.UserRoles b |
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 nodemailer = require('nodemailer'); | |
const mailOptions = { | |
from: FROM, | |
to: TO, | |
subject: SUBJECT, | |
html: EMAIL_TEMPLATE | |
}; | |
await sendMail(mailOptions); |
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
'use strict'; | |
var getCircunference = function getCircunference(radius) { | |
return Math.round(2 * 3.14 * radius); | |
}; | |
var promiseFunction = function promiseFunction(radius) { | |
return new Promise(function (resolve, reject) { | |
var response = getCircunference(radius); | |
if (!isNaN(response)) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Hangar CL</title> | |
</head> | |
<body> | |
<script src="https://code.jquery.com/jquery.min.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> |