Hi there

Senior Software Engineer

Testando Smocker

No post de hoje irei demonstrar uma ferramenta interessante que descobri nas minhas leituras diárias de newsletters. Como ele se descreve, é um servidor de mock HTTP simples e eficiente. O objetivo Trata-se do Smocker, que você pode conferir o projeto no Github: Thiht/smocker. Seu backend é escrito em Go e seu front-end é feito com React com Typescript. Para instalá-lo no meu computador, eu utilizei Docker docker run -d \ --restart=always \ -p 8080:8080 \ -p 8081:8081 \ --name smocker \ thiht/smocker Ele abre duas portas com o host, a 8080 que é a porta do servidor em si, e que você usará nos seus testes e a 8081 que é a UI....

August 23, 2020

Migrating blog to hugo

Na última semana resolvi migrar meu site pessoal para o Hugo. Há bastante tempo vinha pensando em substituir o Jekyll. O processo de migração foi simples pois possuo poucos artigos no blog. Porém se tivesse mais artigos provavelmente essa migração seria mais trabalhosa. Para executar localmente foi bem simples pois utilizei Docker. docker run --rm -it \ -v $(pwd):/src -p 1313:1313 \ peaceiris/hugo serve --bind 0.0.0.0 O deploy é feito no Netlify e todo o código fonte pode ser encontrado no repositório do meu perfil no Github....

August 21, 2020

Instalando deno com proxy no Windows

Na última semana foi lançado o novo runtime de javascript e typescript, o Deno. Para instalar no Windows, execute o seguinte comando: iwr https://deno.land/x/install/install.ps1 -useb | iex Porém se você está em uma rede corporativa com proxy, provavelmente não conseguirá executar esse comando. Portanto é necessário instruir o comando Invoke-WebRequest para usar as configurações de proxy. iwr -Proxy http://endereco-do-proxy:porta -ProxyUseDefaultCredentials https://deno.land/x/install/install.ps1 -useb | iex

May 18, 2020

Building multi stage docker image for node app

Today I’m going to share a very helpful tip to build smaller docker images. Whenever I can, I look to build small docker images to run my containers. When building a node application, for the most cases you can use the alpine version. The default version is 10x larger than the alpine version. node 11 4e4c445311e6 21 hours ago 894MB node 11-alpine 4b3c025f5508 21 hours ago 71.3MB But the default version contains python, that is required to build some dependencies....

November 3, 2018

Dockerized commands - Part 2

On the last post ({% post_url 2017-12-16-dockerized-commands %}), we learned how to run npm commands dockerized. But there is a little issue with that command. I tried to run yarn with the dockerized node, but I got the following error: "exec: \"yarn\": executable file not found in $PATH" The issue is, the yarn binary is on /opt folder, the same folder we were mouting and it was conflicting with the original content of the folder....

December 24, 2017

Dockerized commands

Today I will share a quick tip to improve your workflow. In the last years, the docker has gained so much popularity. As a trend, some people tend to run the applications in docker containers instead of on the host machine. After formatting my computer, I hadn’t installed all the tools I use on my development workflow and I needed to install the npm dependencies of my project. I hadn’t installed the node and npm yet, so I decided to run npm install with docker...

December 16, 2017

Updating git submodule

Today, after 8 months of inactivity, I’m writing a new blog post. Today I’m going to share a quick but very useful command snippet. If you have git project with submodules, from time to time, you may need to update the submodule’s repository to the latest commit. git submodule foreach git pull origin master It will visit every submodule on your project and update them to the master branch’s lastest commit....

December 22, 2016

Quick tips I - Terminal

Hello everyone, I’m back to share with you some quick tips for terminal that helps a lot in our today workflow on the terminal. If you, like the most developers use the terminal for every two tasks on the computer, it will probably come in handy. Sometimes you need the create a new directory and immediately cd into it: mkdir caique && cd $_ Sometime you enter a command but it requires sudo permission: vim /etc/hosts If you try to save a change to your hosts file:...

April 22, 2016

Vagrant Error - Http server doesn't seem to support byte ranges

Hey guys, I’m back to share with you a solution for an error that occured to me today. I was upgrading one of my vagrant boxes but the computer shut down before the download it is finished. When I turned the computer on again and tried to resume the vagrant box download, I started getting the following error: After a quick search on StackOverflow, I got a solution: To remove the failed box download from the temporary folder on vagrant....

April 19, 2016

Lib da Semana - Select2

Essa semana começarei uma série de artigos apresentando bibliotecas e frameworks javascript e css. Nessa semana abordaremos sobre o Select2. Como a própria biblioteca javascript se define: Select2 é uma alternativa JQuery para os <select> do HTML. Permite você customizar os select boxes com suporte para busca, tokenização, dados remotos, scroll infinito entre outras características. Para utilizar essa biblioteca é necessário incluir os arquivos css e js na sua página. Que pode ser feito:...

March 27, 2016