-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abcff30
commit 494f0db
Showing
2 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"content":"","date":null,"permalink":"/posts/","section":"","summary":"","title":""},{"content":"","date":null,"permalink":"/","section":"João Thallis","summary":"","title":"João Thallis"},{"content":"This post is about how you can use Neovim to have refactoring tooling inspired in Refactoring and your tooling from Learn Go with tests.\nExtract/Inline #I am using refactoring.nvim plugin.\nExtract Variable #vim.keymap.set(\u0026#34;x\u0026#34;, \u0026#34;\u0026lt;leader\u0026gt;rv\u0026#34;, function() require(\u0026#39;refactoring\u0026#39;).refactor(\u0026#39;Extract Variable\u0026#39;) end) You need to select the part of your code that you want to extract to a variable and then press \u0026lt;leader\u0026gt;rv.\nMore about extract variable: https://refactoring.guru/extract-variable\nInline Variable #vim.keymap.set({ \u0026#34;n\u0026#34;, \u0026#34;x\u0026#34; }, \u0026#34;\u0026lt;leader\u0026gt;ri\u0026#34;, function() require(\u0026#39;refactoring\u0026#39;).refactor(\u0026#39;Inline Variable\u0026#39;) end) It\u0026rsquo;s the inverse of extract variable. It will remove the variable and replace it with its value.\nExtract Method #vim.keymap.set(\u0026#34;x\u0026#34;, \u0026#34;\u0026lt;leader\u0026gt;re\u0026#34;, function() require(\u0026#39;refactoring\u0026#39;).refactor(\u0026#39;Extract Function\u0026#39;) end) Rename #Here my goal is to rename symbols accross the codebase. It is possible to achieve this using Language Server Protocol as demonstrated by mjlbach in this issue comment if the LSP support it.\nI am using lsp-zero with default keymaps. To rename I need to use the F2 key. For go using go using gopls it is working to rename accross the codebase.\nlocal lsp = require(\u0026#34;lsp-zero\u0026#34;) lsp.on_attach(function(client, bufnr) lsp.default_keymaps({buffer = bufnr}) end) Format #I am using lsp-zero:\nlocal lsp = require(\u0026#34;lsp-zero\u0026#34;) lsp.format_on_save({servers = {[\u0026#34;gopls\u0026#34;] = {\u0026#39;go\u0026#39;}}}) Testing #I am using vim-test plugin to run tests.\nvim.cmd([[ let g:test#echo_command = 0 let test#python#runner = \u0026#39;pytest\u0026#39; if exists(\u0026#39;$TMUX\u0026#39;) let g:test#preserve_screen = 1 let g:test#strategy = \u0026#39;vimux\u0026#39; endif nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;t :TestNearest\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;T :TestFile\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;a :TestSuite\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;l :TestLast\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;g :TestVisit\u0026lt;CR\u0026gt; ]]) View Function Signature #I am using LSP for that, when I am in a function I can press K to see the function signature and when I am writing a function I can see the signature of the function I am calling.\nView Function Definition #I am using LSP for that, when I am in a function I can press gd to go to the definition of the function. I can use Ctrl-o to go back.\nFind Usage of a Symbol #I am using LSP for that, when I am in a symbol I can press gr to see the usages of the symbol.\n","date":"25 April 2024","permalink":"/posts/refactoring-using-neovim/","section":"","summary":"This post is about how you can use Neovim to have refactoring tooling inspired in Refactoring and your tooling from Learn Go with tests.","title":"Refactoring Using Neovim"},{"content":"I was having this issue when I was running the container.\nSolution if you are using colima to run Docker containers #colima start --arch aarch64 --vm-type=vz --vz-rosetta Thanks Felix Rabe for the answer.\n","date":"14 July 2023","permalink":"/posts/how-to-run-mssql-docker-image-on-apple-silicon/","section":"","summary":"I was having this issue when I was running the container.","title":"How to Run mssql Docker Image on Apple Silicon"},{"content":"It will be served inside the tailnet, as example I am using this blog.\nFor it, you will need to install hugo and tailscale.\nTo serve:\ngit clone [email protected]:joaothallis/joaothallis.github.io.git cd joaothallis.github.io hugo serve \u0026amp; sudo tailscale serve tcp:1313 tcp://127.0.0.1:1313 # to get the URL tailscale serve status | head -1 | grep -oP \u0026#34;(?\u0026lt;=tcp://)[^ ]+\u0026#34; Now with the URL you can access it in any device inside the tailnet.\nTo stop serving:\nsudo tailscale serve tcp:1313 tcp://127.0.0.1:1313 off kill hugo ","date":"23 May 2023","permalink":"/posts/serving-web-server-using-tailscale/","section":"","summary":"It will be served inside the tailnet, as example I am using this blog.","title":"Serving Web Server Using Tailscale"},{"content":"I am following the book Make: Learn Electronics with Arduino to learn electronics.\nWe are going to use an Arduino Uno to learn electronics. We will need some parts and tools to start.\nArduino Uno Parts List # Breadboard USB A-B cable 9-volt battery 9-12-volt power supply 9-volt battery cap or holder Assorted LEDS, a variety of colors Assorted resistors 10K potentiometer 3 momentary switches/buttons Photoresistor Speaker, 8 ohm 2 servo motors Jumper wires Tools # Digital multimeter with removable leads, and that is is fused Needle-nose pliers Wire strippers ","date":"26 April 2023","permalink":"/posts/parts-and-tools-to-learn-electronics-with-arduino/","section":"","summary":"I am following the book Make: Learn Electronics with Arduino to learn electronics.","title":"Parts and Tools to Learn Electronics With Arduino"},{"content":" Install node_exporter brew install node_exporter Start node_exporter brew services start node_exporter Now you can see the logs at localhost:9100/metrics open -n -a Safari localhost:9100/metrics ","date":"27 March 2023","permalink":"/posts/up-and-running-prometheus-node-exporter-on-macos/","section":"","summary":" Install node_exporter brew install node_exporter Start node_exporter brew services start node_exporter Now you can see the logs at localhost:9100/metrics open -n -a Safari localhost:9100/metrics ","title":"Up and Running Prometheus node_exporter on macOS"},{"content":" Install node_exporter sudo apt install prometheus-node-exporter Start node_exporter sudo service prometheus-node-exporter start Now you can see the logs at localhost:9100/metrics export DISPLAY=:0 export BROWSER=/usr/bin/wslview open localhost:9100/metrics ","date":"16 December 2022","permalink":"/posts/up-and-running-prometheus-node-exporter-on-wsl/","section":"","summary":" Install node_exporter sudo apt install prometheus-node-exporter Start node_exporter sudo service prometheus-node-exporter start Now you can see the logs at localhost:9100/metrics export DISPLAY=:0 export BROWSER=/usr/bin/wslview open localhost:9100/metrics ","title":"Up and Running Prometheus node_exporter on WSL"},{"content":"I am a Python and Elixir backend software developer with a strong experience building resilient and distributed systems, passionate about discovering new and innovative solutions designed to improve experience with technology while helping business grow.\nI have experience using tools such as Postgres, Docker and Kubernetes. I am also interested in DevOps to optimize the company\u0026rsquo;s multiple processes through automation. I\u0026rsquo;m enthusiastic about self-teaching myself about new concepts creating things.\nWhile not working on my daily job, I may be hacking on open source, reading books, creating music, writing about topics that interest me or playing some game (Magic: The Gathering Arena and Call of Duty: Warzone).\nI am interested in programming languages, neovim, monitoring and audiovisual. Feel free to ping me somewhere if you want to chat about any of that. 🐈\n","date":"1 January 0001","permalink":"/about/","section":"João Thallis","summary":"I am a Python and Elixir backend software developer with a strong experience building resilient and distributed systems, passionate about discovering new and innovative solutions designed to improve experience with technology while helping business grow.","title":"About"},{"content":"","date":null,"permalink":"/categories/","section":"Categories","summary":"","title":"Categories"},{"content":"","date":null,"permalink":"/tags/","section":"Tags","summary":"","title":"Tags"}] | ||
[{"content":"","date":null,"permalink":"/posts/","section":"","summary":"","title":""},{"content":"","date":null,"permalink":"/","section":"João Thallis","summary":"","title":"João Thallis"},{"content":"This post is about how you can use Neovim to have refactoring tooling inspired in Refactoring and your tooling from Learn Go with tests.\nExtract/Inline #I am using refactoring.nvim plugin.\nExtract Variable #vim.keymap.set(\u0026#34;x\u0026#34;, \u0026#34;\u0026lt;leader\u0026gt;rv\u0026#34;, function() require(\u0026#39;refactoring\u0026#39;).refactor(\u0026#39;Extract Variable\u0026#39;) end) You need to select the part of your code that you want to extract to a variable and then press \u0026lt;leader\u0026gt;rv.\nMore about extract variable: https://refactoring.guru/extract-variable\nInline Variable #vim.keymap.set({ \u0026#34;n\u0026#34;, \u0026#34;x\u0026#34; }, \u0026#34;\u0026lt;leader\u0026gt;ri\u0026#34;, function() require(\u0026#39;refactoring\u0026#39;).refactor(\u0026#39;Inline Variable\u0026#39;) end) It\u0026rsquo;s the inverse of extract variable. It will remove the variable and replace it with its value.\nExtract Method #vim.keymap.set(\u0026#34;x\u0026#34;, \u0026#34;\u0026lt;leader\u0026gt;re\u0026#34;, function() require(\u0026#39;refactoring\u0026#39;).refactor(\u0026#39;Extract Function\u0026#39;) end) Rename #Here my goal is to rename symbols accross the codebase. It is possible to achieve this using Language Server Protocol as demonstrated by mjlbach in this issue comment if the LSP support it.\nI am using lsp-zero with default keymaps. To rename I need to use the F2 key. For go using go using gopls it is working to rename accross the codebase.\nlocal lsp = require(\u0026#34;lsp-zero\u0026#34;) lsp.on_attach(function(client, bufnr) lsp.default_keymaps({buffer = bufnr}) end) Run Format and Goimports on Save #Using lsp-zero #-- Run gofmt/gofmpt, import packages automatically on save vim.api.nvim_create_autocmd(\u0026#39;BufWritePre\u0026#39;, { group = vim.api.nvim_create_augroup(\u0026#39;setGoFormatting\u0026#39;, { clear = true }), pattern = \u0026#39;*.go\u0026#39;, callback = function() local params = vim.lsp.util.make_range_params() params.context = { only = { \u0026#34;source.organizeImports\u0026#34; } } local result = vim.lsp.buf_request_sync(0, \u0026#34;textDocument/codeAction\u0026#34;, params, 2000) for _, res in pairs(result or {}) do for _, r in pairs(res.result or {}) do if r.edit then vim.lsp.util.apply_workspace_edit(r.edit, \u0026#34;utf-16\u0026#34;) else vim.lsp.buf.execute_command(r.command) end end end vim.lsp.buf.format() end }) Testing #I am using vim-test plugin to run tests.\nvim.cmd([[ let g:test#echo_command = 0 let test#python#runner = \u0026#39;pytest\u0026#39; if exists(\u0026#39;$TMUX\u0026#39;) let g:test#preserve_screen = 1 let g:test#strategy = \u0026#39;vimux\u0026#39; endif nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;t :TestNearest\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;T :TestFile\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;a :TestSuite\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;l :TestLast\u0026lt;CR\u0026gt; nmap \u0026lt;silent\u0026gt; \u0026lt;leader\u0026gt;g :TestVisit\u0026lt;CR\u0026gt; ]]) View Function Signature #I am using LSP for that, when I am in a function I can press K to see the function signature and when I am writing a function I can see the signature of the function I am calling.\nView Function Definition #I am using LSP for that, when I am in a function I can press gd to go to the definition of the function. I can use Ctrl-o to go back.\nFind Usage of a Symbol #I am using LSP for that, when I am in a symbol I can press gr to see the usages of the symbol.\n","date":"25 April 2024","permalink":"/posts/refactoring-using-neovim/","section":"","summary":"This post is about how you can use Neovim to have refactoring tooling inspired in Refactoring and your tooling from Learn Go with tests.","title":"Refactoring Using Neovim"},{"content":"I was having this issue when I was running the container.\nSolution if you are using colima to run Docker containers #colima start --arch aarch64 --vm-type=vz --vz-rosetta Thanks Felix Rabe for the answer.\n","date":"14 July 2023","permalink":"/posts/how-to-run-mssql-docker-image-on-apple-silicon/","section":"","summary":"I was having this issue when I was running the container.","title":"How to Run mssql Docker Image on Apple Silicon"},{"content":"It will be served inside the tailnet, as example I am using this blog.\nFor it, you will need to install hugo and tailscale.\nTo serve:\ngit clone [email protected]:joaothallis/joaothallis.github.io.git cd joaothallis.github.io hugo serve \u0026amp; sudo tailscale serve tcp:1313 tcp://127.0.0.1:1313 # to get the URL tailscale serve status | head -1 | grep -oP \u0026#34;(?\u0026lt;=tcp://)[^ ]+\u0026#34; Now with the URL you can access it in any device inside the tailnet.\nTo stop serving:\nsudo tailscale serve tcp:1313 tcp://127.0.0.1:1313 off kill hugo ","date":"23 May 2023","permalink":"/posts/serving-web-server-using-tailscale/","section":"","summary":"It will be served inside the tailnet, as example I am using this blog.","title":"Serving Web Server Using Tailscale"},{"content":"I am following the book Make: Learn Electronics with Arduino to learn electronics.\nWe are going to use an Arduino Uno to learn electronics. We will need some parts and tools to start.\nArduino Uno Parts List # Breadboard USB A-B cable 9-volt battery 9-12-volt power supply 9-volt battery cap or holder Assorted LEDS, a variety of colors Assorted resistors 10K potentiometer 3 momentary switches/buttons Photoresistor Speaker, 8 ohm 2 servo motors Jumper wires Tools # Digital multimeter with removable leads, and that is is fused Needle-nose pliers Wire strippers ","date":"26 April 2023","permalink":"/posts/parts-and-tools-to-learn-electronics-with-arduino/","section":"","summary":"I am following the book Make: Learn Electronics with Arduino to learn electronics.","title":"Parts and Tools to Learn Electronics With Arduino"},{"content":" Install node_exporter brew install node_exporter Start node_exporter brew services start node_exporter Now you can see the logs at localhost:9100/metrics open -n -a Safari localhost:9100/metrics ","date":"27 March 2023","permalink":"/posts/up-and-running-prometheus-node-exporter-on-macos/","section":"","summary":" Install node_exporter brew install node_exporter Start node_exporter brew services start node_exporter Now you can see the logs at localhost:9100/metrics open -n -a Safari localhost:9100/metrics ","title":"Up and Running Prometheus node_exporter on macOS"},{"content":" Install node_exporter sudo apt install prometheus-node-exporter Start node_exporter sudo service prometheus-node-exporter start Now you can see the logs at localhost:9100/metrics export DISPLAY=:0 export BROWSER=/usr/bin/wslview open localhost:9100/metrics ","date":"16 December 2022","permalink":"/posts/up-and-running-prometheus-node-exporter-on-wsl/","section":"","summary":" Install node_exporter sudo apt install prometheus-node-exporter Start node_exporter sudo service prometheus-node-exporter start Now you can see the logs at localhost:9100/metrics export DISPLAY=:0 export BROWSER=/usr/bin/wslview open localhost:9100/metrics ","title":"Up and Running Prometheus node_exporter on WSL"},{"content":"I am a Python and Elixir backend software developer with a strong experience building resilient and distributed systems, passionate about discovering new and innovative solutions designed to improve experience with technology while helping business grow.\nI have experience using tools such as Postgres, Docker and Kubernetes. I am also interested in DevOps to optimize the company\u0026rsquo;s multiple processes through automation. I\u0026rsquo;m enthusiastic about self-teaching myself about new concepts creating things.\nWhile not working on my daily job, I may be hacking on open source, reading books, creating music, writing about topics that interest me or playing some game (Magic: The Gathering Arena and Call of Duty: Warzone).\nI am interested in programming languages, neovim, monitoring and audiovisual. Feel free to ping me somewhere if you want to chat about any of that. 🐈\n","date":"1 January 0001","permalink":"/about/","section":"João Thallis","summary":"I am a Python and Elixir backend software developer with a strong experience building resilient and distributed systems, passionate about discovering new and innovative solutions designed to improve experience with technology while helping business grow.","title":"About"},{"content":"","date":null,"permalink":"/categories/","section":"Categories","summary":"","title":"Categories"},{"content":"","date":null,"permalink":"/tags/","section":"Tags","summary":"","title":"Tags"}] |
Oops, something went wrong.