<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Lucas Rafaldini</title>
    <description>The latest articles on Forem by Lucas Rafaldini (@lucasrafaldini).</description>
    <link>https://forem.com/lucasrafaldini</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F237370%2Fe6adbc1f-e7ae-4606-9b11-5edac4eb6e8f.jpeg</url>
      <title>Forem: Lucas Rafaldini</title>
      <link>https://forem.com/lucasrafaldini</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lucasrafaldini"/>
    <language>en</language>
    <item>
      <title>Conselhos para Startups</title>
      <dc:creator>Lucas Rafaldini</dc:creator>
      <pubDate>Mon, 27 Oct 2025 16:36:00 +0000</pubDate>
      <link>https://forem.com/lucasrafaldini/conselhos-para-startups-traducao-de-sam-altman-3i46</link>
      <guid>https://forem.com/lucasrafaldini/conselhos-para-startups-traducao-de-sam-altman-3i46</guid>
      <description>&lt;p&gt;&lt;strong&gt;post de 03/12/2013, por &lt;a href="https://blog.samaltman.com/startup-advice" rel="noopener noreferrer"&gt;Sam Altman&lt;/a&gt;&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tradução para o português por Lucas Rafaldini&lt;/em&gt;  &lt;/p&gt;




&lt;p&gt;Em homenagem à nova turma da Y Combinator que começa amanhã, aqui estão alguns dos melhores conselhos para startups que recebi ou dei (na maior parte, recebi):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Faça algo que as pessoas realmente queiram;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Uma ótima equipe e um ótimo mercado são igualmente criticamente importantes — você precisa dos dois. O debate sobre qual é mais importante é tolo;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Escreva código, converse com usuários e construa a empresa (contrate as melhores pessoas que puder, acerte na cultura, levante investimento, feche vendas, etc.). A maioria das outras coisas que fundadores fazem é perda de tempo;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Defina uma visão clara e fácil de entender para sua empresa e faça disso uma missão na qual as pessoas realmente acreditem;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mantenha o foco e não tente fazer muitas coisas ao mesmo tempo. Preocupe-se com a qualidade da execução;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Você precisa de um nível quase insano de dedicação à sua empresa para ter sucesso;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Em geral, não comece uma startup na qual você não estaria disposto a trabalhar por dez anos;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Seja implacavelmente cheio de recursos (engenhoso);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No mundo atual, cheio de “pivôs”, boas ideias são subestimadas. Vale a pena dedicar tempo para pensar em uma boa;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Crescimento resolve (quase) todos os problemas;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embora o crescimento seja crítico e você deva focar nele, pense ocasionalmente para onde está indo — é preciso crescer &lt;em&gt;em direção&lt;/em&gt; a algo valioso;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Seja obcecado pela qualidade do produto;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comunique-se demais com sua equipe. Por algum motivo, a maioria dos fundadores é realmente ruim nesse aspecto. A transparência é sua aliada;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mova-se rápido. A velocidade é uma das suas principais vantagens sobre grandes empresas;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contrate devagar; demita rápido. Contratar é a coisa mais importante que você faz — dedique pelo menos um terço do seu tempo a isso;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pense, de tempos em tempos, por que a vigésima pessoa se juntaria à sua empresa;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contrate pessoas inteligentes e eficazes que estejam comprometidas com o que você está fazendo. As últimas sete palavras são importantes; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contrate amigos e amigos de amigos. Vá atrás dessas pessoas com tudo. Outras fontes de contratação são boas, mas eu sempre tive resultados ruins de recrutadores técnicos;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Valorize aptidão mais do que experiência;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contrate pessoas que você poderia descrever como um animal;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Elimine distrações;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Não morra;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Seja frugal (moderado, simples, sóbrio e/ou discreto);  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Você frequentemente ouvirá conselhos conflitantes sobre tudo, exceto “construa um ótimo produto”. Isso significa que você pode seguir qualquer caminho na maioria das outras coisas e realmente não importa. Apenas tome uma decisão e volte ao trabalho. Adequação de produto/mercado é o que importa. Você pode – e irá – cometer um monte de erros;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Você cria aquilo que mede; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Startups são muito difíceis de qualquer forma; portanto, é melhor mirar em uma grande oportunidade;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Momentum é tudo. Não o perca;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mantenha salários baixos e participação acionária alta;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mantenha a organização o mais horizontal possível;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ao negociar — levantar fundos, fechar parcerias etc. — crie uma situação competitiva;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Schleps” (tarefas maçantes e inevitáveis) são boas;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Não se esqueça de ganhar dinheiro;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Jornalistas gostam de ouvir diretamente dos fundadores;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;É padrão que fundadores mantenham o controle do conselho na primeira rodada; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ouça todo mundo. Depois, tome sua própria decisão;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lembre-se que é mais provável morrer por má execução do que ser esmagado por um concorrente;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dê sorte;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tenha uma relação direta com seus clientes;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Seja formidável — não seja fácil de intimidar;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Não deixe sua empresa ser comandada por um vendedor. Mas aprenda a vender seu produto;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tenha uma cultura que recompense resultados;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Não contrate gerentes profissionais cedo demais;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;O simples é bom. Desconfie da complexidade;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Em situações especiais, pegue um avião. O presencial ainda é melhor;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A maioria das coisas não é tão arriscada quanto parece;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Desconfie de quem fala “processo” demais;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Levante um pouco mais de dinheiro do que acha que precisa;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ignore o fato de que “a imprensa te ama”;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tenha um ótimo atendimento ao cliente;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Você pode criar valor através de inovação extrema, refinamento progressivo ou coordenação complexa. Grandes companhias geralmente fazem duas dessas coisas. As melhores companhias fazem as três;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;O papel do conselho é aconselhar e aprovar. Se o CEO não define a estratégia e tenta fazer com que o conselhor a defina, tende a terminar em desastre;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Observadores de conselho geralmente são dor de cabeça;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Se for pivotar, faça isso completamente e com convicção. A pior coisa é tentar fazer um pouco do que é velho e um pouco do que é novo – é difícil matar seus bebês;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;É melhor tomar uma decisão e errar do que hesitar;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Defina metas e motive as pessoas a alcançá-las;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sempre elogie um bom trabalho;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Celebre as vitórias como companhia. Consiga camisetas para cada grande &lt;em&gt;milestone&lt;/em&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tenha uma boa cadência operacional na qual projetos são curtos e você está sempre lançando algo novo com recorrência;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Você pode vencer com o melhor produto, o melhor preço ou a melhor experiência;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Meetups e conferências geralmente são perda de tempo;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Se os fundadores parecem se importar mais em &lt;em&gt;ser&lt;/em&gt; fundadores do que com a empresa, vá para outra;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;É mais fácil vender analgésicos do que vitaminas;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Desconfie de trabalho que não envolva construir produto ou conquistar clientes. É fácil ser puxado para dentro de uma espiral mortal de reescrita de infrastrutura; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;É melhor ter poucos usuários que amem seu produto do que muitos que apenas gostem;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Aprenda a manter-se otimista mesmo quando tudo estiver desmoronando;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Startups deveriam precisar de quanto menos milagres for possível — mas precisam de pelo menos um;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Você precisa ter uma ótima execução. Muito mais gente tem boas ideias do que gente que arregaça as mangas e faz acontecer;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Não busque diversidade cultural no início;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Faça uma lista de tarefas diária. No topo dela, coloque uma ou duas grandes coisas nas quais você quer trabalhar;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ser CEO é miserável mais vezes do que é bom. Mas quando é bom, é ótimo; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nos dias ruins, lembre-se de que amanhã será melhor. É difícil que seja muito pior!;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Durma e se exercite;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sucesso em startups é geralmente sinônimo de "passa ou falha". Preocupe-se mais em assegurar-se de passar do que em um ponto extra de diluição;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bons investidores merecem um &lt;em&gt;premium&lt;/em&gt; razoável;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dê algo para seus investidores fazerem;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prefira poucos investidores engajados a muitos distantes;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Levante dinheiro com promessa e termos limpos;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Faça checagem de referência com seus investidores potenciais. Questione outros fundadores sobre eles antes que tudo desande;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Investidores amam empresas que outros investidores amam;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Muitas boas ideias parecem ruins no início. Você precisa de uma ideia que está na intersecção entre "parece uma má ideia" e "é uma boa ideia". (É importante notar que você precisa ser contrariador e certo, não apenas contrariador.);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Surfe na onda de alguém;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Às vezes,  você pode vencer através de pura força de vontade;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Toda startup está ferrada em pelo menos uma grande maneira. Continue;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mantenha um olho no dinheiro no banco e não deixe ele acabar;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Preste muita atenção à relação entre os cofundadores, especialmente se ambos/todos querem ser CEO;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mantenha-se pequeno e ágil;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Faça uma reunião de equipe por semana;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Encontre um mentor que te ensine a gerenciar;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mantenha o &lt;em&gt;burn rate&lt;/em&gt; baixo até ter certeza de que tudo funciona;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Desconfie de comprar usuários;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lidere pelo exemplo;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tenha o tipo certo de escritório. O escritório adequado para uma companhia muito pequena é um apartamento ou uma casa; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compartilhe métricas e resultados com a equipe todo mês;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tenha uma tabela em suas cartas de oferta que mostre quando a ação que você está oferecendo hoje vai se valorizar em diferentes cenários;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As melhores startups são definidas por exceções; todas essas regras são provavelmente quebráveis, mas provavelmente não todas ao mesmo tempo.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Créditos
&lt;/h2&gt;

