Skip to content

Instantly share code, notes, and snippets.

View hiepxanh's full-sized avatar

hiepxanh hiepxanh

View GitHub Profile
iansltx /
Last active April 7, 2024 15:44
Safari iframe cookie workaround
hanishi / index.tsx
Last active March 7, 2024 03:36
AutocompleteServer for ChatGPT
type CacheEntry<T> = {
value: T,
timeout: ReturnType<typeof setTimeout>,
class ExpiringCache<T> {
private readonly cache: Record<string, CacheEntry<T>>;
private readonly expirationTime: number;
constructor(expirationTime: number = 5000) {
filimonov / gist:691990c8e5ce901ca4734482c7cc81f9
Last active February 18, 2024 22:40
vscode + clickhouse-client: poorman integration
  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 / vietnam-banks
Created December 9, 2019 06:48
Vietnam Banks information format by json
"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",
pbojinov /
Last active December 8, 2023 21:09
Two way iframe communication- Check out working example here:

Two way iframe communication

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


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


kgajera / server.ts
Created May 25, 2020 22:44
Angular Express Server with Redis Caching
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';
shimondoodkin / WebKit contentEditable focus bug workaround.html
Created July 13, 2011 19:28
WebKit contentEditable focus bug workaround
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>WebKit contentEditable focus bug workaround</title>
<script type='text/javascript' src=''></script>
<script type='text/javascript'>
stormoz / install.bat
Last active February 10, 2022 08:57
Start Selenium Grid hub and nodes as Windows services
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\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\Selenium\chromedriver.exe
nssm set SeleniumNode2 DependOnService SeleniumHub
nssm start SeleniumNode2
kkrishnan90 /
Last active September 8, 2021 13:24
Firebase Phone Auth using Ionic V3 - Sending and reading OTP

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


jordangarcia / jsbin.kubosudi.css
Created June 5, 2014 22:04
Example of drag and drop using Hammer.js
.box {
padding: 5px;
background: red;
margin: 10px;
z-index: 3;
.drag-target {
background: blue;
z-index: 1;