Uses
2024-02-27
I found uses.tech and would like to add myself.
Hardware
- MacBook Pro (14-inch, 2021)
- Magic Keyboard
- Magic Mouse
- Nexstand K2 (to save my neck): https://www.youtube.com/watch?v=-fzlZAecI_4
- Raspberry Pi 4: host this website
Development
- Terminal: WezTerm
- Shell: fish shell
- Text Editor: Helix
Tools
- Git: lazygit, tig
- HTTP client: xh
- ls: exa
- cat: bat
- find: fd
- Search: ag
- Quick jump: zoxide
- Fuzzy finder: fzf
- Watch for changes: entr
- GitHub CLI: gh
- Container runtimes: colima
Integration testing TUI applications in Rust
2024-01-21
In building games with any language, there will be a loop to handle the key events. In case of crossterm, it’s event::read:
if poll(Duration::from_millis(10))? {
let event = read()?;
match event {
Event::Key(KeyEvent {
code,
state: _,
kind,
modifiers: _,
}) => {
if kind == KeyEventKind::Press {
let mut tetromino = self.current_tetromino.clone();
match code {
KeyCode::Char('h') | KeyCode::Left => {
tetromino.move_left(self, stdout)?;
self.current_tetromino = tetromino;
}
Quan Tong