&lt;p&gt;Texto original: &lt;a href="https://blog.samaltman.com/startup-advice" rel="noopener noreferrer"&gt;“Startup Advice”&lt;/a&gt;, por Sam Altman.&lt;br&gt;&lt;br&gt;
Tradução: &lt;em&gt;Lucas Rafaldini&lt;/em&gt;  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Publicado originalmente em inglês no blog de Sam Altman.&lt;br&gt;&lt;br&gt;
Tradução e adaptação autorizadas para fins educacionais e de divulgação.&lt;br&gt;&lt;br&gt;
✍️ &lt;em&gt;Publicado em lucas.rafaldini.github.io&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>startup</category>
      <category>empreendedorismo</category>
      <category>openai</category>
      <category>tradução</category>
    </item>
    <item>
      <title>Back to Basics #3 - Databases and SQL Fundamentals</title>
      <dc:creator>Lucas Rafaldini</dc:creator>
      <pubDate>Wed, 17 Jan 2024 13:37:00 +0000</pubDate>
      <link>https://forem.com/lucasrafaldini/back-to-basics-3-databases-and-sql-fundamentals-392i</link>
      <guid>https://forem.com/lucasrafaldini/back-to-basics-3-databases-and-sql-fundamentals-392i</guid>
      <description>&lt;p&gt;In the digital world, data is the new gold, and knowing how to efficiently store, retrieve, and manipulate this data is a crucial skill for any developer. That’s where databases and SQL come in. In this installment of our Back to Basics series, we dive into the fundamentals of databases and the language that helps us communicate with them - SQL (Structured Query Language).&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a Database?
