Skip to content

Instantly share code, notes, and snippets.

Avatar

hiepxanh hiepxanh

View GitHub Profile
@kgajera
kgajera / server.ts
Created May 25, 2020
Angular Express Server with Redis Caching
View server.ts
import 'zone.js/dist/zone-node';
import { APP_BASE_HREF } from '@angular/common';
import { ngExpressEngine } from '@nguniversal/express-engine';
import * as express from 'express';
import { existsSync } from 'fs';
import { join } from 'path';
import * as redis from 'redis';
import { AppServerModule } from './src/main.server';
@filimonov
filimonov / gist:691990c8e5ce901ca4734482c7cc81f9
Last active Oct 22, 2021
vscode + clickhouse-client: poorman integration
View gist:691990c8e5ce901ca4734482c7cc81f9
  1. File->Preferences->Settings terminal.integrated.scrollback, Increase the buffer size for terminal (i use 100000)

  2. File->Prefernces->Keyboard shortcuts workbench.action.terminal.runSelectedText set up some binding like Ctrl+Shift+'

  3. Open terminal window: Terminal->New Terminal

  4. Run clickhouse-client in a terminal.

@trihtm
trihtm / vietnam-banks
Created Dec 9, 2019
Vietnam Banks information format by json
View vietnam-banks
{
"banksnapas": [
{
"en_name": "An Binh Commercial Joint stock Bank",
"vn_name": "Ngân hàng An Bình",
"bankId": "970425",
"atmBin": "970425",
"cardLength": 16,
"shortName": "ABBank",
"bankCode": "323",
@kkrishnan90
kkrishnan90 / FirebasePhoneAuthIonicV3.md
Last active Sep 8, 2021
Firebase Phone Auth using Ionic V3 - Sending and reading OTP
View FirebasePhoneAuthIonicV3.md

General Steps to be followed as a flow process to complete Firebase Phone OTP Auth in Ionic V3

Step 1 : Get the phone number through input from the user. Step 2 : Pass this phone number to the firebase and receive a callback with verification ID. Step 3 : Pass on this verification ID through navParams to the next page where the user will enter the OTP sent to the entered mobile number. Step 4 : Verify the OTP that is sent with firebase for success() or failure() .

STEP 1 & 2 & 3

phone-verification.html

@GabrielUlici
GabrielUlici / webpack.config.js
Created Oct 8, 2017
ionic-angular@3.7.0 env fix
View webpack.config.js
var path = require('path');
var useDefaultConfig = require('@ionic/app-scripts/config/webpack.config.js');
var procEnv = process.env.IONIC_ENV;
module.exports = function () {
useDefaultConfig[procEnv].resolve.alias = {
"@app/env": path.resolve('./src/environments/environment' + (process.env.IONIC_ENV === 'prod' ? '' : '.' + process.env.IONIC_ENV) + '.ts')
};
@alpavlove
alpavlove / angular2_rxjs_dragabble.directive.ts
Created Mar 21, 2016
angular2 rxjs dragabble directive
View angular2_rxjs_dragabble.directive.ts
import { ElementRef, Directive, HostListener, Renderer } from 'angular2/core';
import { Subject } from 'rxjs';
@Directive({
selector: '[draggable]'
})
export class Draggable {
mousedrag;
mouseup = new Subject();
mousedown = new Subject();
@stormoz
stormoz / install.bat
Last active Feb 10, 2022
Start Selenium Grid hub and nodes as Windows services
View install.bat
nssm install SeleniumHub java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role hub
nssm start SeleniumHub
nssm install SeleniumNode1 java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exe
nssm set SeleniumNode1 DependOnService SeleniumHub
nssm start SeleniumNode1
nssm install SeleniumNode2 java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exe
nssm set SeleniumNode2 DependOnService SeleniumHub
nssm start SeleniumNode2
@iansltx
iansltx / _safari-iframe-cookie-workaround.md
Last active Dec 2, 2022
Safari iframe cookie workaround
View _safari-iframe-cookie-workaround.md
@jordangarcia
jordangarcia / jsbin.kubosudi.css
Created Jun 5, 2014
Example of drag and drop using Hammer.js
View jsbin.kubosudi.css
.box {
padding: 5px;
background: red;
margin: 10px;
position:relative;
z-index: 3;
}
.drag-target {
background: blue;
z-index: 1;
@pbojinov
pbojinov / README.md
Last active Oct 7, 2022
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/
View README.md

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe