Skip to content

Instantly share code, notes, and snippets.

View phamducminh's full-sized avatar

Minh Pham phamducminh

View GitHub Profile
@phamducminh
phamducminh / remove_accents.py
Created April 27, 2023 15:02 — forked from J2TEAM/remove_accents.py
Remove Vietnamese Accents - Xoá dấu tiếng việt in Python
s1 = u'ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯưẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ'
s0 = u'AAAAEEEIIOOOOUUYaaaaeeeiioooouuyAaDdIiUuOoUuAaAaAaAaAaAaAaAaAaAaAaAaEeEeEeEeEeEeEeEeIiIiOoOoOoOoOoOoOoOoOoOoOoOoUuUuUuUuUuUuUuYyYyYyYy'
def remove_accents(input_str):
s = ''
print input_str.encode('utf-8')
for c in input_str:
if c in s1:
s += s0[s1.index(c)]
else:
s += c
@phamducminh
phamducminh / git-best-practices.md
Created May 18, 2022 16:14
Git Best Practices
@phamducminh
phamducminh / merge-request-guide.md
Last active May 18, 2022 16:13
Merge Request Guide

Merge Request Guideline

In order to improve code quality we have to follow merge request rule.

By Minh Pham, 2020

Dùng merge request cho các branch: develop, release_*

Để tăng chất lượng code sau khi tách business team thì codebase của android sẽ app dụng rule là phải tạo request merge và được accept bởi reviewer với yêu cầu theo bên dưới:

@phamducminh
phamducminh / git-workflow.md
Last active June 20, 2022 05:21
Git Workflow
@phamducminh
phamducminh / git-tutorial.md
Last active August 27, 2022 12:32
Git Tutorial

Git Tutorial

The purpose of this document is to guide the user on how to work with the Android git repository and git commands in general. This document is not meant to be a full git teaching tool, but more of a getting started guide.

By Minh Pham, 2020

Content

Yes Yes content
No No content

How to Use View Binding in Project

View Binding là gì

Thay thế findViewById bằng cách tạo ra binding object ứng với mỗi xml layout file.

image

Cách hoạt động của View Binding

public class NewIntentProcessor extends AbstractProcessor {
private static final String METHOD_PREFIX = "start";
private static final ClassName classIntent = ClassName.get("android.content", "Intent");
private static final ClassName classContext = ClassName.get("android.content", "Context");
private Filer filer;
private Messager messager;
private Elements elements;
private Map<String, String> activitiesWithPackage;