const User = require('../model/User');
const bcrypt = require('bcrypt');
const handleNewUser = async (req, res) => {
const { user, pwd } = req.body;
if (!user || !pwd) return res.status(400).json({ 'message': 'Username and password are required.' });
// check for duplicate usernames in the db
const duplicate = await User.findOne({ username: user }).exec();
if (duplicate) return res.sendStatus(409); //Conflict
try {
//encrypt the password
const hashedPw
<div class="slider swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
</div>
<div class="swiper-pagination"></div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<div class="swiper-scrollbar"></div>
</div>
/**
* @param {string} s
* @param {string} t
* @param {number} maxCost
* @return {number}
*/
var equalSubstring = function(s, t, maxCost) {
// Initalize two pointers for the sliding window
let start = 0, end = 0;
// Iterate ove the string 's'
for (end = 0; end < s.length; end++) {
// Subtract the cost of changing s[end] to t[end] from maxCost
maxCost -= Math.abs(s.charCodeAt(end) - t.charCodeAt(end));
// If maxCost is negative, move the start pointer
<address class="footer__contacts-body">
<p>Email: <a href="mailto:info@positivus.com">info@positivus.com</a></p>
<p>Phone: <a href="tel:5555678901">555-567-8901</a></p>
<p>
Address: 1234 Main St<br />
Moonstone City, Stardust State 12345
</p>
</address>
import setCaretPosition from '/src/utils/setCaretPosition'
export default function(e) {
let pos = e.target.value.search(/.(?=[^\d]*$)/)
if (pos < 4) {
// !@note асинхронный обход бага vue-imask на safari 17.1 когда при первом фокусе на vue-imask он ставит курсор в конец инпута телефона
setTimeout(() => {
setCaretPosition(e.target, 4)
}, 1)
}
}
<button data-tippy-content="Tooltip">Text</button>
<label class="checkbox">
<input class="checkbox__input visually-hidden" name="checkbox-name" type="checkbox" value="" checked>
<span class="checkbox__emulator">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.5858 13.4142L7.75735 10.5858L6.34314 12L10.5858 16.2427L17.6568 9.1716L16.2426 7.75739L10.5858 13.4142Z" fill="currentColor"/></svg>
</span>
<span class="checkbox__label">Label</span>
</label>
<label class="check
<label class="radio">
<input class="radio__input visually-hidden" name="radio-name" type="radio" value="" checked>
<span class="radio__emulator"></span>
<span class="radio__label">Label</span>
</label>
<label class="radio">
<input class="radio__input visually-hidden" name="radio-name" type="radio" value="">
<span class="radio__emulator"></span>
<span class="radio__label">Label</span>
</label>
<label class="switch">
<input
class="switch__input visually-hidden"
name="switch-name"
type="checkbox"
value=""
checked
/>
<span class="switch__emulator"></span>
<span class="switch__label">Label</span>
</label>
<label class="switch">
<input
class="switch__input visually-hidden"
name="switch-name"
type="checkbox"
value=""
/>
<span class="switch__emulator"></span>
<span class="switch__label">Label</span>
</label>
<div class="tabs" data-tabs>
<h3 class="tabs__title" id="tabs-title">Title</h3>
<div class="tabs__buttons" role="tablist" aria-labelledby="tabs-title">
<button
class="tabs__button is-active"
id="tab-1"
type="button"
role="tab"
aria-controls="tabpanel-1"
aria-selected="true"
>
Tab
</button>
<button
class="tabs__button"
id="tab-2"
type="button"
role="tab"
aria-controls="tabpanel-2"
aria-selected="fals
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
//////Author Parameters - Show posts associated with certain author.
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,' //(int) - use author id [use minus (
public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}
$ git push clever main:master
$ clever deploy --alias production --force --verbose
<fieldset class="contact-us__request-types radios">
<legend class="radios__title visually-hidden">Request type</legend>
<label class="radios__item radio">
<input
class="radio__input visually-hidden"
name="request-type"
type="radio"
value="Say Hi"
checked=""
/>
<span class="radio__emulator"></span>
<span class="radio__label">Say Hi</span>
</label>
<label class="radios__item radio">
<input
class="radio__input visually-hidden"
na
<details class="accordion" open>
<summary class="accordion-header">
<h3 class="accordion-title">Consultation</h3>
<span class="accordion-indicator"></span>
</summary>
<div class="accordion-body">
<p>
During the initial consultation, we will discuss your business goals and
objectives, target audience, and current marketing efforts. This will
allow us to understand your needs and tailor our services to best fit your
requirements.
</p>
</div>
</detail
from pathlib import Path
def create_download_link(filename: str):
import base64
from IPython.display import HTML
# Read the file and encode it in base64
with open(filename, "rb") as read_file:
b64 = base64.b64encode(read_file.read()).decode()
# Create the download link
return HTML(f'<a download="{filename}" href="data:text/csv;base64,{b64}" target="_blank">Download {filename}</a>')
display(create_download_link(filename))
# APPLY THIS TO DL