Skip to content

Instantly share code, notes, and snippets.

View bdviett's full-sized avatar

Viet Bui Duc bdviett

View GitHub Profile
@bdviett
bdviett / crlf2lf
Created December 24, 2020 07:52
LF is God
Sử dụng kiểu xuống dòng LF thay vì CRLF trong Git
Không ít lần project có cấu hình eslint gặp lỗi Expected linebreaks to be 'LF' but found 'CRLF'. Lỗi này thực sự dẫn đến sự bế tắc khi lần đầu gặp phải. Tại sao lập trình trên windows cứ hay gặp mấy vấn đề dễ gây bối rối như vậy? Shit… chê tí thôi chứ dùng MacOS hay Linux thì đừng mơ chơi đc PUBG Mobile giả lập.
git config --global core.autocrlf false
git config --global core.eol lf
Gõ 2 dòng lệnh trên vào bất cứ CLI tool nào bạn có (powershell, cmd, terminal…). Done!
Giải ngố 1 chút:
core.autocrlf là để tự động sử dụng CRLF cho các file mới được tạo hoặc sau khi git add
## Mô tả
Xây dựng trang web quản lý timesheet với các mô tả nghiệp vụ như sau:
1.1, Có 2 loại người dùng cơ bản: quản trị viên và nhân viên
1.2, Mỗi timesheet có các nội dung như sau:
- Ngày (ví dụ 2018-08-14)
- Các công việc đã làm trong ngày (multiple line). Mỗi line có dạng:
- Task ID (nếu không có thì để là "N/A")
Preferences > General > Edittor > AnyEdit Tools: unchecked 5 options in Auto-Convert > Before edditor buffer will be saved
Preferences > Ant > Editor > Content Assist > checked "Insert single proposals automatically"
@bdviett
bdviett / cmder-in-webstorm.md
Created October 8, 2020 02:23 — forked from sadikaya/cmder-in-webstorm.md
Cmder inside Webstorm terminal
  1. Set an environment variable called CMDER_ROOT to your root Cmder folder (in my case C:\Program Files (x86)\Cmder). It seems to be important that this does not have quotes around it because they mess with concatenation in the init script.
  2. In your IntelliJ terminal settings, use "cmd" /k ""%CMDER_ROOT%\vendor\init.bat"" as the Shell path. The double-double-quotes are intentional, as they counteract the missing double quotes in the environment variable.
@bdviett
bdviett / docker exec -it my-container bash
Created September 28, 2020 02:07
docker exec -it my-container bash
Docker for Windows + Git for Windows環境で、dockerコンテナに入るために、docker execコマンドを実行すると、以下のエラーとなった。
$ docker exec -it my-container bash
the input device is not a TTY.
If you are using mintty, try prefixing the command with 'winpty'
winptyをつければエラーとならずにコンテナに入ることができる。
$ winpty docker exec -it my-container bash
bash-4.2#
@bdviett
bdviett / ContextCmder-Disable.reg
Created September 28, 2020 02:03 — forked from jojobyte/ContextCmder-Disable.reg
Cmder Context (Right-Click) Menu for Windows 7, 8 & 10
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@bdviett
bdviett / Free O'Reilly Books.md
Created July 16, 2018 10:20 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.