Skip to content

Instantly share code, notes, and snippets.

View hiepxanh's full-sized avatar

hiepxanh hiepxanh

View GitHub Profile
@hiepxanh
hiepxanh / app.component.ts
Created July 16, 2018 01:57
firebase clould message
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { TabsPage } from '../pages/tabs/tabs';
import { FCM } from '@ionic-native/fcm';
import { ApiProvider } from '../providers/api/api';
@Component({
// from here:
// @HostListener('document:click', ['$event'])
// clickout(event) {
// console.log("target?",event.target);
// if(this.eRef.nativeElement.contains(event.target)) {
// console.log("clicked inside",event);
// } else {
// console.log("clicked outside",event);
@hiepxanh
hiepxanh / vscodeOpenFolder.reg
Created July 27, 2019 02:18
Visual Studio Code (VSCode) open Folder as Visual Code Project
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\hiepx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\hiepx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@hiepxanh
hiepxanh / fix-autofill-chrome.ts
Created August 6, 2019 07:08
Fix Auto Fill Chrome with Angular 8 and Ionic 4
// <ion-input (change)="fixAutoFill($event, 'password')" #passwordInput autocomplete="off" formControlName="password" type="password"></ion-input>
// <ion-input (change)="fixAutoFill($event, 'username')" #usernameInput autocomplete="off" type="text" formControlName="username"></ion-input>
fixAutoFill(event, type) {
const value = event.target.value;
if (type === 'username') {
this.loginForm.patchValue({
username: value
}, {emitEvent: true, onlySelf: false});
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text>Hello world &#10;</text>
<text>Hello&#10;</text>
<text>Hello&#10;</text>
<text>Hello&#10;</text>
<feed line="3"/>
<feed line="3"/>
<cut type="feed"/>
</epos-print>
@hiepxanh
hiepxanh / example width
Created June 28, 2020 10:40
EPSON RECEIPT PRINTER XML EXAMPLE
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<page>
<feed line="1"/>
<line x1="0" y1="30" x2="575" y2="30" style="thin"/>
<text>Single: Thin&#10;</text>
<feed line="1"/>
<line x1="0" y1="90" x2="575" y2="90" style="medium"/>
<text>Single: Medium&#10;</text>
<feed line="1"/>
<line x1="0" y1="150" x2="575" y2="150" style="thick"/>
<div class="popup-sub-advance" [formGroup]="subAdvanceForm">
<div class="popup-title">
Bookable Bussiness
<div class="popup-content">
In order to use <span class="text-bold">Book Bussiness</span>, you agree to pay the <span
class="text-bold">monthly</span> subscription fee of:
<div class="popup-price">
@hiepxanh
hiepxanh / cloudSettings
Last active January 19, 2021 13:32
Sync Hiep MOON
{"lastUpload":"2021-01-19T13:31:01.238Z","extensionVersion":"v3.4.3"}
dokku report reader-web
-----> uname: Linux awread-server 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
-----> memory:
total used free shared buff/cache available
Mem: 1995 395 1021 17 579 1456
Swap: 0 0 0
-----> docker version:
Client: Docker Engine - Community
Version: 20.10.6
API version: 1.41
# https://github.com/SocialEngine/docker-nginx-spa
# http://www.cicoria.com/forcing-tls-https-on-azure-web-apps-for-linux/
# https://github.com/GaryB432/angular-pwa/blob/master/nginx.conf
charset utf-8;
tcp_nopush on;
tcp_nodelay off;
client_header_timeout 10s;