<?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>DEV Community: Casual Coders</title>
    <description>The latest articles on DEV Community by Casual Coders (@casualcoders).</description>
    <link>https://dev.to/casualcoders</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%2Forganization%2Fprofile_image%2F6385%2Fca7f13bc-4a46-483f-987a-d33a6357c73a.png</url>
      <title>DEV Community: Casual Coders</title>
      <link>https://dev.to/casualcoders</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/casualcoders"/>
    <language>en</language>
    <item>
      <title>Credit Card Skimmers &amp; Open Source | Causal Coders Podcast</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Mon, 12 Feb 2024 13:46:47 +0000</pubDate>
      <link>https://dev.to/casualcoders/credit-card-skimmers-open-source-causal-coders-podcast-362g</link>
      <guid>https://dev.to/casualcoders/credit-card-skimmers-open-source-causal-coders-podcast-362g</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/pKY3kB39iWc"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Season 2 of the Casual Coders podcast is live! I was not in the first episode, but it’s still a good one! In this first episode they talk about credit card skimmers and how credit cards work, the best open source tools, and a long running web server project by one of our hosts! Available on Spotify, Apple Podcasts, YouTube, or wherever you get your podcasts!&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://creators.spotify.com/pod/profile/casual-coders/embed" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd3t3ozftmdmh3i.cloudfront.net%2Fstaging%2Fpodcast_uploaded_nologo400%2F16776332%2F16776332-1707408112500-5db323d9bbb53.jpg" height="400" class="m-0" width="400"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://creators.spotify.com/pod/profile/casual-coders/embed" rel="noopener noreferrer" class="c-link"&gt;
            Casual Coders Podcast • A podcast on Spotify for Creators
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Welcome to the Casual Coders Podcast! We're a group of makers and engineers who talk nerd and make cool stuff! 

We strive to release two podcasts a month!

Follow our socials!
YouTube | https://www.youtube.com/c/CasualCodersOfficial
Instagram | https://www.instagram.com/casualcodersprojects/
Twitter | https://twitter.com/CasualCoders 
Facebook | https://www.facebook.com/CasualCodersProjects 
TikTok | https://www.tiktok.com/@casualcoders 

          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd12xoj7p9moygp.cloudfront.net%2Ffavicon%2Ffavicon-s4p-196x196.png" width="196" height="196"&gt;
          creators.spotify.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>podcast</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
    <item>
      <title>Deploy your containerized app in 5 minutes with Fly Machines</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Thu, 23 Mar 2023 20:03:03 +0000</pubDate>
      <link>https://dev.to/casualcoders/deploy-your-containerized-app-in-5-minutes-with-fly-machines-3jge</link>
      <guid>https://dev.to/casualcoders/deploy-your-containerized-app-in-5-minutes-with-fly-machines-3jge</guid>
      <description>&lt;p&gt;Fly Machines is Fly’s new runtime for FirecrackerVMs. Firecracker is a free and open source container runtime developed by AWS. Fly Machines, or AppsV2 as its also referred to, are more aimed at serverless functions but it can be used as a normal VM host with easy HTTP(S) routing.&lt;/p&gt;

&lt;p&gt;While a normal Fly App has a configuration file, a Fly Machine doesn’t. A Fly machine is just one part of an app, which can have distributed Fly machines across different regions. Currently its on the dev to handle all of that. Any environment variables should either be put in the Docker container itself or passed at runtime (provided they are not secrets which are handled &lt;a href="https://fly.io/docs/reference/secrets/" rel="noopener noreferrer"&gt;the same as they were before&lt;/a&gt;), as should the command to run the container. I should note that the &lt;code&gt;fly m run&lt;/code&gt; command, which is the command used to start a container using a machine, does have a flag to specify a launch command ( &lt;code&gt;—-comand, -c&lt;/code&gt; ), however at the time of writing it didn’t work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparations
&lt;/h2&gt;

&lt;p&gt;Throughout this section and the one below it, it is assumed you already have a Dockerized application. If not, I recommend reading up &lt;a href="https://docs.docker.com/get-started/02_our_app/" rel="noopener noreferrer"&gt;here&lt;/a&gt; before proceeding.&lt;/p&gt;

&lt;p&gt;First, you have to create a new application on Fly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly apps create &lt;span class="nt"&gt;--machines&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; your-name-here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that you can add volumes and secrets to it like you normally would, passing in the &lt;code&gt;--app, -a&lt;/code&gt; flag to specify the application in question.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly secrets &lt;span class="nb"&gt;set &lt;/span&gt;&lt;span class="nv"&gt;MY_SECRET_HERE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"password"&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; your-name-here
fly volume create your-volume-here &lt;span class="nt"&gt;--region&lt;/span&gt; lax &lt;span class="nt"&gt;-a&lt;/span&gt; your-name-here &lt;span class="nt"&gt;-s&lt;/span&gt; 3 &lt;span class="c"&gt;# in GB&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike a normal fly app, you have to manually allocate IP addresses. If your app is just running on an HTTP server, you can use the shared IPv4 address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly ips allocate-v4 &lt;span class="nt"&gt;--shared&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; your-name-here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you aren’t just hosting an HTTP server, you’ll have to either settle for IPv6 (which is free) or pay $2/mo for an IPv4 address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly ips allocate-v6 &lt;span class="nt"&gt;-a&lt;/span&gt; your-name-here
fly ips allocate-v4 &lt;span class="nt"&gt;-a&lt;/span&gt; your-name-here &lt;span class="c"&gt;# costs $2/mo per IP&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;When you run &lt;code&gt;fly m run&lt;/code&gt; , it takes all the flags for ports, volumes, and environment variables, just the same as Docker. As mentioned earlier they have a command that is &lt;em&gt;supposed&lt;/em&gt; to allow you to set the command at runtime, however it didn’t work for me. My solution was to just change the &lt;code&gt;CMD&lt;/code&gt; line in my Dockerfile to the command I wanted.&lt;/p&gt;

