inside your node.js file write
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'youremail@address.com',
pass: 'yourpassword'
}
});
We used gmail as our transport service.
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'youremail@address.com',
pass: 'yourpassword'
}
});
Nested arrays are turned into grouped lists (for bulk inserts), e.g.[['a', 'b'], ['c', 'd']]
turns into('a', 'b'), ('c', 'd')
var mysql = require('node-mysql');
var conn = mysql.createConnection({
...
});
var sql = "INSERT INTO Test (name, email, n) VALUES ?";
var values = [
['demian', 'demian@gmail.com', 1],
['john', 'john@gmail.com', 2],
['mark', 'mark@gmail.com', 3],
['pete', 'pete@gmail.com', 4]
];
conn.query(sql, [values], function(err) {
if (err) throw err;
conn.end();
});
values
is an array of arrays wrapped in an array[ [ [...], [...], [...] ] ]
optionSelected
event output:<mat-autocomplete (optionSelected)="onSelectionChanged($event)">
<mat-option *ngFor="let item of myItems" [value]="item">
{{ item }}
</mat-option>
</mat-autocomplete>
import { MatAutocompleteSelectedEvent } from '@angular/material';
// ...
onSelectionChanged(event: MatAutocompleteSelectedEvent) {
console.log(event.option.value);
}
ngOnInit() {
...
this.carsService.GetCarCompanies().subscribe((data: any) => {
this.carCompanies = [];
this.carCompaniesLowercase = [];
data.data.car_companies.forEach((row) => {
this.carCompanies.push(row.company_name);
this.carCompaniesLowercase.push(row.company_name.toLowerCase());
});
this.filteredCarCompanies = this.carTypeFormGroup.get('carCompany').valueChanges
.pipe(startWith(''), map(carCompany => carCompany ? this._filterCarCompanies(carCompany) : this.carCompanies.slice()));
});
IS NULL
operator, we can rely on the fact that IS NOT NULL
returns 1
when expression is NOT NULL, and 0
otherwise.SELECT * FROM user ORDER BY date_login IS NOT NULL, date_login DESC
!ISNULL()
is equivalent to IS NOT NULL
, so either one could be used.IS NULL
like so:SELECT * FROM user ORDER BY date_login IS NULL DESC, date_login DESC
+----+--------+------------+ | id | name | date_login | +----+--------+------------+ | 2 | john | NULL | | 1 | NULL | 2017-03-12 | | 4 | zayne | 2017-03-02 | | 3 | david | 2016-12-24 | +----+--------+------------+
isValid
:var end_date_moment, end_date;
jsonNC.end_date = jsonNC.end_date.replace(" ", "T");
end_date_moment = moment(jsonNC.end_date);
end_date = end_date_moment.isValid() ? end_date_moment.format("L") : "";
""
for the end_date
string if the date is invalid.https://stackoverflow.com/questions/77744344/is-it-okay-to-use-both-fetchpriority-high-and-loading-eager-in-img-tag Yes Fetchpriority and l...