Skip to content

Instantly share code, notes, and snippets.

View hosjiu1702's full-sized avatar
🎯
Focusing

hosjiu hosjiu1702

🎯
Focusing
View GitHub Profile
@hosjiu1702
hosjiu1702 / solution.py
Last active January 6, 2021 12:47
Solution for problem 2 (FTech Interview)
"""
Author: hosjiu
Email: hosjiu1702@gmail.com
This python script is tested on Python 3.6.10 (on my local machine)
but it can still works for another python version >3.6
"""
from typing import List
from collections import namedtuple
@hosjiu1702
hosjiu1702 / solution.py
Created January 6, 2021 07:35
Solution for problem 5 (FTech Interview)
"""
Author: hosjiu
Email: hosjiu1702@gmail.com
This python script is tested on Python 3.6.10 (on my local machine)
but it can still works for another python version >3.6
"""
from typing import List
@hosjiu1702
hosjiu1702 / reconnect.js
Created December 1, 2017 01:29
Reconnect to MySQL Server when it was disconnected incidentally (Thanks to post @flaxbrane at issue https://github.com/mysqljs/mysql/issues/1478)
//- MYSQL Module
try{
var mysql_npm = require('mysql');
}catch(err){
console.log("Cannot find `mysql` module. Is it installed ? Try `npm install mysql` or `npm install`.");
}
//- Connection configuration
var db_config = {
host : 'localhost',