Skip to content

Instantly share code, notes, and snippets.

View ngnam's full-sized avatar

Nguyen Van Nam ngnam

View GitHub Profile
@ngnam
ngnam / gh-pages-deploy.md
Created September 16, 2020 14:20 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@ngnam
ngnam / angular-cli-node-js-typescript-support.csv
Last active March 28, 2022 17:28 — forked from LayZeeDK/angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Angular CLI, Angular, Node.js and TypeScript compatibility.
Angular CLI version Angular version Node.js version TypeScript version
- 2.x 6.0.x or later minor version 2.0.x
1.0.6 4.x 6.9.x or later minor version 2.2.x
1.1.3 4.x 6.9.x or later minor version 2.3.x
1.2.7 4.x 6.9.x or later minor version 2.3.x
1.3.2 4.2.x or later minor version 6.9.x or later minor version 2.4.x
1.4.10 4.2.x or later minor version 6.9.x/8.9.x or later minor version 2.4.x
(1.5.6) 5.0.x 6.9.x/8.9.x or later minor version 2.4.x
1.5.6 5.1.x 6.9.x/8.9.x or later minor version 2.5.x
1.6.7 5.2.x or later minor version 6.9.x/8.9.x or later minor version 2.5.x
@ngnam
ngnam / meta-tags.md
Created July 21, 2020 10:07 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
<title>Loạt lời phê đầy tính 'cà khịa' của thầy cô</title>
<meta name="description" content="Ngày nay, thầy cô không còn là những giáo viên khó tính mà cũng 'lầy lội' không kém học sinh."/>
<meta name="keywords" content="lời phê, giáo viên, cà khịa, vui tính, hài hước"/>
<meta name="news_keywords" content="lời phê, giáo viên, cà khịa, vui tính, hài hước"/>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5, user-scalable=1" name="viewport"/>
<meta http-equiv="X-UA-Compatible" content="IE=100"/>
<meta property="fb:app_id" content="1547540628876392"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-title" content="Vnexpress.net"/>
import {
Directive,
Output,
HostListener,
Input,
OnDestroy,
OnInit,
EventEmitter
} from "@angular/core";
import { Subject, interval, combineLatest } from "rxjs";
@ngnam
ngnam / checkbox click.js
Created December 15, 2019 16:51
checkbox click.js
(function test() {
// một số hàm truy xuất DOM trên browserm get element, finder, children, parent,...
var htmlCollection = document.getElementsByClassName('questions-list' ;
var arrCollection = [];
// tìm hiểu apply funciton trong javascript la gì.
[].push.apply(arrCollection, htmlCollection);
// foreach là gì
arrCollection.forEach(function(item) {
if (!item) {
License: R J van der Linden
Key: CN9X-US28-F6RR-EY9M-YTQC
// password.validator.ts
import { FormControl } from '@angular/forms';
export interface ValidationResult {
[key: string]: boolean;
}
export class PasswordValidator {
public static strong(control: FormControl): ValidationResult {
const hasNumber = /(?=\D*\d)/.test(control.value);