This file contains hidden or 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
var urlParams = new URLSearchParams(window.location.search); | |
console.log(urlParams.has('post')); // true | |
console.log(urlParams.get('action')); // "edit" | |
console.log(urlParams.getAll('action')); // ["edit"] | |
console.log(urlParams.toString()); // "?post=1234&action=edit" | |
console.log(urlParams.append('active', '1')); // "? |
This file contains hidden or 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
/^(\d{1,2}\/\d{1,2}\/\d{4})$/.test(date.toLocaleDateString()) | |
/^\d+(\.\d{2})$/ |
This file contains hidden or 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
<div (scroll)="onScroll($event)"> | |
... | |
... | |
</div> | |
import { Component, HostListener } from '@angular/core'; | |
... | |
... |
This file contains hidden or 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
document.fonts.ready.then(function () { | |
// alert('All fonts in use by visible text have loaded.'); | |
alert('like-note-font loaded ?: ' + document.fonts.check('1em like-note-font')); // true | |
}); |
This file contains hidden or 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
^\(?([0-9]{3})\)?[-. ]?([0-9]{2})[-. ]?([0-9]{2})[-. ]?([0-9]{2})$ |
This file contains hidden or 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
https://stackoverflow.com/questions/33924655/position-last-flex-item-at-the-end-of-container | |
.container { | |
display: flex; | |
width: 100%; | |
border: 1px solid #000; | |
} | |
p { | |
height: 50px; |
This file contains hidden or 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
<iframe type="text/html" | |
width="640" | |
height="360" | |
src="https://www.youtube.com/embed/h4mc7ibxdTQ?enablejsapi=1&autoplay=1&loop=1&playlist=h4mc7ibxdTQ" | |
frameborder="0" | |
allowfullscreen></iframe> | |
<iframe class="embed-responsive-item"id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/M7lc1UVf-VE?&autoplay=1&loop=1&rel=0&showinfo=0&color=white&iv_load_policy=3&playlist=M7lc1UVf-VE" | |
frameborder="0" allowfullscreen></iframe> |
This file contains hidden or 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
1. download tcpdf https://github.com/tecnickcom/tcpdf | |
2. add georgian specific font | |
3. run script below | |
Add specific font from cmd | |
need run php this [TCPDF/tools/tcpdf_addfont.php] file drom cmd | |
example: | |
php tcpdf_addfont.php -i C:\OSPanel\domains\localhost\pdf-generators\dm-niko-nikoladze.ttf | |
or |
This file contains hidden or 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
import { Request, Response, NextFunction } from 'express'; | |
import { verify, sign } from 'jsonwebtoken'; | |
import * as User from '../api/users/user.dao'; | |
import config from '../config/environment'; | |
import { roles } from '../constants/user'; | |
import { UnauthorizedError, ResourceNotFoundError, ValidationError } from '../errors'; | |
import * as cookie from 'cookie'; | |
export async function setUser(req: Request, res: Response, next: NextFunction) { |
This file contains hidden or 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
import { Express } from 'express'; | |
import compression from 'compression'; | |
import bodyParser from 'body-parser'; | |
import cookieParser from 'cookie-parser'; | |
import cors from '../config/cors'; | |
import ejs from 'ejs'; | |
import passport from 'passport'; | |
export function initExpress(app: Express) { | |
app.disable('x-powered-by'); |
NewerOlder