Skip to content

Instantly share code, notes, and snippets.

View dinhnhatbang's full-sized avatar
😎
Cool

Bang Dinh dinhnhatbang

😎
Cool
  • LuaPOS
  • HCMC, Viet Nam
View GitHub Profile
FunctionA (var executionTimeInSecond) {
Sleep executionTimeInSecond
}
FunctionB (var executionTimeInSecond) {
Sleep executionTimeInSecond
}
@dinhnhatbang
dinhnhatbang / localgpt.py
Last active May 6, 2025 04:35
Local GPT
import os
import re
from langchain.chains import RetrievalQA
from langchain.embeddings import HuggingFaceInstructEmbeddings
from langchain.vectorstores import Chroma
from constants import EMBEDDING_MODEL_NAME
from chromadb.config import Settings
from langchain.llms import LlamaCpp
from prompt_template_utils import get_prompt_template
from transformers import GenerationConfig
@dinhnhatbang
dinhnhatbang / myself.md
Created May 23, 2021 06:22
About myself

I have many years of experiences in web application development and mobile application development. Possesses practical knowledge in system design and optimization for high-performance. Evaluate, monitor and enhance IT infrastructure with an emphasis on availability, reliability, scalability, security, data confidentiality and system integrity. A strong communicator with the ability to translate design requirements into actionable plans.

  • Programming languages: PHP, Python
  • Big data: AWS Glue, AWS EMR, PrestoDB, Apache Hive, Apache Spark, Alluxio
  • CI & CD: Terraform, Jenkins, AWS Cloudformation
  • Frontend: ReactJS, Bootstrap 4
  • Mobile: React Native
  • Others: Docker, RabbitMQ, OAuth 2.0, Linux
# Google ads
0.0.0.0 3ad.doubleclick.net
0.0.0.0 ad-emea.doubleclick.net
0.0.0.0 ad-g.doubleclick.net
0.0.0.0 ad-yt-bfp.doubleclick.net
0.0.0.0 ad.3au.doubleclick.net
0.0.0.0 ad.ae.doubleclick.net
0.0.0.0 ad.au.doubleclick.net
0.0.0.0 ad.be.doubleclick.net
@dinhnhatbang
dinhnhatbang / bash.js
Created March 18, 2021 08:37
Chọn ngày tốt xấu
import fetch from "node-fetch";
var start = new Date("2021-12-01"); //yyyy-mm-dd
var end = new Date("2021-12-31"); //yyyy-mm-dd
while (start <= end) {
var mm =
start.getMonth() + 1 >= 10
? start.getMonth() + 1
: "0" + (start.getMonth() + 1);
@dinhnhatbang
dinhnhatbang / get_barcode_from_image.js
Created December 22, 2020 02:37 — forked from tbtlr/get_barcode_from_image.js
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@dinhnhatbang
dinhnhatbang / pagination.html.twig
Created October 16, 2019 15:53 — forked from SimonSimCity/pagination.html.twig
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <simonsimcity@gmail.com>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@dinhnhatbang
dinhnhatbang / jenkins_nginx_ci.template.json
Created October 27, 2018 08:20 — forked from fabito/jenkins_nginx_ci.template.json
AWS Cloudformation template which creates a server based on Amazon Linux and automatically installs jenkins with nginx (working as a reverse proxy).
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation template to deploy jenkins/nginx.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "String",
from pyhive import presto
import requests
from requests.auth import HTTPBasicAuth
import pandas as pd
requests.packages.urllib3.disable_warnings()
req_kw = {
'auth': HTTPBasicAuth('the-user', 'the-password'),
'verify': '/path/to/cert.pem',
}
@dinhnhatbang
dinhnhatbang / Yii2Advanced.MD
Last active June 12, 2017 09:20
Yii2 Advanced
apt install php
apt install git
cd /home
git clone https://github.com/yiisoft/yii2-app-advanced.git
cd yii2-app-advanced/
apt-get install mariadb-server
mysql_install_db
service mysql start
/usr/bin/mysql_secure_installation