&lt;/h1&gt;

&lt;p&gt;A database is an organized collection of data. It’s like a digital filing cabinet where data is stored in a structured way so that it can be easily accessed, managed, and updated. Databases can range from simple, like a contact list on your phone, to the complex, like the massive databases that run social media platforms.&lt;/p&gt;

&lt;h1&gt;
  
  
  Types of Databases
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Relational Databases (SQL): These databases organize data into tables linked by relationships, making data management more efficient. Popular examples include MySQL, PostgreSQL, and SQLite.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Non-Relational Databases (NoSQL): These are used for unstructured data and are more flexible in terms of data storage. They include document-oriented databases like MongoDB and key-value stores like Redis.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Why SQL?
&lt;/h1&gt;

&lt;p&gt;SQL is the language used to interact with relational databases. It allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create and manipulate databases and tables.&lt;/li&gt;
&lt;li&gt;Insert, update, and delete data.&lt;/li&gt;
&lt;li&gt;Retrieve data according to complex criteria.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Basic SQL Commands
&lt;/h1&gt;

&lt;h3&gt;
  
  
  SELECT: Retrieve data from a database.
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;SELECT * FROM users;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  INSERT: Add new data to a table.
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;INSERT INTO users (username, email) VALUES ('john_doe', 'john@example.com');&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  UPDATE: Modify existing data.
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;UPDATE users SET email = 'new_email@example.com' WHERE username = 'john_doe';&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DELETE: Remove data from a table.
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;DELETE FROM users WHERE username = 'john_doe';&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Understanding SQL and Databases
&lt;/h1&gt;

&lt;p&gt;Mastering SQL and understanding databases are fundamental for back-end development, data analysis, and even in many other non-developer roles that require data manipulation. As we progress in our Back to Basics series, we’ll explore more about how to effectively use SQL in real-world scenarios and understand the power of databases in the tech world.&lt;/p&gt;

&lt;p&gt;Stay tuned for more insights and foundational knowledge in tech. Let me know in the comments if there’s a particular topic you want to be covered in this series!&lt;/p&gt;

&lt;p&gt;See you in the next post!&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>beginners</category>
      <category>coding</category>
    </item>
    <item>
      <title>Guia de Análise de Tráfego para GitHub Pages: Integração com Ferramentas de Analytics</title>
      <dc:creator>Lucas Rafaldini</dc:creator>
      <pubDate>Fri, 03 Nov 2023 07:15:06 +0000</pubDate>
      <link>https://forem.com/lucasrafaldini/guia-de-analise-de-trafego-para-github-pages-integracao-com-ferramentas-de-analytics-18cb</link>
      <guid>https://forem.com/lucasrafaldini/guia-de-analise-de-trafego-para-github-pages-integracao-com-ferramentas-de-analytics-18cb</guid>
      <description>&lt;h2&gt;
  
  
  Guia de Análise de Tráfego para GitHub Pages: Integração com Ferramentas de Analytics
&lt;/h2&gt;

&lt;p&gt;Quando se trata de hospedar um site estático, o GitHub Pages é uma escolha popular entre desenvolvedores e criadores de conteúdo. No entanto, uma funcionalidade frequentemente solicitada é a capacidade de rastrear e analisar o tráfego do site. Este guia detalhado oferece soluções eficazes para integrar ferramentas de analytics ao seu site no GitHub Pages, permitindo que você obtenha insights valiosos sobre seus visitantes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Como Integrar o Google Analytics ao Seu Site no GitHub Pages
&lt;/h3&gt;

