Skip to content

Instantly share code, notes, and snippets.

View lionxcr's full-sized avatar
🎯
Focusing

Paul Segura lionxcr

🎯
Focusing
  • lionX
  • United Arab Emirates
View GitHub Profile
@lionxcr
lionxcr / Async
Last active February 4, 2022 04:29
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)
}
}
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
const nodemailer = require('nodemailer');
const mailOptions = {
from: FROM,
to: TO,
subject: SUBJECT,
html: EMAIL_TEMPLATE
};
await sendMail(mailOptions);
'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)) {
<!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" />