Skip to content

Instantly share code, notes, and snippets.

minh.nguyen: Thông thường thì em sẽ follow theo (hầu hết) các bước sau:

  • RTFM.
  • Dựng và chạy hệ thống với các settings được recommend trong doc. Ví dụ Redis sẽ có sentinel hoặc Redis cluster hoặc standalone.
  • Explore tất cả các feature của system hoặc tất cả interface của library, nhất là những feature nào có vẻ fancy.
  • Build from source. Chạy lại bằng build object được sinh ra. Ngó thử xem hệ thống có bao nhiêu components, dependencies.
  • Đọc thử design doc nếu có
  • Debug thử xem giữa các component liên hệ với nhau như thế nào. Thông thường các hệ thống đều có doc.
  • Pick một flow đơn giản nhất, Tìm thử entrypoint trong code. Đặt debugger xem thử chạy ra sao.
  • Change thử một feature nho nhỏ xem thê nào
@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@huytd
huytd / .gitconfig
Created August 4, 2016 16:26
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
local wezterm = require 'wezterm'
local config = {}
if wezterm.config_builder then
config = wezterm.config_builder()
end
config.color_scheme = 'One Half Black (Gogh)'
config.font = wezterm.font 'Office Code Pro'

Screenshots:

image image image
@huytd
huytd / hiccup.vim
Last active October 14, 2023 03:51
My latest Vim config in Lua
" Hiccup Theme for Vim
" Author: Huy Tran
" License: BSD 3 Clauses
" Put this file to: colors/hiccup.vim
highlight clear
if exists('syntax_on')
syntax reset
endif
@huytd
huytd / tokyo-rs-simple-bot.js
Created October 12, 2023 07:50
Simple bot for tokyo-rs
const USERNAME = "rotate-bot";
const ws = require('ws');
const client = new ws(`wss://combat.sege.dev/socket?key=${USERNAME}&name=${USERNAME}`);
client.on('open', () => {
console.log('Connected!');
setInterval(() => {
client.send(JSON.stringify({
@huytd
huytd / todo.vim
Created June 14, 2020 07:34
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal
(defun read-journal (path)
(with-temp-buffer
(insert-file-contents (concat "~/notes/journal/" path))
(split-string (buffer-string) "\n" t)))
(defun read-first-three-lines (list)
(cond ((>= (length list) 4) (subseq list 1 3))
((>= (length list) 1) (nthcdr 1 list))
(t list)))