&lt;p&gt;O Google Analytics é uma ferramenta robusta que pode ajudar você a entender melhor o comportamento dos usuários em seu site. Siga estes passos para adicionar o Google Analytics ao seu GitHub Pages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Crie uma conta no Google Analytics e configure uma nova propriedade para o seu site.&lt;/li&gt;
&lt;li&gt;Obtenha o ID de acompanhamento e insira o seguinte snippet de código na seção  dos seus arquivos HTML:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Código de acompanhamento do Google Analytics --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.googletagmanager.com/gtag/js?id=SEU_ID_AQUI"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dataLayer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dataLayer&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;gtag&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;&lt;span class="nx"&gt;dataLayer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;);}&lt;/span&gt;
  &lt;span class="nf"&gt;gtag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

  &lt;span class="nf"&gt;gtag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SEU_ID_AQUI&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Verifique a instalação visitando seu site e conferindo se as visitas aparecem no painel do Google Analytics.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Plausible Analytics: Uma Alternativa Focada na Privacidade
&lt;/h3&gt;

&lt;p&gt;Para aqueles preocupados com a privacidade dos usuários, o Plausible Analytics oferece uma solução leve e respeitosa à privacidade. A configuração é simples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Registre-se no Plausible e adicione seu site.&lt;/li&gt;
&lt;li&gt;Coloque o script fornecido na tag  do seu site.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Fathom Analytics: Análise Simplificada
&lt;/h3&gt;

&lt;p&gt;O Fathom Analytics é uma alternativa paga ao Google Analytics que se destaca pela simplicidade e foco na privacidade. A configuração é direta e semelhante ao Plausible.&lt;br&gt;
Implementando o Código de Análise&lt;/p&gt;

&lt;p&gt;Para adicionar qualquer uma dessas ferramentas de analytics ao seu site no GitHub Pages, você precisará:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Editar o template HTML ou páginas individuais, adicionando o código de rastreamento à seção .&lt;/li&gt;
&lt;li&gt;Fazer commit e push das alterações para o seu repositório no GitHub.&lt;/li&gt;
&lt;li&gt;Monitorar o painel de analytics para garantir que o tráfego esteja sendo rastreado corretamente.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A integração de ferramentas de analytics ao seu site no GitHub Pages é essencial para entender o comportamento do usuário e otimizar seu conteúdo. Com este guia, você pode facilmente configurar o Google Analytics, Plausible ou Fathom para começar a rastrear as métricas do seu site hoje mesmo.&lt;/p&gt;

</description>
      <category>githubpages</category>
      <category>analytics</category>
      <category>google</category>
    </item>
    <item>
      <title>Back to Basics #2 - Git Basic</title>
      <dc:creator>Lucas Rafaldini</dc:creator>
      <pubDate>Tue, 23 Jun 2020 00:13:37 +0000</pubDate>
      <link>https://forem.com/lucasrafaldini/back-to-basic-2-git-basic-4em9</link>
      <guid>https://forem.com/lucasrafaldini/back-to-basic-2-git-basic-4em9</guid>
      <description>&lt;p&gt;There was a time when developers didn't control very well changes made by an entire team on a project. I did not live that time and I believe you have not lived it either. However, many companies today still suffer to implement version control of the software produced by the development team. Folders like "Final", "Final 2.0", and "FINAL FOR REAL THIS TIME" still exist on many development teams and that is sad to say the least. For this reason, it is essential that developers know how to do this version control in the right way, understanding that controlling changes in the work and recording who made each change in the right way is a piece of cake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Knowing Git
&lt;/h2&gt;

&lt;p&gt;Git is currently the most widely used version control system in the world. This is due to its ease of use, to how lean it has been since its development and also because it is a native technology on all machines that run a linux kernel. In fact, Git is an invention of our friend &lt;a href="https://en.wikipedia.org/wiki/Linus_Torvalds" rel="noopener noreferrer"&gt;Linus Torvalds&lt;/a&gt; and arose out of a real need (as all good ideas emerge): as soon as Linux stopped being just an individual project and Linus decided to share it with some friends, many changes in files did not make sense or, at least, did not feel like it at first glance. For Linus, this demonstrated some important needs when working as a team on that project that he loved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is necessary for the developer to add some kind of explanation for the change that was made so that no one gets lost when seeing a changed and possibly unreadable code;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is necessary that the change is recorded with its date, a history of the old data compared to the new data and who is responsible for that change;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is necessary that these changes if they are interpreted as unimportant or unproductive, can be discarded without harming the legacy code, or simply what was there before the change;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With that in mind, Linus created Git. Git separated the legacy code into a priority &lt;em&gt;branch&lt;/em&gt;, requiring each developer, wishing to make a change, not to change that &lt;em&gt;branch&lt;/em&gt; directly, but to copy a new &lt;em&gt;branch&lt;/em&gt; in which he would include his modifications and, later, submit a request for &lt;em&gt;merge&lt;/em&gt; with the priority &lt;em&gt;branch&lt;/em&gt;. That way, he would be able to control the legacy code and choose for himself what should and shouldn't be changed in his code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tree metaphor
&lt;/h2&gt;

