Skip to content

Instantly share code, notes, and snippets.

View honghuynhit's full-sized avatar
🇻🇳
Working from home

Huynh H. Dinh honghuynhit

🇻🇳
Working from home
View GitHub Profile
@honghuynhit
honghuynhit / shopee_user_action.py
Created April 3, 2024 13:24
Vũ điệu click chuột Shopee
import random
import datetime
def remove_accents(input_str):
import unicodedata
nfkd_form = unicodedata.normalize('NFKD', input_str)
return u"".join([c for c in nfkd_form if not unicodedata.combining(c)])
def replace_space_and_remove_accent(text):
@honghuynhit
honghuynhit / gist:dbc1692ed2d9c30eec08d3ad88a4a97a
Last active December 14, 2023 18:22
Install GnuWin32.Make for windows
On windows 10 or 11, you can run the command winget install GnuWin32.Make in the command line or
powershell to quickly install it. Than you can use the command make.
p.s.:
You might have to add C:\Program Files (x86)\GnuWin32\bin to the windows environmental variable PATH
to enable quick access to the command (thanks for the JobaDiniz on this note).
There is no need to install choco anymore.
Link: https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows#:~:text=On%20windows%2010,install%20choco%20anymore.
@honghuynhit
honghuynhit / gist:fc55666faf753a155960507ad516746d
Last active August 30, 2023 16:29
Import all models in Django shell of all apps

--> After open Django shell

from django.apps import apps
for _class in apps.get_models():
  if _class.__name__.startswith('Historycal'):
    continue
  globals()[_class.__name__] = _class
@honghuynhit
honghuynhit / nginx.conf
Created July 18, 2022 03:45 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
version: '3.8'
services:
postgresql:
image: 'postgres:latest'
ports:
- 5432:5432
environment:
POSTGRES_USER: username # The PostgreSQL user (useful to connect to the database)
POSTGRES_PASSWORD: password # The PostgreSQL password (useful to connect to the database)
@honghuynhit
honghuynhit / rabbitmq-docker-compose.yml
Created November 16, 2021 02:45
RabbitMQ Docker Compose
version: "3.8"
services:
rabbitmq3:
container_name: rabbitmq-data
image: rabbitmq:3.8-management-alpine
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=admin
- TZ=Asia/Ho_Chi_Minh
volumes:
@honghuynhit
honghuynhit / post_file_on_microservice.py
Last active June 15, 2022 09:24
[FASTAPI]: Post File qua lại giữa các api trong
# Request:
thumb=Form(..., description='thumb'),
# Nhận request và chỉnh sửa lại file
up = {'thumb': (str(thumb.filename), await thumb.read())}
# Gửi qua api,
response = requests.post('url-endpoint',
data=data, files=up
)
@honghuynhit
honghuynhit / Bias.md
Created October 12, 2021 17:35 — forked from tuan3w/Bias.md
Thiên kiến/Thiên Vị (Bias)

Cập nhật (12/10/2021): Bản ghi chú này có sai lệch, nhất là về mental models. Mental models không chỉ là sai lệch trong lĩnh vực tâm lý (được đề cập chủ yếu trong nội dung này) mà là nhóm công cụ tư duy tổng quát (meta skill). Gần đây, tình cờ mình được biết về một ngôi trường được Elon Musk đầu tư nhằm thay đổi cách học và tiếp cận hiện đại. Một trong đó có bao gồm dạy về mental models: Synthesis. Nguồn thông tin chính xác về đầy đủ nhất mọi người nên xem tại Mental Models: The Best Way to Make Intelligent Decisions (~100 Models Explained).

Thiên kiến/Thiên Vị (Bias)

Tự dưng muốn viết về chủ đề này nên viết cho vui. Dạo này, mình đọc nhiều sách về tâm lý. Vì lý do này đến lý do khác dẫn đến thấy thú vị về chủ đề này. Tiêu biểu nhất đó là thiên kiến/thiên vị (bias). Một chủ đề nghe chừng vô thưởng vô phạt. Nhưng sau thời gian tìm hiểu, mình khám phá ra nhiều điều thú vị liên quan đến nó. Thiên kiến ảnh hưởng đến bản thân mọi người nhiều h

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", updatable = false, nullable = false)
private Long id;
@Id
@Column(name = "id", updatable = false, nullable = false)
private Long id;