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:
1if poll(Duration::from_millis(10))? { 2 let event = read()?; 3 match event { 4 Event::Key(KeyEvent { 5 code, 6 state: _, 7 kind, 8 modifiers: _, 9 }) => { 10 if kind == KeyEventKind::Press { 11 let mut tetromino = self.current_tetromino.clone(); 12 match code { 13 KeyCode::Char('h') | KeyCode::Left => { 14 tetromino.move_left(self, stdout)?; 15 self.current_tetromino = tetromino; 16 }