&lt;p&gt;Let’s assume you have an app with an HTTP server on 7500 and you want that to be accessible via your app’s Fly domain name. Since we made the region for the above volume &lt;code&gt;lax&lt;/code&gt; (Los Angeles), we will assume the same for the deployment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly m run &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 443:7500/tcp:tls:http &lt;span class="nt"&gt;-v&lt;/span&gt; your-volume-here:/data &lt;span class="nt"&gt;--region&lt;/span&gt; lax &lt;span class="nt"&gt;-a&lt;/span&gt; your-name-here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build a Docker container using the Dockerfile in the current directory (the &lt;code&gt;.&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Set up a port forward to external port 443 (which is the standard HTTPS port) and internal port 7500 (our hypothetical web server), specifying that we want this to use TLS and HTTP in the options.&lt;/li&gt;
&lt;li&gt;Specify volume &lt;code&gt;your-volume-here&lt;/code&gt; to be mounted to &lt;code&gt;/data&lt;/code&gt; inside the container.&lt;/li&gt;
&lt;li&gt;Deployed to &lt;code&gt;lax&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Deployed the new machine to the app &lt;code&gt;your-name-here&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we have explored how to work with Fly Machines, or AppsV2, to create, configure, and deploy applications using FirecrackerVMs. We covered the steps required to create a new application, allocate IP addresses, manage secrets and volumes, and deploy the app to a specific region.&lt;/p&gt;

&lt;p&gt;By following this guide, you should now be equipped with the knowledge to build and deploy serverless applications or even utilize Fly Machines as a normal VM host with easy HTTP(S) routing. As a developer, it is essential to adapt to new and emerging technologies that can improve the efficiency and performance of your applications, and Fly Machines is one such tool that can help you achieve that.&lt;/p&gt;

&lt;p&gt;Now it's your turn to start building your applications with Fly Machines and harness the power of FirecrackerVMs to enhance your serverless workflows. Good luck, and happy coding!&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>tutorial</category>
      <category>containers</category>
    </item>
    <item>
      <title>My Favorite Free Hosting Services of 2023</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Thu, 16 Mar 2023 15:23:01 +0000</pubDate>
      <link>https://dev.to/casualcoders/my-favorite-free-hosting-services-of-2023-4da4</link>
      <guid>https://dev.to/casualcoders/my-favorite-free-hosting-services-of-2023-4da4</guid>
      <description>&lt;p&gt;Are you a developer who's just starting out and looking to launch your first website or application? Or maybe you're just looking for ways to save on hosting costs? Either way, you're in luck because in this blog post, I'll be sharing my favorite free hosting services of 2023.&lt;/p&gt;

&lt;p&gt;While many programming tools and resources are available for free, hosting services often come with a price tag. However, with the rise of cloud computing and advancements in web technology, there are now a number of hosting providers that offer free plans with generous resource allocations and features!&lt;/p&gt;

&lt;p&gt;In this post, I'll be reviewing some of the top free hosting services available for developers in 2023. I'll cover their features, limitations, and user experience to help you make an informed decision on which provider to choose for your next project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frontend
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Vercel is a cloud platform for building, deploying, and scaling web applications. It provides an all-in-one platform for developers to build, host, and deploy their applications in the cloud.&lt;/p&gt;

&lt;p&gt;Vercel's platform offers a number of features that make it popular among developers. One of its key features is its support for serverless functions, which allow developers to run server-side code without having to manage server infrastructure. This code can be written in Javascript/Typescript, Python, Go, and a few other languages. Vercel also provides support for static sites, React, Vite, Vue, Hugo and plain old HTML sites, as well as Next.js, a popular React framework that Vercel develops in-house, and is quickly becoming the most popular method for getting a React app off the ground.&lt;/p&gt;

&lt;p&gt;In addition to its hosting platform, Vercel also offers a number of developer tools and integrations, including Git-based workflows, continuous deployment, and collaborative editing, making it super easy to get started!&lt;/p&gt;

&lt;p&gt;Vercel is free for hobbyists, meaning if you’re deploying from your personal GitHub account, its free, with teams starting at $20/per developer.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://pages.cloudflare.com/" rel="noopener noreferrer"&gt;Cloudflare Pages&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;You may know Cloudflare from their very fast and very secure DNS provider, or their CDN, or their DDoS protection, but did you know that you can have them host your website using their global CDN? &lt;/p&gt;

&lt;p&gt;Cloudflare Pages is a cloud-based platform for building and deploying websites and web applications. It is designed to make it easy for developers to build, test, and deploy their applications with a simple, intuitive interface and seamless integration with other Cloudflare services.&lt;/p&gt;

&lt;p&gt;With Cloudflare Pages, developers can build and deploy static sites and single-page applications (SPAs) quickly and easily. The platform provides a Git-based workflow for building and deploying applications, and it supports a wide range of front-end frameworks and libraries, including React, Vue.js, Angular, and more.&lt;/p&gt;

&lt;p&gt;Cloudflare Pages also offers fast build times, thanks to its distributed network of servers and caching infrastructure. This helps to reduce the time it takes to build and deploy applications, making it easier for developers to get their applications up and running quickly.&lt;/p&gt;

&lt;p&gt;In addition to its core features, Cloudflare Pages also provides a range of integrations and tools to help developers optimize their applications for performance, security, and scalability. These include access to Cloudflare's CDN, DDoS protection, and edge caching, as well as real-time analytics and monitoring. &lt;/p&gt;

&lt;p&gt;Just like Vercel, you can even set up automatic deployment from GitHub, along with other CI/CD.&lt;/p&gt;

&lt;p&gt;Unliked Vercel, Cloudflare Pages is free for as many developers you want with as many users as you want with unlimited bandwidth. They even have their own serverless compute called Cloudflare Workers (which I’ll get to later) where you can host backend code on! Once you need more advanced features past just hosting the website, or if you run Cloudflare Workers more than 100k times in a month, then you will have to pay.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backend
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://fly.io/" rel="noopener noreferrer"&gt;Fly.io&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Heroku free tier is dead. &lt;a href="https://fly.io" rel="noopener noreferrer"&gt;Fly.io&lt;/a&gt; is here to pick up the pieces. &lt;/p&gt;

&lt;p&gt;Fly.io is a public cloud platform that is built on top of bare-metal servers in data centers around the world. The platform is designed to make it easy for developers to deploy distributed and real-time apps close to their users, no matter where they are. The goal of Fly.io is to deliver applications with the highest possible availability and the lowest possible latency, all while providing a great developer experience.&lt;/p&gt;

&lt;p&gt;One of the key features of Fly.io is its ability to allow developers to run their full stack close to their users. This means that developers can deploy simple web services or complex applications with multiple supporting services, all with ease. Fly.io offers persistent storage volumes and a ready-to-run Postgres database, as well as a fast internal WireGuard network for private communication between applications.&lt;/p&gt;

&lt;p&gt;Fly.io also offers a unique approach to containerization. Instead of using Docker, Fly.io upgrades containers to full-fledged Firecracker microVMs. Developers can use a Dockerfile and remote builders to build an image with their app and its environment, or they can point to a pre-built Docker image. However, in many cases, developers won't even have to touch Docker. The platform's fly launch feature can scan source code and configure a project for deployment on Fly.io, and the builders will build the app's Docker image automatically when it's deployed.&lt;/p&gt;

&lt;p&gt;Since your app is basically just a normal Docker container, if you ever decide you want to move it to another paid service, like AWS Elastic Container Service, or just run it in Docker on a server somewhere, you can!&lt;/p&gt;

&lt;p&gt;Their free tier allows for up to 3 VMs total with 256MB of RAM each, 3GB of storage, and 160GB of bandwidth. That may not sound like a lot, but if all you’re working on is a hobby project, or you’re just getting started, that’s more than enough for most things. They also recently launch a free 100MB Redis Key-Value database that you can run with your app as well, which is a really nice way to cache information in your app.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://deta.space/" rel="noopener noreferrer"&gt;Deta Space&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This one is a bit strange. Deta was originally more along the lines of a Heroku competitor with a bit more restrictions. Now they’re kind of an odd hybrid platform-as-a-service that’s also a startup incubator.&lt;/p&gt;

&lt;p&gt;The TLDR of how they work is that you create an app using their workflow using standard web technologies (NextJS, React, Vue, etc) as well as a backend (Python, Go, Rust, etc) and other people install the app to their own “personal cloud”. This has the advantage of meaning you can write your app as if you were the only user, but means that scaling it in the future may be difficult.&lt;/p&gt;

&lt;p&gt;If you can get over their unusual workflow, your app is hosted for completely free. But only to other users of Deta Space for now. Their website makes it sound like in the future there is going to be a way for you to deploy your app with them somehow hosting it for you as well as collecting revenue for you but since they’re in Beta that could change.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://workers.cloudflare.com/" rel="noopener noreferrer"&gt;Cloudflare Workers&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Cloudflare Workers might be a bit tricky to work with, considering their runtime and API restrictions, but let me tell you, the perks they bring to the table make them absolutely worth the effort. Cloudflare Workers provide an impressive free tier of 100k runs, giving you the chance to explore and tweak your deployment without spending a dime.&lt;/p&gt;

&lt;p&gt;Now, what makes these Workers so irresistible? They've got automatic scaling and a high-performance global network that makes your life as a developer a whole lot easier. No more fussing around with auto-scaling, load balancers, or paying for idle capacity! Plus, they support multiple languages like JS, Rust, C, and C++, with a bunch of templates and tutorials to get you going in no time. &lt;/p&gt;

&lt;p&gt;Cloudflare Workers are super budget-friendly, offering the first 100, 000 requests per day free of charge and paid plans starting at a mere $5 for 10 million requests. With no servers to worry about and built-in edge storage through Workers KV, you can concentrate on crafting and innovating, leaving infrastructure headaches behind. They even let you generate assets like images, SVGs, and PDFs on the fly, delivering them to users as fast as static assets.&lt;/p&gt;

&lt;p&gt;So, even though Cloudflare Workers come with a learning curve due to their runtime and API limitations, the benefits they offer in terms of distribution, speed, and affordability make them a fantastic choice for developers eager to harness the power of serverless architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Database
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://supabase.com/" rel="noopener noreferrer"&gt;Supabase&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I’ll be upfront with you: I absolutely love Supabase.&lt;/p&gt;

&lt;p&gt;Supabase is an open-source alternative to Firebase, which is a cloud-based mobile and web application development platform. It provides a suite of tools and services for building scalable, real-time applications with ease. Supabase is built on top of PostgreSQL, an open-source relational database, and provides a range of tools and services for working with data, authentication, and real-time events.&lt;/p&gt;

&lt;p&gt;Here is something I’m going to say that will make every web developer ever swoon: &lt;strong&gt;they write the backend code for you&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Yeah, you read that right. Using their libraries, you can run a database on their cloud, have your users authenticate, and make authenticated requests to your database, without writing a single line of backend API code.&lt;/p&gt;

&lt;p&gt;Supabase handles this by offering a feature called Row Level Security, where you can set security measures so your users have to pass a check before they can even see if a row exists, or before they can add or modify existing rows. This means that while you don’t write any backend code, its not any less secure than any other full stack application!&lt;/p&gt;

&lt;p&gt;They also offer other services, such as an S3-compatible database-linked file storage service, as well as Deno-based serverless hosting!&lt;/p&gt;

&lt;p&gt;You can have up to 2 databases with 500MB of storage and 512MB of RAM each. You also get 1GB of of file storage, and 500k function runs (which is more than Cloudflare!). This doesn’t sound like a lot, but with all the features and the the ease of development I consider their paid tier of $25/mo per database well worth it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.mongodb.com/atlas/database" rel="noopener noreferrer"&gt;MongoDB&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;MongoDB is a popular open-source document-oriented database management system (DBMS) that uses a flexible, schema-free data model to store data in a JSON-like format. It was first released in 2009 by MongoDB Inc. and is designed to handle large volumes of structured, semi-structured, and unstructured data.&lt;/p&gt;

&lt;p&gt;MongoDB is easy to interface with, especially in higher level languages like Python, Typescript, Java, among others. When I don’t need structured data, Mongo is my go-to database.&lt;/p&gt;

&lt;p&gt;MongoDB offers a cloud-based database hosting service called MongoDB Atlas that provides free and paid plans for developers and organizations. The free plan is called the "M0 Sandbox" and provides users with a fully-managed MongoDB cluster with 512 MB of storage and shared RAM. The M0 Sandbox plan also includes access to MongoDB's community support and allows users to deploy up to three clusters for free.&lt;/p&gt;

&lt;h3&gt;
  
  
  Google Sheets
&lt;/h3&gt;

&lt;p&gt;You can make an entire application using Google Sheets as a database. Would this work well if you’re trying to build the next Twitter? Of course not! But if all you’re trying to do is store data in a single table in a SQLite database for a hobby project, this may be worth the effort. Fireship did &lt;a href="https://youtu.be/K6Vcfm7TA5U" rel="noopener noreferrer"&gt;an entire video&lt;/a&gt; on the subject and he explains it much better job explaining why and how you would do this, so maybe go watch that if this seems interesting to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  File Storage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.cloudflare.com/products/r2/" rel="noopener noreferrer"&gt;Cloudflare R2&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Cloudflare used their knowledge of affordable, distributed computing and put it to use creating R2. R2 is &lt;em&gt;significantly&lt;/em&gt; cheaper than nearly all the competition, and its distributed, meaning your data is close to your users. The S3-compatible API lets you build versatile multi-cloud systems tailored to your needs, and you can move data around without any pesky egress fees. Plus, you'll get a cool 10GB for free! So if you're planning your next project, give Cloudflare R2 a spin and see how it can help you build an efficient, scalable, and affordable solution!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.backblaze.com/b2/cloud-storage.html" rel="noopener noreferrer"&gt;Backblaze B2&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;You may have heard of Blackblaze’s backup service for Mac and PC. Their service offers unlimited backup of your computer’s file storage for $6 per month. Well they have taken their knowledge from storing petabytes of people’s personal information and made a quite affordable option in the Object Storage space with their B2 service. Its 100% S3 compatible, and you get 10GB for free!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Whether you're looking for a frontend or backend solution, a database, or file storage, there's something here for everyone. While free plans may come with limitations, they're a great way to get started on your first project or experiment with new technologies without breaking the bank. So why not give one (or more) of these services a try and see what you can build!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>cloud</category>
      <category>programming</category>
    </item>
    <item>
      <title>How I Use Just to Quickly Organize Project-Level Commands</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Thu, 26 Jan 2023 20:34:44 +0000</pubDate>
      <link>https://dev.to/casualcoders/just-the-best-way-to-handle-project-level-scripting-k4g</link>
      <guid>https://dev.to/casualcoders/just-the-best-way-to-handle-project-level-scripting-k4g</guid>
      <description>&lt;p&gt;Have you ever had a folder full of random scripts you used for automation? Have you ever tried to use a Makefile to script things? Or even put a bunch of run options in your &lt;code&gt;package.json&lt;/code&gt; file? If so, you may have found that these tools lack the simplicity and ease-of-use that you need to automate your tasks effectively. That's where Just comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  A passive-aggressive way to run things.
&lt;/h2&gt;

&lt;p&gt;Just is a command-line tool that provides a simple and easy way to run scripts and commands. It is similar to make in that it allows you to specify dependencies between commands, but it is more focused on running scripts and commands, rather than building and compiling software.&lt;/p&gt;

&lt;p&gt;Just also provides some additional features such as parallel execution, caching, and error handling. It is designed to be easy to use and requires minimal setup, making it a useful tool for automating repetitive tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;If you have homebrew, its quite simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;just
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have rust installed its also quite easy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;just
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its also available on various other *nix and Windows &lt;a href="https://just.systems/man/en/chapter_4.html" rel="noopener noreferrer"&gt;package managers&lt;/a&gt;, and as a &lt;a href="https://just.systems/man/en/chapter_5.html" rel="noopener noreferrer"&gt;Unix binary&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;p&gt;Here's an example of a simple justfile that demonstrates how to use Just to automate a few tasks (called recipes in their docs):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="c"&gt;# Justfile
&lt;/span&gt;
&lt;span class="c"&gt;# This command runs the "clean" task before running the "build" task
&lt;/span&gt;&lt;span class="nl"&gt;build&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;clean&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Building project..."&lt;/span&gt;
    &lt;span class="c"&gt;# commands to build the project go here&lt;/span&gt;

&lt;span class="c"&gt;# This command runs the "clean" task before running the "test" task
&lt;/span&gt;&lt;span class="nl"&gt;test&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;clean&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Running tests..."&lt;/span&gt;
    &lt;span class="c"&gt;# commands to run tests go here&lt;/span&gt;

&lt;span class="nl"&gt;clean&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Cleaning project..."&lt;/span&gt;
    &lt;span class="c"&gt;# commands to clean the project go here&lt;/span&gt;

&lt;span class="c"&gt;# This command can be run independently
&lt;/span&gt;&lt;span class="nl"&gt;deploy&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Deploying project..."&lt;/span&gt;
    &lt;span class="c"&gt;# commands to deploy the project go here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can execute the tasks defined in the justfile by running the command &lt;code&gt;just &amp;lt;taskname&amp;gt;&lt;/code&gt;. For example, to run the &lt;code&gt;build&lt;/code&gt; task, you would run &lt;code&gt;just build&lt;/code&gt;. Just will automatically run any tasks that the task you're running depends on, in the order they're defined in the file.&lt;/p&gt;

&lt;p&gt;In this example, you can see that the task &lt;code&gt;build&lt;/code&gt; and &lt;code&gt;test&lt;/code&gt; depends on the task &lt;code&gt;clean&lt;/code&gt;, so if you run &lt;code&gt;just build&lt;/code&gt; or &lt;code&gt;just test&lt;/code&gt;, Just will run &lt;code&gt;clean&lt;/code&gt; before running the task you requested.&lt;/p&gt;

&lt;p&gt;You can also run the task &lt;code&gt;deploy&lt;/code&gt; independently and it doesn't have any dependencies.&lt;/p&gt;

&lt;p&gt;You can also add comments in your justfile using the &lt;code&gt;#&lt;/code&gt; character, as shown in this example.&lt;/p&gt;

&lt;p&gt;This is a simple example, but you can use Just to automate much more complex tasks and scripts.&lt;/p&gt;

&lt;p&gt;Here is an example of a script I wrote for one of my projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="c"&gt;# builds the docker image
&lt;/span&gt;&lt;span class="nl"&gt;build-docker&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
    &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail
    &lt;span class="nv"&gt;ARCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$ARCH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"aarch64"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
      &lt;span class="nv"&gt;ARCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"arm64"&lt;/span&gt;
    &lt;span class="k"&gt;fi&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$ARCH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"x86_64"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
      &lt;span class="nv"&gt;ARCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"amd64"&lt;/span&gt;
    &lt;span class="k"&gt;fi&lt;/span&gt;
    docker build &lt;span class="nt"&gt;-f&lt;/span&gt; docker/Dockerfile.&lt;span class="nv"&gt;$ARCH&lt;/span&gt; &lt;span class="nt"&gt;-t&lt;/span&gt; ceres .

&lt;span class="c"&gt;# runs the executable in docker
&lt;/span&gt;&lt;span class="nl"&gt;run-docker mode="stout"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt;
    docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 8080:8080 &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="p"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;/config:/app/config ceres &lt;span class="nt"&gt;--mode&lt;/span&gt; &lt;span class="o"&gt;{{&lt;/span&gt;mode&lt;span class="o"&gt;}}&lt;/span&gt;

&lt;span class="c"&gt;# starts the daemon. Specify mode=prod to run in production mode (without grafana)
&lt;/span&gt;&lt;span class="nl"&gt;up mode="dev"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;build-docker check&lt;/span&gt;
    docker compose &lt;span class="nt"&gt;-f&lt;/span&gt; docker/docker-compose-&lt;span class="o"&gt;{{&lt;/span&gt;mode&lt;span class="o"&gt;}}&lt;/span&gt;.yml up &lt;span class="nt"&gt;-d&lt;/span&gt;

&lt;span class="c"&gt;# shows daemon logs
&lt;/span&gt;&lt;span class="nl"&gt;logs mode="dev"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    docker compose &lt;span class="nt"&gt;-f&lt;/span&gt; docker/docker-compose-&lt;span class="o"&gt;{{&lt;/span&gt;mode&lt;span class="o"&gt;}}&lt;/span&gt;.yml logs &lt;span class="nt"&gt;-f&lt;/span&gt;

&lt;span class="c"&gt;# stops the daemon
&lt;/span&gt;&lt;span class="nl"&gt;down mode="dev"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    docker compose &lt;span class="nt"&gt;-f&lt;/span&gt; docker/docker-compose-&lt;span class="o"&gt;{{&lt;/span&gt;mode&lt;span class="o"&gt;}}&lt;/span&gt;.yml down
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With just you can add parameters to the scripts that you define, along with defaults. You can also specify an interpreter for your scripts. Bash and Zsh common ones, but I’ve even seen Python scripts written in a Justfile!&lt;/p&gt;

&lt;h2&gt;
  
  
  Good Practices
&lt;/h2&gt;

&lt;p&gt;One piece of good practice is to define the &lt;code&gt;default&lt;/code&gt; behavior, which is what happens when you run &lt;code&gt;just&lt;/code&gt; without any additional commands. Here is what I usually write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="nl"&gt;default&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    just &lt;span class="nt"&gt;--list&lt;/span&gt; &lt;span class="nt"&gt;--unsorted&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I run this in a project that has other scripts defined with comments, this is the output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;just
Available recipes:
    build                        &lt;span class="c"&gt;# builds the executable&lt;/span&gt;
    build-docker                 &lt;span class="c"&gt;# builds the docker image&lt;/span&gt;
    clean                        &lt;span class="c"&gt;# cleans the build artifacts&lt;/span&gt;
    compile                      &lt;span class="c"&gt;# alias for build&lt;/span&gt;
    default                      &lt;span class="c"&gt;# default task&lt;/span&gt;
    down &lt;span class="nv"&gt;mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"dev"&lt;/span&gt;              &lt;span class="c"&gt;# stops the daemon&lt;/span&gt;
    dump                         &lt;span class="c"&gt;# runs the executable in dump mode&lt;/span&gt;
    &lt;span class="nb"&gt;fmt&lt;/span&gt;                          &lt;span class="c"&gt;# Formats the project&lt;/span&gt;
    format                       &lt;span class="c"&gt;# Alias for fmt&lt;/span&gt;
    logs &lt;span class="nv"&gt;mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"dev"&lt;/span&gt;              &lt;span class="c"&gt;# shows daemon logs&lt;/span&gt;
    run &lt;span class="k"&gt;*&lt;/span&gt;json                    &lt;span class="c"&gt;# runs the executable in stout mode&lt;/span&gt;
    run-docker &lt;span class="nv"&gt;mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"stout"&lt;/span&gt;      &lt;span class="c"&gt;# runs the executable in docker&lt;/span&gt;
    serve                        &lt;span class="c"&gt;# runs the executable in serve mode&lt;/span&gt;
    up &lt;span class="nv"&gt;mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"dev"&lt;/span&gt;                &lt;span class="c"&gt;# starts the daemon. Specify mode=prod to run in production mode (without grafana)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hidden Tasks
&lt;/h2&gt;

&lt;p&gt;You can also hide tasks from the list output with either a leading underscore or the &lt;code&gt;[private]&lt;/code&gt; tag. Here is an example of both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="err"&gt;[private]&lt;/span&gt;
&lt;span class="nl"&gt;check&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
    &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; config/optional.json &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
      &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Optional 'optional.json' file is missing."&lt;/span&gt;
    &lt;span class="k"&gt;fi&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; config/required.json &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
      &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please add a 'required.json&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt; file.&lt;span class="s2"&gt;"&lt;/span&gt;
      &lt;span class="s2"&gt;exit 1&lt;/span&gt;
    &lt;span class="s2"&gt;fi&lt;/span&gt;

&lt;span class="nl"&gt;_helper&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"This is a hidden task"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how in the above output, these are missing? They’re in my project’s Justfile, but they’re hidden as they are utility tasks I don’t want other devs to run. &lt;/p&gt;

&lt;h2&gt;
  
  
  Silent Tasks
&lt;/h2&gt;

&lt;p&gt;If you don’t want a task to echo the commands, you can add an &lt;code&gt;@&lt;/code&gt; symbol before the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="nl"&gt;@quiet&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="c"&gt;#&lt;/span&gt;&lt;span class="nf"&gt; from the Just manual&lt;/span&gt;
  &lt;span class="err"&gt;echo&lt;/span&gt; &lt;span class="err"&gt;hello&lt;/span&gt;
  &lt;span class="err"&gt;echo&lt;/span&gt; &lt;span class="err"&gt;goodbye&lt;/span&gt;
  &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="c"&gt;# all done!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;@&lt;/code&gt; symbol can also be used to invert the echo. For example, you can use &lt;code&gt;@&lt;/code&gt; to not echo certain commands in a normal task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="nl"&gt;loud&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt;
    &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"This is a test"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope you found this blog post helpful! I found that after I was introduced to Justfiles I use them for all my scripts in my projects! How do you normally keep track of your scripts and repetitive tasks in your projects? Will you use Just from now on? Leave a comment down below telling me about it! Happy coding!&lt;/p&gt;

</description>
      <category>devmeme</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>My favorite Python packages!</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Wed, 14 Dec 2022 18:39:40 +0000</pubDate>
      <link>https://dev.to/casualcoders/my-favorite-python-packages-35c2</link>
      <guid>https://dev.to/casualcoders/my-favorite-python-packages-35c2</guid>
      <description>&lt;p&gt;Python has a rich ecosystem of packages and tools. Because of its versatility, all manner of helper packages, command line tools, and rich libraries have been built. I have been coding in Python since 2012, and I’ve seen the ecosystem grow considerably. From dependency management, database ORMs, and server solutions, here are my favorite Python packages of 2022!&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Because &lt;code&gt;datetime&lt;/code&gt; has always sucked.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://arrow.readthedocs.io/en/latest/" rel="noopener noreferrer"&gt;Arrow&lt;/a&gt; is a package that makes working with dates in Python as easy as a single line of code - and not a complicated one either. Say you have a date string from your web app, &lt;code&gt;2013-05-11T21:23:58.970460+07:00&lt;/code&gt;. This can be converted with a single line of code using arrow, with no complicated formatting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;arrow&lt;/span&gt;

&lt;span class="n"&gt;date_one_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2013-05-11T21:23:58.970460+07:00&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;date_one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date_one_str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need it as a datetime?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;date_one_dt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need the time right now?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need to convert from a datetime to an arrow time object?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;arrow_obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;datetime_obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need to get time from a string with formatting?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;arrow_obj_two&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2013-05-05 12:30:45&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;YYYY-MM-DD HH:mm:ss&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need to format your arrow object?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;date_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;YYYY-MM-DD HH:mm:ss ZZ&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# or even just
&lt;/span&gt;&lt;span class="n"&gt;date_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;# if you just want a pretty string.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need human readable strings?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;date_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;humanize&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need to shift time?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;date_two&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hours&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;minutes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# negatives are also acceptable
&lt;/span&gt;&lt;span class="n"&gt;date_three&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;years&lt;/span&gt;&lt;span class="o"&gt;=-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# timezones are also a thing
&lt;/span&gt;&lt;span class="n"&gt;date_four&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;US/Pacific&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need to get from epoch?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# arrow assumes seconds for numbers
&lt;/span&gt;&lt;span class="n"&gt;date_five&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1661268857&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# floats work too
&lt;/span&gt;&lt;span class="n"&gt;date_six&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arrow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;166126884.9243&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Tom Scott can be less &lt;a href="https://youtu.be/-5wpm-gesOY" rel="noopener noreferrer"&gt;angry about timezones&lt;/a&gt;. Or you can just use UTC like a normal dev.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenCV
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What if your programs need to see?
&lt;/h3&gt;

&lt;p&gt;Now this library is so big and versatile that I’m not giving you examples, but I will link you to some cool projects that use it. &lt;a href="https://pypi.org/project/opencv-python/" rel="noopener noreferrer"&gt;OpenCV&lt;/a&gt; is a &lt;a href="https://en.wikipedia.org/wiki/Computer_vision" rel="noopener noreferrer"&gt;computer vision&lt;/a&gt; library that was originally built for C but has wrappers for all manner of languages, with the most popular being Python. This allows you to take in video or image input from either a file, a webcam, or even a live video stream over the internet. You can then process each image using various techniques to get information from those images. Information can be as simple as an average color, or as complex as finding specific targets within the image.&lt;/p&gt;

&lt;p&gt;This &lt;em&gt;is not&lt;/em&gt; a small library, needing potentially gigabytes libraries depending on your OS configuration. It is also not the fastest when you are running big calculations, and will need heavy optimizations to keep framerates high if processing video. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/CasualCodersProjects/autoturret" rel="noopener noreferrer"&gt;Casual Coders’ Autoturret Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/1nfinityLoop/Sudoku-Solver-AI" rel="noopener noreferrer"&gt;Sudoku solver&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need some tutorials, &lt;a href="https://github.com/CasualCodersProjects/autoturret" rel="noopener noreferrer"&gt;Awesome OpenCV&lt;/a&gt; has a massive list of books and online tutorials - both free and paid - to help you get started. &lt;/p&gt;

&lt;h2&gt;
  
  
  FastAPI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  When you just need an API that’s fast.
&lt;/h3&gt;

&lt;p&gt;If you have ever worked with micro frameworks like Flask or Sinatra, you will feel right at home with &lt;a href="https://fastapi.tiangolo.com/" rel="noopener noreferrer"&gt;FastAPI&lt;/a&gt;. Built to be as fast as possible, FastAPI allows you to make all manner of Python web applications - from simple APIs to massive full stack web applications. Using Python &lt;a href="https://docs.python.org/3/library/dataclasses.html" rel="noopener noreferrer"&gt;Dataclasses&lt;/a&gt; as well as &lt;a href="https://docs.python.org/3/library/typing.html" rel="noopener noreferrer"&gt;type hinting&lt;/a&gt;, it can make your API as close to idiot proof as possible. It even has support for OpenAPI, as well as auto generated documentation. Here an example of a super minimal FastAPI application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;root&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello World&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! Python dictionaries are automatically converted to valid JSON objects when returned. &lt;/p&gt;

&lt;h2&gt;
  
  
  SQLModel
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Now you can make APIs, how about some data to serve?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://sqlmodel.tiangolo.com/" rel="noopener noreferrer"&gt;SQLModel&lt;/a&gt; is a library for interacting with SQL databases from Python code, using Python objects. It is designed to be intuitive, easy-to-use, highly compatible, and robust. It is powered by &lt;a href="https://pydantic-docs.helpmanual.io/" rel="noopener noreferrer"&gt;Pydantic&lt;/a&gt; and &lt;a href="https://sqlalchemy.org/" rel="noopener noreferrer"&gt;SQLAlchemy&lt;/a&gt; and relies on Python type annotations for maximum simplicity. The key features are: it's intuitive to write and use, highly compatible, extensible, and minimizes code duplication. The library does a lot of the work under the hood to make writing code easier and eliminate the need to duplicate models in SQLAlchemy and Pydantic.&lt;/p&gt;

&lt;p&gt;Its compatibility with Pydantic means that any models you write for SQLModel also natively work with FastAPI! Here are some snippets from the official docs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sqlmodel&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SQLModel&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Hero&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SQLModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;secret_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is an example of using FastAPI with SQLModel.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sqlmodel&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SQLModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;create_engine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;select&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Hero&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SQLModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;secret_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;sqlite_file_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;database.db&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;sqlite_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sqlite:///&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;sqlite_file_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="n"&gt;connect_args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;check_same_thread&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_engine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sqlite_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;echo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;connect_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;connect_args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_db_and_tables&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;SQLModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@app.on_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;startup&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_startup&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;create_db_and_tables&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/heroes/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_hero&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hero&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Hero&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hero&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hero&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;hero&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/heroes/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;read_heroes&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;heroes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Hero&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;heroes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They’re a perfect pairing for any sort of CRUD application written in Python!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Do you have any Python packages you use daily? Let me know in the comments! Thanks for reading!&lt;/p&gt;

</description>
      <category>python</category>
      <category>tooling</category>
      <category>opensource</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to use Object Oriented Programming in Go</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Tue, 13 Dec 2022 22:36:49 +0000</pubDate>
      <link>https://dev.to/casualcoders/how-to-use-object-oriented-programming-in-go-bh9</link>
      <guid>https://dev.to/casualcoders/how-to-use-object-oriented-programming-in-go-bh9</guid>
      <description>&lt;p&gt;Go is not an Object Oriented Programming language. It is definitely aimed more at the functional crowd, as its support for OOP is lacking at best, preferring C-style structs that can have methods attached to the more traditional style of OOP that Java, Javascript, Python, and C++ support. &lt;/p&gt;

&lt;h2&gt;
  
  
  How would I get started?
&lt;/h2&gt;

&lt;p&gt;To create a class in Go, you can use the type keyword, followed by the name of the class, and then the struct that represents the data for the class. Here is an example of a simple class called Person that has two fields, name and age:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
  &lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then create an instance of this class by using the new keyword, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To set the values of the fields in the class, you can use the dot notation, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;
&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also create a class with methods, which are functions that are associated with a specific class. Here is an example of a Person class with a greet method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
  &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Greet&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Hello, my name is "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can call the greet method on an instance of the Person class like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;
&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;

&lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Greet&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;  &lt;span class="c"&gt;// Output: "Hello, my name is John"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just like when writing other types of functions in Go, capital letters signify public functions that can be called externally. The same goes for the attributes of the struct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Constructor? I barely know her!
&lt;/h2&gt;

&lt;p&gt;There is no concept of a constructor method in Go.&lt;/p&gt;

&lt;p&gt;I like defining defaults as much as the next OOP programmer, and the easiest (and only) way to do it in Go is using a factory method that returns a new instance of said "class" (struct).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
  &lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;NewPerson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
  &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What about my inheritance?
&lt;/h2&gt;

&lt;p&gt;In Go, class inheritance works by allowing type embedding. Type embedding allows you to use one type as a part of another type. This is similar to class inheritance in other languages, but instead of subclassing one type from another, a type is embedded inside another type. This allows the embedded type to inherit the properties and methods of the containing type. Type embedding is a powerful technique that can be used to create complex types with a lot of functionality.&lt;/p&gt;

&lt;p&gt;Let's say we have a type "Vehicle" and a type "Car" which embeds Vehicle. Car will inherit all the properties and methods of Vehicle, as well as any additional ones it may have. So, for example, if Vehicle has a "Drive()" method, Car will also have this method. This allows us to reuse code and create complex types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Vehicle&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Wheels&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Vehicle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Drive&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Driving"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Vehicle&lt;/span&gt;
    &lt;span class="n"&gt;Doors&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Drive&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can override the &lt;code&gt;Drive()&lt;/code&gt; function by making a new one but instead of passing in a pointer to a vehicle, you do a pointer to a Car.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Drive&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Driving on a road"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not the same for attributes (in this case &lt;code&gt;Doors&lt;/code&gt; for the Car and &lt;code&gt;Wheels&lt;/code&gt; for both). If we want to set the number of wheels on the Car, we will need to create an instance of Vehicle in the Car. Here is an example factory function that does just that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;NewCar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doors&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Car&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="n"&gt;Vehicle&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Wheels&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
       &lt;span class="n"&gt;Doors&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;doors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// and if we want to access the Wheels on the Car&lt;/span&gt;
&lt;span class="n"&gt;mustang&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;NewCar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"A car has "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mustang&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Vehicle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Wheels&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One more thing of note, pointers allow more control with the structs than using by value, so always try to use a pointer when working with classes in Golang.&lt;/p&gt;

&lt;p&gt;I hope this tutorial helped. Question? Comments? Concerns? Leave them below!&lt;/p&gt;

</description>
      <category>go</category>
      <category>oop</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Create and Push a New Git Repo to GitHub</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Thu, 08 Dec 2022 13:00:00 +0000</pubDate>
      <link>https://dev.to/casualcoders/how-to-create-and-push-a-new-git-repo-to-github-3j15</link>
      <guid>https://dev.to/casualcoders/how-to-create-and-push-a-new-git-repo-to-github-3j15</guid>
      <description>&lt;p&gt;To create a new Git repository locally and commit all files, you will need to have Git installed on your computer. If you don't have Git installed, you can download it from the &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;official website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have Git installed, follow these steps to create a new repository and commit all files:&lt;/p&gt;

&lt;p&gt;Open a terminal or command prompt and navigate to the directory where you want to create the Git repository.&lt;/p&gt;

&lt;p&gt;Run the following command to initialize the repository:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This will create a new .git directory in the current directory, which will be used to store all the version control information for your project.&lt;/p&gt;

&lt;p&gt;If you don't have any files to commit, make an example file called &lt;code&gt;README.md&lt;/code&gt; and add The title of your project preceded by a hashtag (or pound symbol if you prefer the classical term) along with a short description of your project a few lines below. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# This is a markdown title&lt;/span&gt;

This is a markdown paragraph.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have some files, you can add them to the repo.&lt;/p&gt;

&lt;p&gt;Add all the files you want to include in the repository by running 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 add .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will add all the files in the current directory and its subdirectories to the repository. You can also specify individual files to be added by replacing the . with the file names, separated by spaces.&lt;/p&gt;

&lt;p&gt;Once all the files are added, you can commit them to the repository by running 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 commit -m "Initial commit"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create the first commit in the repository, which will include all the files that were added in the previous step. The &lt;code&gt;-m&lt;/code&gt; flag is used to specify a commit message, which should briefly describe the changes that were made in this commit.&lt;/p&gt;

&lt;p&gt;To create a new empty Git repository on Github, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Log in to your Github account and go to the Github homepage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the plus icon in the top right corner of the page, and select "New repository" from the dropdown menu.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fuploads%2Farticles%2F24jx7wdvtug0hhue4sq3.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%2Fuploads%2Farticles%2F24jx7wdvtug0hhue4sq3.png" alt="New Repo Button" width="255" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;On the next page, enter a name for your repository in the "Repository name" field. This should be a short and descriptive name that accurately reflects the contents of the repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the "Description" field, you can enter a longer description of the repository if you want. This is optional, but it can be helpful to provide more information about the purpose of the repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can set the visibility to whatever you prefer. If you want others to be able to see your work, set it to "Public". Otherwise, set it to "Private".&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fuploads%2Farticles%2Fxg3hw4rgzeuwy5bhm9rk.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%2Fuploads%2Farticles%2Fxg3hw4rgzeuwy5bhm9rk.png" alt="New Repo Page" width="759" height="754"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Leave the "Initialize this repository with a README" option unchecked, as we want to create an empty repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the "Create repository" button to create the repository.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fuploads%2Farticles%2F2wacs02vdct428oiyv7s.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%2Fuploads%2Farticles%2F2wacs02vdct428oiyv7s.png" alt="Empty Repo Page" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your new empty repository will be created and you will be taken to the repository page. From there you can copy the project URL (usually ending in &lt;code&gt;.git&lt;/code&gt;) and push your local changes to it.&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%2Fuploads%2Farticles%2Fvcmsuovx7pab4b6tv0gu.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%2Fuploads%2Farticles%2Fvcmsuovx7pab4b6tv0gu.png" alt="Clone URL" width="800" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the following command to add the remote, replacing &lt;code&gt;&amp;lt;github_project_url&amp;gt;&lt;/code&gt; with the URL of the Github project you copied:&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 origin &amp;lt;github_project_url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will add the remote to your local repository. You can verify that the remote was added successfully by running 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;p&gt;This will list all the configured remotes for the repository, along with their URLs. The remote you added should be included in the list.&lt;/p&gt;

&lt;p&gt;Once the remote is added, you can push your local commits to it by running 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 push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git should prompt you to log in. Enter your GitHub username and password in the prompt window.&lt;/p&gt;

&lt;p&gt;This will push all the local commits on the main branch to the remote repository.&lt;/p&gt;

&lt;p&gt;If you add any additional files, you will need to run &lt;code&gt;git add .&lt;/code&gt; again. After you make any additional changes, simply repeat the steps of &lt;code&gt;git commit&lt;/code&gt; and &lt;code&gt;git push&lt;/code&gt;, but be sure to change the message (the part within the quotations) to reflect what you did. Messages should be short and concise, with a general rule of thumb to be to keep them less than 50 characters. For example, "Add new function x" would be acceptable. &lt;/p&gt;

&lt;p&gt;Was this helpful? Let us know in the comments below!&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Scary AI, Linux, and Simping For Elon | Casual Coders Podcast</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Wed, 07 Dec 2022 16:38:16 +0000</pubDate>
      <link>https://dev.to/casualcoders/scary-ai-linux-and-simping-for-elon-casual-coders-podcast-4jlk</link>
      <guid>https://dev.to/casualcoders/scary-ai-linux-and-simping-for-elon-casual-coders-podcast-4jlk</guid>
      <description>&lt;p&gt;&lt;iframe src="https://open.spotify.com/embed/episode/6EXI22si9Ki3RupJWHk0oF" width="100%" height="232px"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This week on the Casual Coders Podcast, we discuss ChatGPT, Linux, Twitter, and Neuralink!&lt;/p&gt;

&lt;p&gt;Follow Casual Coders:&lt;/p&gt;

&lt;p&gt;Twitter | &lt;a href="https://twitter.com/CasualCoders" rel="noopener noreferrer"&gt;https://twitter.com/CasualCoders&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Facebook| &lt;a href="https://www.facebook.com/CasualCodersProjects" rel="noopener noreferrer"&gt;https://www.facebook.com/CasualCodersProjects&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TikTok | &lt;a href="https://www.tiktok.com/@casualcoders" rel="noopener noreferrer"&gt;https://www.tiktok.com/@casualcoders&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Twitch | &lt;a href="https://www.twitch.tv/casualcoders" rel="noopener noreferrer"&gt;https://www.twitch.tv/casualcoders&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Insta | &lt;a href="https://www.instagram.com/casualcodersprojects/" rel="noopener noreferrer"&gt;https://www.instagram.com/casualcodersprojects/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;YouTube | &lt;a href="https://www.youtube.com/channel/UCmkQBj1JyI0x53fn81L-EbA" rel="noopener noreferrer"&gt;https://www.youtube.com/channel/UCmkQBj1JyI0x53fn81L-EbA&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mac</category>
      <category>machinelearning</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Supporting USB C to C Charging and Data Transfer</title>
      <dc:creator>Ian</dc:creator>
      <pubDate>Mon, 05 Dec 2022 22:31:09 +0000</pubDate>
      <link>https://dev.to/casualcoders/supporting-usb-c-to-c-charging-and-data-transfer-5c0m</link>
      <guid>https://dev.to/casualcoders/supporting-usb-c-to-c-charging-and-data-transfer-5c0m</guid>
      <description>&lt;p&gt;Have you ever had a device that has a USB Type C port on it, but it doesn't seem to charge using USB C to C cables? This seems to be a common problem to us. Just the other day, we were filming and attempting to recharge one of our microphones, and we were unable to use the USB type C Power Delivery brick that was sitting right in front of us. This is truly infuriating, especially once you know the answer. Today, we're going to dive into the USB Type C Legacy Device specification.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Physical Connectors
&lt;/h2&gt;

&lt;p&gt;The most barebones physical USB C connection, USB 2.0, has twelve pins. MicroUSB has five. &lt;br&gt;
This could be a point of confusion for new or inexperienced designers using USB Type C for the first time. One may simply assume that you can connect the pins straight through, as you would for MicroUSB, and that it will work just fine. And, if they haven't tested thoroughly, they may find this to be the case. To support USB A to C, you need only connect Voltage, Ground, and USB Data. However, upon connecting a USB C to C cable, you'll find exactly zero volts at the output. This is because the USB C controller has no idea that anything was just plugged in at all, so it won't provide power, even if the device has it's USB Data lines connected.&lt;/p&gt;

&lt;h2&gt;
  
  
  The CC Lines
&lt;/h2&gt;

&lt;p&gt;This is where the CC lines come in. The UCB C controller uses the CC lines to establish the protocol with which to communicate with the connected device. For our purposes, this will be a power delivery request for 5v, 9v, 12v, or 20v [with 48v soon to come]. This requires an extra integrated circuit, or microcontroller to establish this communication though. For legacy devices where a simple 5v is needed however, you can simply stick two 5.1k Ohm pull-down resistors on the CC lines. Each line needs it's own resistor, as the specification uses these lines to determine the 'direction' the plug was inserted. This tells the controller that it's communicating to a legacy device and that it needs to provide 5v up to 1.5A or 3A depending on the source's capabilities.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iJxV4276--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spwkn116nwl880deq5hl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iJxV4276--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spwkn116nwl880deq5hl.png" alt="Image description" width="787" height="1034"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;And of course, what does this cost? Literally nothing. For a mere 100 5.1k Ohm resistors, we pay the unit price of &lt;strong&gt;$0.0004&lt;/strong&gt;. That's $0.04 for the entire order. Each device needs two of these resistors, so we've spent less than a &lt;strong&gt;&lt;em&gt;single cent&lt;/em&gt;&lt;/strong&gt; to support the proper USB C legacy specification. This allows both USB A to C cables, and USB C to C cables to charge our connected device. If there's one thing you take away from this, PLEASE include those two tiny resistors in any of your designs that use USB C for charging. And Please, Let's get rid of MicroUSB entirely. We want one cable to rule them all.&lt;/p&gt;

</description>
      <category>hardware</category>
      <category>usb</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Create and Edit GitHub Issues &amp; PRs</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Mon, 05 Dec 2022 22:17:56 +0000</pubDate>
      <link>https://dev.to/casualcoders/how-to-create-and-edit-github-issues-prs-30pj</link>
      <guid>https://dev.to/casualcoders/how-to-create-and-edit-github-issues-prs-30pj</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; is a powerful platform for collaborating on code, and it is essential to understand how to create and edit pull requests and issues in order to take full advantage of its features.&lt;/p&gt;

&lt;p&gt;Creating and editing issues and pull requests on GitHub is an essential part of the development process. Issues and pull requests allow developers to collaborate and communicate with one another, as well as to track and plan tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Issues
&lt;/h2&gt;

&lt;p&gt;A GitHub issue is a feature of GitHub that allows users to create and track tasks or problems related to a repository. Issues can be used to track feature requests, bug reports, and other project-related topics. They are also a great way to discuss ideas, find solutions, and collaborate with other users. Issues can be assigned to team members, labeled, and sorted into different categories. Using GitHub issues is an effective way to keep track of the progress of a project and ensure that all tasks are completed on time.&lt;/p&gt;

&lt;p&gt;To create an issue on GitHub, simply navigate to the repository where you wish to create the issue and click the “Issues” tab. &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%2Fuploads%2Farticles%2F43e4jphbqcs65jofuavr.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%2Fuploads%2Farticles%2F43e4jphbqcs65jofuavr.png" alt="GitHub Tabs" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, click the green “New Issue” button and fill out the form with a descriptive title and detailed description. Once you have completed the form, click the “Submit new issue” button.&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%2Fuploads%2Farticles%2Frj8pdz8jou0u6elnqv5w.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%2Fuploads%2Farticles%2Frj8pdz8jou0u6elnqv5w.png" alt="New Issue Button" width="800" height="404"&gt;&lt;/a&gt;&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%2Fuploads%2Farticles%2Fkmuo24bp85yxuzto0pwx.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%2Fuploads%2Farticles%2Fkmuo24bp85yxuzto0pwx.png" alt="Example Issue" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To edit an existing issue, click on the issue you wish to edit and then click the “Edit” button in the upper right corner of the page. Make any desired changes, then click the “Submit” button.&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%2Fuploads%2Farticles%2Fva1pi2un6fk3gvw9var6.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%2Fuploads%2Farticles%2Fva1pi2un6fk3gvw9var6.png" alt="Issue Edit Button" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pull Requests
&lt;/h2&gt;

&lt;p&gt;A GitHub pull request (commonly referred to as simply a “PR”) is a way for developers to collaborate on a project. It allows a developer to submit changes to a project which can then be reviewed and approved by other developers. This is useful for ensuring that only quality code is merged into the main project, and for keeping track of changes and progress. Pull requests also make it easier for developers to track their own contributions to a project. By using pull requests, developers can quickly and easily collaborate on a project in a secure and organized manner.&lt;/p&gt;

&lt;p&gt;Creating and editing pull requests is similar to creating and editing issues. To create a pull request, navigate to the repository where you wish to create the pull request and click the “Pull Requests” tab. Then, click the green “New pull request” button and fill out the form. Once you have completed the form, click the “Create pull request” button.&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%2Fuploads%2Farticles%2Fvd02n4hsoi462wzahrs7.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%2Fuploads%2Farticles%2Fvd02n4hsoi462wzahrs7.png" alt="New Pull Request button" width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Editing a pull request is much like editing an Issue. To edit an existing pull request, click on the pull request you wish to edit and then click the “Edit” button in the upper right corner of the page. Make any desired changes, then click the “Update comment” button.&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%2Fuploads%2Farticles%2F23i8cxq49ktavuvml3m7.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%2Fuploads%2Farticles%2F23i8cxq49ktavuvml3m7.png" alt="What editing an issue or a PR looks like" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the help of issues and pull requests, developers are able to collaborate and communicate effectively. Creating and editing these items is a simple process, and can help streamline the development process.&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>How to Clone, Commit, and Push to a Git Repo</title>
      <dc:creator>Chandler</dc:creator>
      <pubDate>Fri, 02 Dec 2022 21:29:17 +0000</pubDate>
      <link>https://dev.to/casualcoders/git-beginner-crash-course-3ggk</link>
      <guid>https://dev.to/casualcoders/git-beginner-crash-course-3ggk</guid>
      <description>&lt;p&gt;Cloning a git repo is one of the first steps to getting started with a new project or working on an existing project. It allows you to download a copy of an existing repository from a remote server and start making modifications. In this article, we'll go over how to clone a git repo, create a new branch, commit to the new branch, and then push the branch to the remote server. For this example we will use &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; as the remote server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloning the Repo
&lt;/h2&gt;

&lt;p&gt;To begin, open your terminal and navigate to the directory where you want to clone the git repo. Then, run the following command, replacing “[repo name]” with the name of the repository you want to clone. An example of a repo name is &lt;code&gt;chand1012/blog&lt;/code&gt; .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/[repo name].git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will download the entire repository to your local machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a New Branch
&lt;/h2&gt;

&lt;p&gt;Next, you'll want to create a new branch to work on. A branch can be thought of as a slightly different version of the source code that has the same starting history. The ultimate goal is to eventually merge the new branch back into the primary branch, usually called “main” or “master”. To do this, run the following command from within the repository's directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;branch name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace “[branch name]” with the name you'd like to give your new branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding &amp;amp; Committing Files
&lt;/h2&gt;

&lt;p&gt;Now, you can start making changes to the repository and committing them to the new branch. To do this, first make your changes, then run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nt"&gt;-A&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the files have been added, you can commit the changes with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"[message]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace “[message]” with a brief description of your changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pushing the Branch
&lt;/h2&gt;

&lt;p&gt;Finally, you can push the new branch to the remote server with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin &lt;span class="o"&gt;[&lt;/span&gt;branch name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace “[branch name]” with the name of your new branch.&lt;/p&gt;

&lt;p&gt;And that's it! You've successfully cloned a git repo, created a new branch, committed to the new branch, and pushed the branch to the remote server.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