&lt;p&gt;Perhaps it is a little difficult for some people to understand the concept of &lt;em&gt;branch&lt;/em&gt;. For English speakers, the metaphor is a little more intelligible, as it applies to other areas, as in the case of companies that have headquarters (&lt;em&gt;head offices&lt;/em&gt;) and offices (&lt;em&gt;branches&lt;/em&gt;), but the thing is very simple to understand:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhsaqkzk20twvet9juznx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhsaqkzk20twvet9juznx.png" alt="Alt Text" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the example above, we see in blue what the priority &lt;em&gt;branch&lt;/em&gt; would be. After its second version, a developer wants to program a new feature or a fix. What it does is open a second &lt;em&gt;branch&lt;/em&gt;, represented in purple. Thus, both the priority &lt;em&gt;branch&lt;/em&gt; does not need to stop its advance hoping that this new functionality will get out of the way in the workflow: both evolve in parallel. The same process can be seen later in the example shown in green.&lt;/p&gt;

&lt;p&gt;An essential fact to understand the Git version control that is not shown in the image is the aforementioned &lt;em&gt;merge&lt;/em&gt;. &lt;em&gt;Merge&lt;/em&gt; occurs when the developer finishes the functionality he had in mind when developing his &lt;em&gt;branch&lt;/em&gt;. The objective is to make this functionality enter the legacy code, in the priority &lt;em&gt;branch&lt;/em&gt;. &lt;em&gt;Merge&lt;/em&gt; can be understood as a blend, a process that keeps what's there and inserts what's new without breaking everything.&lt;/p&gt;

&lt;p&gt;Thus, we can see that version control behaves following the metaphor of a tree, in which there is a trunk (the priority &lt;em&gt;branch&lt;/em&gt;) and for each change, a branch is created that carries with it all the properties of the tree to which it belongs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about Github?
&lt;/h2&gt;

&lt;p&gt;Github is a web interface for viewing the flow of Git. It is something like a social network for controlling and viewing Git repositories and version controls that previously were only on one machine or on a private network of users. We can say that Github is for Git as Wix is for Front End development. It allows this technology that was made thinking about enabling and improving collective software development to be even broader, more collaborative, and easier to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-on
&lt;/h2&gt;

&lt;p&gt;Now that you know a little more about why Git exists and its importance for a developer, it's time for you to get your hands dirty and unlock your skills with Git (and Github) once and for all!&lt;/p&gt;

&lt;p&gt;First, if you don't already have a Github account, create now at &lt;a href="https://github.com/join" rel="noopener noreferrer"&gt;Join Github&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repositories
&lt;/h3&gt;

&lt;p&gt;Repositories can be local or remote. Local means that it is being saved on your machine, with version control registered on your computer. A remote repository is a code repository that has its version control and &lt;em&gt;branches&lt;/em&gt; stored in an online repository distribution and control portal, such as Github, &lt;a href="https://about.gitlab.com/" rel="noopener noreferrer"&gt;GitLab&lt;/a&gt; or &lt;a href="https://bitbucket.org/" rel="noopener noreferrer"&gt;BitBucket&lt;/a&gt;. By copying a remote repository, you can join the workflow of a new or ongoing project, bringing to your computer the code of all &lt;em&gt;branches&lt;/em&gt; that you are authorized to access and change.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding remote repositories
&lt;/h3&gt;

&lt;p&gt;As already mentioned, remote repositories are versions of projects that are stored somewhere on the internet. Adding a remote repository is basically telling your Git where your code is being stored. You can add it using the URL for the repository (or for some user's fork).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add &amp;lt;name&amp;gt; &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ** name ** is a unique remote repository name on your machine. It can be anything, but it necessarily needs to be different from other names you've already given for repositories you've already added.&lt;/p&gt;

&lt;p&gt;To see the list of remote repositories you have already added, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Changing remote repositories
&lt;/h3&gt;

&lt;p&gt;You may want to change the URL assigned to any of the remote repositories you have added.&lt;/p&gt;

&lt;p&gt;To do this, use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote set-url &amp;lt;valid-repository-name&amp;gt; &amp;lt;new-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to run &lt;em&gt;&lt;strong&gt;git remote -v&lt;/strong&gt;&lt;/em&gt; after changing the URL to confirm that your change worked.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a branch (locally and remotely)
&lt;/h3&gt;

&lt;p&gt;Then you choose a repository (or create it) and want to start coding. Okay, but before that you need a &lt;em&gt;branch&lt;/em&gt; to call yours. To create a &lt;em&gt;branch&lt;/em&gt; locally, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch &amp;lt;new-branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, check if your &lt;em&gt;branch&lt;/em&gt; is listed among your &lt;em&gt;branches&lt;/em&gt; with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To change work &lt;em&gt;branch&lt;/em&gt;, just run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To simplify the job and you don't have to create a new &lt;em&gt;branch&lt;/em&gt; and do the &lt;em&gt;checkout&lt;/em&gt; with two commands, just use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b &amp;lt;new-branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool, now your new &lt;em&gt;branch&lt;/em&gt; is created locally! Now, assuming you've made some pretty cool changes to the code and want to upload a &lt;a href="https://help.github.com/pt/github/collaborating-with-issues-and-pull-requests/about-pull-requests" rel="noopener noreferrer"&gt;Pull Request&lt;/a&gt;, you just need to execute the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m 'Your commit description'
git push origin &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command (&lt;em&gt;&lt;strong&gt;add&lt;/strong&gt;&lt;/em&gt;) adds the changed files to your &lt;em&gt;commit&lt;/em&gt;, the point indicates that all changed files should be added to &lt;em&gt;commit&lt;/em&gt;. If you want to add only one or more changes, just add the file path for the change. In case you don't remember the path, just use the command that lists all the changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second command (&lt;em&gt;&lt;strong&gt;commit&lt;/strong&gt;&lt;/em&gt;) creates a new commit for your &lt;em&gt;branch&lt;/em&gt;. The &lt;strong&gt;- m&lt;/strong&gt; flag is for you to add the &lt;em&gt;commit&lt;/em&gt; message directly in the same command, which is the parameter that follows next between single quotes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deleting a &lt;em&gt;branch&lt;/em&gt; (locally e remotely)
&lt;/h3&gt;

&lt;p&gt;To delete a local &lt;em&gt;branch&lt;/em&gt;, there is no secret. Just use the command::&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -d &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always remember to confirm that the &lt;em&gt;branch&lt;/em&gt; was actually deleted using &lt;em&gt;&lt;strong&gt;git branch&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;To delete a remote &lt;em&gt;branch&lt;/em&gt;, just use the following commando:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin --delete &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remembering that for Git, &lt;strong&gt;_ origin_&lt;/strong&gt; indicates the origin of this repository, that is, the repository that is online, while its copy is remote. That is why the reference &lt;strong&gt;&lt;em&gt;origin&lt;/em&gt;&lt;/strong&gt; is used.&lt;/p&gt;

&lt;h3&gt;
  
  
  Undo a &lt;em&gt;commit&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;To undo a commit locally, just use the command &lt;em&gt;&lt;strong&gt;git reset&lt;/strong&gt;&lt;/em&gt;. For example, if you want to undo your last &lt;em&gt;commit&lt;/em&gt;, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --soft HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;&lt;em&gt;--soft&lt;/em&gt;&lt;/strong&gt; flag keeps changes made to files you added to &lt;em&gt;commit&lt;/em&gt;, only &lt;em&gt;commit&lt;/em&gt; is reversed. However, if you prefer to revert &lt;em&gt;commit&lt;/em&gt; and the changes made and added to it, run this command in place of the previous one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --hard HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parameter &lt;em&gt;&lt;strong&gt;HEAD~1&lt;/strong&gt;&lt;/em&gt; points to your last commit. If you prefer to undo any previous &lt;em&gt;commit&lt;/em&gt;, you can use the command &lt;strong&gt;_ git reflog_&lt;/strong&gt; to have a record of all previous &lt;em&gt;commit&lt;/em&gt;. Having access to the previous &lt;em&gt;commits&lt;/em&gt;, just use the same command &lt;em&gt;&lt;strong&gt;reset&lt;/strong&gt;&lt;/em&gt; replacing &lt;em&gt;&lt;strong&gt;HEAD~1&lt;/strong&gt;&lt;/em&gt; with the hash referring to the &lt;em&gt;commit&lt;/em&gt; that you want to undo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --soft &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To undo a remote &lt;em&gt;commit&lt;/em&gt;, you can use the command &lt;strong&gt;&lt;em&gt;git revert&lt;/em&gt;&lt;/strong&gt; to undo the &lt;em&gt;commit&lt;/em&gt; locally and then &lt;em&gt;&lt;strong&gt;push&lt;/strong&gt;&lt;/em&gt; changes to the remote &lt;em&gt;branch&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;To do this, first run &lt;em&gt;&lt;strong&gt;reflog&lt;/strong&gt;&lt;/em&gt; and then &lt;em&gt;&lt;strong&gt;revert&lt;/strong&gt;&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reflog
git revert &amp;lt;hash-do-commit&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, push it to the desired remote &lt;em&gt;branch&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Did you like the article? Do you think there was a missing question to be addressed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please comment and let me know if this content helped you in any way.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;See you later, aligator!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted in Portuguese &lt;a href="https://lucasrafaldini.github.io/blog/2020/06/22/back-to-basics-o-basico-do-git" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt; &lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>linux</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Back to Basics #1 - The HTTP Protocol</title>
      <dc:creator>Lucas Rafaldini</dc:creator>
      <pubDate>Wed, 03 Jun 2020 04:50:56 +0000</pubDate>
      <link>https://forem.com/lucasrafaldini/back-to-basics-1-the-http-protocol-3nb7</link>
      <guid>https://forem.com/lucasrafaldini/back-to-basics-1-the-http-protocol-3nb7</guid>
      <description>&lt;p&gt;To start posting on this blog, I decided to start a series of posts on topics that are basic, but essential for beginning developers. As a first topic, I thought it would be cool to talk about the famous HTTP that everyone uses and few people understand. So, let's go to the guts of the protocol.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a protocol?
&lt;/h2&gt;

&lt;p&gt;Do you remember when someone called you to a party and it's a costume party? Do you know remeber when someone said that, for instance, a judge or a POTUS should not use bad words (at least, not in public)? This is what we call "decorum" and, roughly speaking, we can say that this is a social protocol. A protocol is basically something that everyone agrees without saying anything explicitly, so it is understood by everyone that things must happen one way and only this way, or they will not happen at all.&lt;/p&gt;

&lt;p&gt;Bringing this concept to the Web, the HTTP protocol (acronym for &lt;em&gt;Hyper Text Transfer Protocol&lt;/em&gt;) is an agreement that establishes a decorum for the transfer of data between Clients and Servers, so no one speaks different "languages" when exchanging information.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work?
&lt;/h2&gt;

&lt;p&gt;HTTP is a TCP/IP application layer protocol. That is something unintelligible for a beginner but here we go: the protocol works on top of the Client-Server model, which assumes that a Client (a computer, a cell phone, a smartwatch, etc) makes resource requests to a Server (well, I don't have a lot of analogies for that, but for now we’ll say it’s a computer that just stores files in general). When you access a website, you are making a request to a server for one or more files that make up the website you want to access; the server checks whether your request is valid or not and sends these files to you; so, you finally see the site on your screen. The page usually comes &lt;em&gt;rendered&lt;/em&gt; in an HTML file (short for &lt;em&gt;Hyper Text Markup Language&lt;/em&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Request Types
&lt;/h2&gt;

&lt;p&gt;The first line of every request identifies its type. Requests can have &lt;em&gt;some&lt;/em&gt; types. The main types are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GET&lt;/strong&gt;: Request to get data from the server, whether that data is a page, an image or the response to any behavior done by the Client;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HEAD&lt;/strong&gt;: Similar to GET, but returns only the page header to the Client;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;POST&lt;/strong&gt;: This type of request can be understood as the opposite of GET. The Client sends data to the server, be it login data, image uploads or even a message on a service like Whatsapp, for instance;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PUT&lt;/strong&gt;: Similar to POST, with the difference that it is used when the Client wants to send only a part of a record and not a new complete record, such as when you change your username on a social network. So that the Client does not need to send all your data again, overwriting your old registration, he sends a PUT with only the new name;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DELETE&lt;/strong&gt;: Request to delete some record on the server.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Request Headers
&lt;/h2&gt;

&lt;p&gt;Every request, therefore, has a type and that type is specified in its header. An example of a header would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET / HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Connection: close
Cookie:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line of this header identifies the type (method) of the request. As we can see, it is a ** GET &lt;strong&gt;. Still on the first line, we can see which path is inside the Server (Host) where the request is being sent. In this case, the Client wants to access the root page, "/". The third and last data of the first line tells the server which version of the HTTP protocol is being used. In this case, **HTTP / 1.1&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The rest of the header content can vary, relatively. Its representation is always structured following an order of &lt;strong&gt;Name:Value&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The most common data sent in a header are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Host&lt;/strong&gt;: Domain name of the server, that is, the domain to which you are trying to send your request, such as &lt;em&gt;&lt;a href="http://www.facebook.com" rel="noopener noreferrer"&gt;www.facebook.com&lt;/a&gt;&lt;/em&gt; or &lt;em&gt;&lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;&lt;/em&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User-Agent&lt;/strong&gt;: This piece of data is used to identify to the Server (Host) who is making the request, containing data such as the Client's browser, version and operating system;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Accept&lt;/strong&gt;: Tells the Server (Host) what types of data the Client is able to understand. This is essential for the Server to be able to respond to the Client's request in a way that it understands. Examples of this data are &lt;em&gt;text/plain&lt;/em&gt; e &lt;em&gt;application/json&lt;/em&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Content-Type&lt;/strong&gt;: This data is similar to the aforementioned &lt;em&gt;Accept&lt;/em&gt;. The difference is that in this case, we are identifying what type of data is sent by the request. The &lt;em&gt;text/plain&lt;/em&gt; and &lt;em&gt;application/json&lt;/em&gt; examples also apply;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Connection&lt;/strong&gt;: Defines whether or not the connection to the Server (Host) should be kept open for future requests. When the connection is maintained, &lt;strong&gt;keep-alive&lt;/strong&gt; is sent; when not, &lt;strong&gt;close&lt;/strong&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cookie&lt;/strong&gt;: &lt;em&gt;Cookie&lt;/em&gt; assists in the processes of maintaining the user session and identifying the client. As HTTP is a &lt;a href="https://en.wikipedia.org/wiki/Stateless_protocol" rel="noopener noreferrer"&gt;stateless protocol&lt;/a&gt;, it cannot maintain a "state" of the Client. So, when you log in to a website and then want to perform some task that requires the user to be logged in, you would need to log in again. In order for this redundant process to be avoided for the Client, we use &lt;em&gt;Cookies&lt;/em&gt;. It is nothing more, &lt;em&gt;grossly&lt;/em&gt;, than a &lt;a href="https://en.wikipedia.org/wiki/Hash_function" rel="noopener noreferrer"&gt;hashed string&lt;/a&gt; that can load user data, such as your login, password and complementary data to the aforementioned &lt;em&gt;User-Agent&lt;/em&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Referer&lt;/strong&gt;: This data provides to the Server (Host) the address from which the request is originated, which can be used for tracking and analyzing usage of a website, for instance;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Origin&lt;/strong&gt;: This data is quite similar with &lt;em&gt;Referer&lt;/em&gt;, but it takes a more simplified data about the origin of the request to the Server (Host). While &lt;em&gt;Referer&lt;/em&gt; usually sends the entire path to a URL (such as &lt;a href="http://www.example.com/home/login" rel="noopener noreferrer"&gt;www.example.com/home/login&lt;/a&gt;), &lt;em&gt;Origin&lt;/em&gt; would send something like &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Everything that goes up must come down
&lt;/h2&gt;

&lt;p&gt;And it is no different with requests. Just as the Client needs to send his request, identifying himself and following the standards of &lt;em&gt;Header&lt;/em&gt;, the Server (Host) needs to send a answer to this request, what we call &lt;em&gt;&lt;strong&gt;Response&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;An exemple of &lt;em&gt;&lt;strong&gt;Response&lt;/strong&gt;&lt;/em&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 200 OK
Date: Tue, 02 Jun 2020 21:45:35 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Strict-Transport-Security: max-age=31536000
Server: Apache/2.2.14
X-Frame-Options: SAMEORIGIN
Set-Cookie:
Connection: close
Content-Length: 194814
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we have already seen, this first line is very similar to the first line of the Header sent by the Client, with the difference that, in this case, the Client receives the HTTP version and the &lt;a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" rel="noopener noreferrer"&gt;&lt;strong&gt;Response Status&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are dozens of status codes and it is up to the developer to investigate which is more appropriate, if he is responsible for sending it from the server. For cases where the developer is on the Client's side, a quick search for the code number provides clarifying answers.&lt;/p&gt;

&lt;p&gt;In any case, it is important that we have &lt;em&gt;general&lt;/em&gt; knowledge about these codes so that we are not caught completely off guard when an unprecedented code appears. To facilitate memorization, we can generally classify the codes by their initial digit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Started with 1 (101, 102, etc)&lt;/strong&gt;: Returns information about the request, whether it was accepted or whether the process continues;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Started with 2(201, 202, etc)&lt;/strong&gt;: Returns that the request was successfully executed, its types being referenced to the different types of requests that can be executed;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Started with 3(301, 302, etc)&lt;/strong&gt;: Returns the information that there is a need for redirection so that the execution of the request can be completed;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Started with 4(401, 402, etc)&lt;/strong&gt;: Returns the information that there is an error on the part of the Client in the request;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Started with 5(501, 502, etc)&lt;/strong&gt;: Returns the information that there is an error on the part of the Server(Host) in the request.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other data returned in a &lt;em&gt;&lt;strong&gt;Response&lt;/strong&gt;&lt;/em&gt; are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Date&lt;/strong&gt;: Date on which the response was originated;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Expires&lt;/strong&gt;: Information about when the content should be considered out of date. The value &lt;em&gt;-1&lt;/em&gt; indicates that the content expires immediately after being sent;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cache-Control&lt;/strong&gt;: Provides information about &lt;a href="https://en.wikipedia.org/wiki/Cache_(computing)" rel="noopener noreferrer"&gt;&lt;em&gt;cache&lt;/em&gt;&lt;/a&gt; policies;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server&lt;/strong&gt;: Provides information about the server;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Set-Cookie&lt;/strong&gt;: Provides Cookies sent from the server to the Client;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;X-Frame-Options&lt;/strong&gt;: Provides information for the browser to render (or not) a page in &lt;code&gt;&amp;lt;frame&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What about the body?
&lt;/h2&gt;

&lt;p&gt;Of course, in addition to the headers, there is the body of &lt;em&gt;requests&lt;/em&gt; and &lt;em&gt;responses&lt;/em&gt;. It usually includes data related to the request that does not identify the Client/Server or does not have sensitive data that, if intercepted, can cause security problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP x HTTPS
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;HTTPS&lt;/strong&gt; (&lt;em&gt;Hypertext Transfer Protocol Secure&lt;/em&gt;) is nothing more than a more secure version of HTTP. It is a junction of HTTP with the SSL (&lt;em&gt;Secure Sockets Layer _) / TLS (_Transport Layer Security&lt;/em&gt;) protocol created to ensure the transmission of sensitive information such as personal data, payment and login data. SSL / TLS protocols allow data to be transmitted over an encrypted connection and require that the Server(Host) and the Client are authentic. HTTPS became primarily necessary due to the massive increase in the use of Wi-Fi connections, in which it becomes possible to carry out attacks by intercepting the data between the Client's exit and the entry in the Wi-Fi modem, for instance. Such attacks are known as &lt;em&gt;Man in the Middle&lt;/em&gt; attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Did you like the article? Do you think there was a missing question to be addressed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please comment and let me know if this content helped you in any way.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;See you later, aligator!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted in Portuguese &lt;a href="https://lucasrafaldini.github.io/blog/2020/06/02/back-to-basics-o-protocolo-http" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt; &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>http</category>
      <category>network</category>
    </item>
  </channel>
</rss>
