<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: ryan</title>
    <description>The latest articles on Forem by ryan (@ry444nn).</description>
    <link>https://forem.com/ry444nn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F596906%2F095d2ea8-e3ad-4b98-8faa-e42241c09d90.jpeg</url>
      <title>Forem: ryan</title>
      <link>https://forem.com/ry444nn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ry444nn"/>
    <language>en</language>
    <item>
      <title>Git, Beginner to Master!</title>
      <dc:creator>ryan</dc:creator>
      <pubDate>Wed, 26 Nov 2025 07:01:43 +0000</pubDate>
      <link>https://forem.com/ry444nn/git-beginner-to-master-1i8n</link>
      <guid>https://forem.com/ry444nn/git-beginner-to-master-1i8n</guid>
      <description>&lt;p&gt;Videos for this topic can be viewed on my &lt;a href="https://www.youtube.com/@ry444nn" rel="noopener noreferrer"&gt;Youtube channel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything here is available on &lt;a href="https://github.com/Danesh-CS-Club/git-lecture" rel="noopener noreferrer"&gt;Github&lt;/a&gt; i'd love a star ;)&lt;/p&gt;

&lt;h1&gt;
  
  
  Git Command Reference Guide
&lt;/h1&gt;




&lt;p&gt;Terminology used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;origin&lt;/code&gt;: the default name git gives to the remote repository you cloned from (origin = &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;https://github.com/&lt;/a&gt;...)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tracked&lt;/code&gt;: when &lt;code&gt;git add&lt;/code&gt; is used&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;staged&lt;/code&gt;: when &lt;code&gt;git commit&lt;/code&gt; is used&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;linear&lt;/code&gt;: meaning commits follow a linear pattern like &lt;code&gt;A -- B -- C -- D&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;non-linear&lt;/code&gt;: meaning commits don't follow a linear order&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A -- B -- C
      \ 
       D -- E
            \
             M   (merge commit)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fgli15o4ii881untb59is.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%2Fgli15o4ii881untb59is.png" alt=" " width="800" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to write good commits:
&lt;/h2&gt;

&lt;p&gt;When applied, this commit with ___.&lt;/p&gt;

&lt;p&gt;Try and explain everything you do in this format, if its clear and makes the commit!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Repository Initialization
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1.1 Initialize Repository
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--initial-branch&lt;/code&gt;: sets the initial branch in a newly created repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creates an empty git repository - basically a &lt;code&gt;.git&lt;/code&gt; directory with sub-directories.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Basic Operations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 Check Status
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt; &lt;em&gt;NONE&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows the difference between the staged area and working directory (the HEAD commit and the index file)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;See modified, staged, and untracked files. &lt;br&gt;
Whats staged but not committed?&lt;/p&gt;
&lt;h3&gt;
  
  
  2.2 View Changes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git diff&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--staged&lt;/code&gt; is staged changes that have not yet been committed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-w&lt;/code&gt; ignore the white spacce&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Compared the changes made in your working directory to the staged directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Whats changed but not staged?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git show&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;HASH ID&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Show changes made in a commit&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Staging and Committing
&lt;/h2&gt;
&lt;h3&gt;
  
  
  3.1 Tracking Files
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git add &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-p&lt;/code&gt; / &lt;code&gt;--patch&lt;/code&gt; hunks specific code to add them to the index. Gives you a chance to review the difference before adding modified contents to the index.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Adds files to be tracked.&lt;/p&gt;
&lt;h3&gt;
  
  
  3.2 Commit Changes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git commit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;NONE&lt;/em&gt; an interactive environment, allows for setting long-descriptions by using an empty space&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-m "&amp;lt;message&amp;gt;"&lt;/code&gt; adds a message describing the commit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-a "&amp;lt;message&amp;gt;"&lt;/code&gt; does a &lt;code&gt;git add .&lt;/code&gt; and provides an interactive environment.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-am "&amp;lt;message&amp;gt;"&lt;/code&gt; just like above but also does a &lt;code&gt;git add .&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-p&lt;/code&gt; exactly like &lt;code&gt;git add -p&lt;/code&gt; just remember not to do a &lt;code&gt;git add&lt;/code&gt; before&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--amend&lt;/code&gt; allows you to edit commit message, and adds the most recent changes to your latest commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Commits staged files and records a snapshot of the project.&lt;/p&gt;

&lt;p&gt;A git commit should only be selective and include relevant changes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Saving a stable point, to revert back to in the future.&lt;/p&gt;
&lt;h3&gt;
  
  
  3.3 View Commit History
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git log&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--oneline&lt;/code&gt; exactly what the name says (keeps simplicity by including commit hash and message)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--graph&lt;/code&gt; graphs logs in a horizontal format&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--oneline --graph&lt;/code&gt; a simplified graph&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-p&lt;/code&gt; logs actual changes in a file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--no-merges&lt;/code&gt; removes the merge commits&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--decorate&lt;/code&gt; decorates with merge commits, branches, tags&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--parents&lt;/code&gt; shows parents of each commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for (commit/s) filters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--grep&lt;/code&gt; for message&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--after&lt;/code&gt; and &lt;code&gt;--before&lt;/code&gt; for dates&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--author&lt;/code&gt; by the author&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--&lt;/code&gt; for a specific file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;to compare:&lt;br&gt;
&lt;code&gt;git log feature/login..main&lt;/code&gt; all commits that are in main but not in feature/login&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows a timeline of project changes and commits.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. Branching
&lt;/h2&gt;
&lt;h3&gt;
  
  
  4.1 Manage Branches
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git branch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;NONE&lt;/em&gt; creates a new branch&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-a&lt;/code&gt; shows all the branches&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-m&lt;/code&gt; renames a branch&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;branch/subbranch&lt;/code&gt; adds sub-branches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Managing branches in a repository&lt;/p&gt;

&lt;p&gt;Long-running branches are branches that have been in the complete life-cycle. You mirror this structure (used for releasing code)&lt;/p&gt;

&lt;p&gt;Short-lived branches for new features, bug fix and refactoring&lt;/p&gt;
&lt;h3&gt;
  
  
  4.2 Switch Branches
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git checkout&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;hash | commit id&amp;gt;&lt;/code&gt; checkout to a specific hash&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;branch&amp;gt;&lt;/code&gt; checkout a branch&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;tags&amp;gt;&lt;/code&gt; checkout to a tag&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-b&lt;/code&gt; creates a branch and switches automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Switch to a commit, branch, or tag.&lt;/p&gt;


&lt;h2&gt;
  
  
  5. Remote Repositories
&lt;/h2&gt;
&lt;h3&gt;
  
  
  5.1 Add Remote
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git remote add&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;origin-name&amp;gt; &amp;lt;url&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Links your local repository to a remote one&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  5.2 Fetch Changes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git fetch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--depth&lt;/code&gt; to set how deep its history will go&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Downloads objects and refs from a remote without merging&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check for updates but don't touch my files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git fetch origin
git log main..origin/main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5.3 Pull Changes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git pull&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;origin&amp;gt; &amp;lt;branch&amp;gt;&lt;/code&gt;
&lt;code&gt;--rebase&lt;/code&gt; solve merge conflicts, meaning git will first pull changes, then reapply your unpushed commits on top of the latest version of the remote branch (no need to merge).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Acts exactly like fetch but also merges (or rebase) the two repositories&lt;/p&gt;

&lt;h3&gt;
  
  
  5.4 Push Changes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git push&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;origin&amp;gt; &amp;lt;branch&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--set-upstream&lt;/code&gt; / &lt;code&gt;-u&lt;/code&gt; flags a local branch to a remote branch. (acts more as a setting option, set it once and forget about it, it links your &lt;code&gt;branch&lt;/code&gt; to the &lt;code&gt;origin/branch&lt;/code&gt;)
-&lt;code&gt;--tags&lt;/code&gt; push all the tags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Uploads the local repository with the staged changes to the remote&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Integrating Changes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  6.1 Merge Branches
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git merge&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;branch&amp;gt;&lt;/code&gt; specifies the branch to merge from&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--no-ff&lt;/code&gt; prevents git from making a linear history (no-fast-forward)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Combines two branches into one&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Merge is additive meaning history is preserved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fast forwarding:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the terminology, i mentioned that we have two types of repositories, linear and non-linear. This same concept can be applied to git merge, a linear merge will have all the commits after the commit, otherwise it git will keep the current branch and make a new commit with the branch creating a non-linear history. &lt;/p&gt;

&lt;p&gt;This is useful when we have a collection of closely related branches.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.2 Rebase
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git rebase&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;branch&amp;gt;&lt;/code&gt; specifies the branch to rebase from&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-i&lt;/code&gt; provides an interactive setup for rebasing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Reapplies commits on top of another branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clean up local commit history. Rebase is reconstructive meaning history is rewritten.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 Cherry-pick
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git cherry-pick&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;commit-hash&amp;gt;&lt;/code&gt; the hash of the commit you want to cherry pick&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;hash1&amp;gt; &amp;lt;hash2&amp;gt; &amp;lt;hash3&amp;gt;&lt;/code&gt; / &lt;code&gt;A..B&lt;/code&gt; for selecting multiple hashes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Copies a specific commit from one branch and applies it onto the current branch. Notes that it duplicates commits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you've mistakenly committed to the wrong branch you use cherry-pick to revert.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Undoing Changes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  7.1 Reset
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git reset&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--hard&lt;/code&gt; completely discards commits and changes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--soft&lt;/code&gt; uncommit changes but keep them staged (moves HEAD back to a previous commit).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--mixed&lt;/code&gt; uncommit and unstage changes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;commit&amp;gt;&lt;/code&gt; you can also do some cool stuff like &lt;code&gt;HEAD~1&lt;/code&gt; meaning last commit from head&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Resets branch to a specific commit&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You committed too early or made a typo in the message.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Revert
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git revert&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;commit-hash&amp;gt;&lt;/code&gt; the hash of the commit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-n&lt;/code&gt; tells git only to look at the changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creates a new commit that undoes changes from a previous one while keeping history intact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You pushed a commit that breaks stuff, you cant change history so you revert it instead.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Temporary Storage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  8.1 Stash Changes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git stash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-p&lt;/code&gt; stash only some files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;list&lt;/code&gt; view saved stashes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apply {stash}&lt;/code&gt; reaply a stash&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;br&gt;
Temporarily saves uncommitted changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;
You've made new changes yet need to prioritize something new, without committing save your code and commit later.&lt;/p&gt;


&lt;h2&gt;
  
  
  9. Conflict Resolution
&lt;/h2&gt;
&lt;h3&gt;
  
  
  9.1 Merge Tool
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git mergetool&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt; &lt;em&gt;NONE&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Launches a graphical or diff tool to help resolve merge conflicts.&lt;/p&gt;


&lt;h2&gt;
  
  
  10. Recovery and History
&lt;/h2&gt;
&lt;h3&gt;
  
  
  10.1 Reference Log
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git reflog&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt; &lt;em&gt;NONE&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Acts as gits "undo history", meaning even if you have rebased or reset you can see where your branch used to point&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You mistakenly delete a branch, you can use reflog to get the hash and checkout back to it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout def5678
git reset --hard def5678
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  11. Submodules
&lt;/h2&gt;

&lt;h3&gt;
  
  
  11.1 Manage Submodules
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git submodule&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;add &amp;lt;repository&amp;gt;&lt;/code&gt; self explanatory&lt;br&gt;
&lt;code&gt;update --remote&lt;/code&gt; pull all the latest versions of the submodules&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A git repository inside another git repository.&lt;/p&gt;

&lt;p&gt;FYI: when others clone your repo they should also initialize your submodules with &lt;code&gt;submodule init&lt;/code&gt; or &lt;code&gt;clone --recurse-submodules&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Also submodules track commits and not branches (meaning when you clone a repository it goes to the exact commit at where the submodules was added, yet in web based github it opts to look at the default branch)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When wanting to use other repositories in your current repository you can have it set as a submodule&lt;/p&gt;




&lt;h2&gt;
  
  
  12. Working Trees
&lt;/h2&gt;

&lt;h3&gt;
  
  
  12.1 Manage Worktrees
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git worktree&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;list&lt;/code&gt; shows all the worktrees&lt;br&gt;
&lt;code&gt;remove ../&lt;/code&gt; removes a worktree&lt;br&gt;
&lt;code&gt;add ../ -b new-branch&lt;/code&gt; adds a worktree&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Allows for having multiple working directories for a single git repository. It allows for multiple workspaces in the same repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You want to work on multiple branches without having to switch all the time&lt;/p&gt;




&lt;h2&gt;
  
  
  13. Configuration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  13.1 Configure Git
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--global alias.l "log --oneline --graph"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;
Easily set aliases for commands you use all the time but don't want to type out the whole name&lt;/p&gt;




&lt;h2&gt;
  
  
  14. Tagging
&lt;/h2&gt;

&lt;h3&gt;
  
  
  14.1 Manage Tags
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git tag&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NONE&lt;/em&gt; lists all the tags&lt;br&gt;
&lt;code&gt;v1.0&lt;/code&gt; a pointer to the latest commit&lt;br&gt;
&lt;code&gt;v1.0 &amp;lt;hash&amp;gt;&lt;/code&gt; to a commit in the past&lt;br&gt;
&lt;code&gt;-a v1.0 -m "&amp;lt;message&amp;gt;"&lt;/code&gt; includes metadata&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A git tag is a pointer to a specific commit in git.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Acts like a sticky note like releases and milestones. They don't move after they're created.&lt;/p&gt;




&lt;h2&gt;
  
  
  15. Cleaning
&lt;/h2&gt;

&lt;h3&gt;
  
  
  15.1 Clean Untracked Files
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git clean&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-n&lt;/code&gt; show only what would be deleted&lt;br&gt;
&lt;code&gt;-f&lt;/code&gt; actually delete the files&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;br&gt;
Removes untracked files from your currently working directory&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;
Remove artifacts, temp files, and debug outputs.&lt;/p&gt;




&lt;h2&gt;
  
  
  16. Cloning
&lt;/h2&gt;

&lt;h3&gt;
  
  
  16.1 Clone Repository
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git clone&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--depth&lt;/code&gt;: add depth for the history of the repository&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;br&gt;
Cloning a repository&lt;/p&gt;




&lt;h2&gt;
  
  
  17. Bisect
&lt;/h2&gt;

&lt;h3&gt;
  
  
  17.1 Bisect Commits
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git bisect&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt; start the bisect&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bad &amp;lt;hash&amp;gt;&lt;/code&gt; mark the bad comit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;good &amp;lt;hash&amp;gt;&lt;/code&gt; mark the good commit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reset&lt;/code&gt; finish when the bisect is done&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;br&gt;
Helps you find a specific commit that introduced a bug in the code using binary search.&lt;/p&gt;




</description>
      <category>git</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>Lets do dates properly</title>
      <dc:creator>ryan</dc:creator>
      <pubDate>Fri, 02 Aug 2024 20:36:24 +0000</pubDate>
      <link>https://forem.com/ry444nn/lets-do-dates-properly-4e2o</link>
      <guid>https://forem.com/ry444nn/lets-do-dates-properly-4e2o</guid>
      <description>&lt;p&gt;As a beginner one of the most interesting topics you’ll learn are Dates. Even though it might sound a bit boring, it's one of the key things you might know; from your Database, API, GUI, and more learning how to deal with dates properly is a key factor in writing good applications. &lt;/p&gt;

&lt;h1&gt;
  
  
  Before we start
&lt;/h1&gt;

&lt;p&gt;An important detail you must remember is Java was rushed for the web, thus you have a lot of quirky and somewhat stupid ways to do stuff. The goal of this guide will be to teach you how to use the latest Java APIs to write efficient good code. I’ll aim to teach you how not to code anything hard and rather use standardized ISO for a scalable application. &lt;/p&gt;

&lt;h1&gt;
  
  
  How to work with Dates
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Date API
&lt;/h2&gt;

&lt;p&gt;As of &lt;code&gt;Java 8 SE&lt;/code&gt; with the release of the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html" rel="noopener noreferrer"&gt;Date Class&lt;/a&gt; defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The class &lt;code&gt;Date&lt;/code&gt; represents a specific instant in time, with millisecond precision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Also further on we had the addition of the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html" rel="noopener noreferrer"&gt;Abstract Calender Class&lt;/a&gt; (with significant upgrade with JDK 1.1) defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;Calendar&lt;/code&gt; class is an abstract class that provides methods for converting between a specific instant in time and a set of &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html#fields" rel="noopener noreferrer"&gt;&lt;code&gt;calendar fields&lt;/code&gt;&lt;/a&gt; such as &lt;code&gt;YEAR&lt;/code&gt;, &lt;code&gt;MONTH&lt;/code&gt;, &lt;code&gt;DAY_OF_MONTH&lt;/code&gt;, &lt;code&gt;HOUR&lt;/code&gt;, and so on, and for manipulating the calendar fields, such as getting the date of the next week. An instant in time can be represented by a millisecond value that is an offset from the &lt;em&gt;Epoch&lt;/em&gt;, January 1, 1970 00:00:00.000 GMT (Gregorian).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As noted by the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html" rel="noopener noreferrer"&gt;Oracle docs&lt;/a&gt; the reason was the lack of internationalization abilities.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It’s good to note that the same documentation linked above goes into further detail about its timing if it interests you.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The LocalDate API
&lt;/h2&gt;

&lt;p&gt;Also with &lt;code&gt;Java 8 SE&lt;/code&gt; came the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html" rel="noopener noreferrer"&gt;LocalDate Class&lt;/a&gt; which is referred to: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A date without a time-zone in the ISO-8601 calendar system, such as &lt;code&gt;2007-12-03&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;LocalDate&lt;/code&gt; is an immutable date-time object that represents a date, often viewed as year-month-day. Other date fields, such as day-of-year, day-of-week and week-of-year, can also be accessed. For example, the value "2nd October 2007" can be stored in a &lt;code&gt;LocalDate&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An important specification to take note of is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This class does not store or represent a time or time zone. Instead, it is a description of the date, as used for birthdays. It cannot represent an instant on the timeline without additional information such as an offset or time zone.&lt;/p&gt;
&lt;h2&gt;
  
  
  Difference &amp;amp; Which one to use
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Issues with the Date/Time API’s
&lt;/h4&gt;

&lt;p&gt;Further reading the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html" rel="noopener noreferrer"&gt;LocalDate&lt;/a&gt; class will lead you to “This class is immutable and thread-safe.” This brings us to our first problem.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Both the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html" rel="noopener noreferrer"&gt;Date&lt;/a&gt; and &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html" rel="noopener noreferrer"&gt;Calender&lt;/a&gt; were not thread-safe. If you're a bit confused as to what it means - Threads are a way to implement concurrency with a computer application this allows for multiple tasks to be running concurrently rather than sequentially (If you have a programming background you can see this as &lt;code&gt;async&lt;/code&gt;). &lt;/li&gt;
&lt;li&gt;Another issue with the Date/Calender API was its poor design. Later on, it was revamped to be ISO-centric (If you are a bit lost on what this whole ISO thing is; in short ISO stands for “International Organization for Standardization”) And we will see the added benefits of this later on.&lt;/li&gt;
&lt;li&gt;And lastly coming back to the lack of internationalization was that developers were required to write their logic for handling different time zones which can result in a lot of faults as miss-matches.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  The actual difference
&lt;/h4&gt;

&lt;p&gt;The biggest difference is despite the name &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html" rel="noopener noreferrer"&gt;Date&lt;/a&gt; would store both time and date (as mentioned by the docs with millisecond offset since epoch - we’ll talk about epoch later on). With the newer API, we get access to easier Formatting/Parsing/Manipulation of Dates.&lt;/p&gt;

&lt;h4&gt;
  
  
  What if I want to store time as well?
&lt;/h4&gt;

&lt;p&gt;Well Java has you covered there as well with their &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html" rel="noopener noreferrer"&gt;LocalDateTime Class&lt;/a&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A date-time without a time-zone in the ISO-8601 calendar system, such as &lt;code&gt;2007-12-03T10:15:30&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;LocalDateTime&lt;/code&gt; is an immutable date-time object that represents a date-time, often viewed as year-month-day-hour-minute-second. Other date and time fields, such as day-of-year, day-of-week and week-of-year, can also be accessed. Time is represented by nanosecond precision. For example, the value "2nd October 2007 at 13:45.30.123456789" can be stored in a &lt;code&gt;LocalDateTime&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you would &lt;strong&gt;only want to store time&lt;/strong&gt; then you can use the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html" rel="noopener noreferrer"&gt;LocalTime Class&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Quick little recap and use cases
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Should Use&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html" rel="noopener noreferrer"&gt;LocalDate&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Interprating Dates&lt;/td&gt;
&lt;td&gt;2021-02-28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html" rel="noopener noreferrer"&gt;LocalTime&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Interprating Time&lt;/td&gt;
&lt;td&gt;19:32:25.457826&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html" rel="noopener noreferrer"&gt;LocalDateTime&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Interprating Time/Date&lt;/td&gt;
&lt;td&gt;2021-02-28T19:32:25.457826.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html" rel="noopener noreferrer"&gt;Date&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;prefer not&lt;/td&gt;
&lt;td&gt;Represents Time&lt;/td&gt;
&lt;td&gt;Tue Jul 12 18:35:37 IST 2016&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  LocalDate
&lt;/h1&gt;

&lt;p&gt;Now that we have a good understanding of its background and what we can do with it, let's explore the methods of the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html" rel="noopener noreferrer"&gt;LocalDate&lt;/a&gt; class.&lt;/p&gt;

&lt;h2&gt;
  
  
  ISO 8601
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The ISO-8601 calendar system is the modern civil calendar system used today in most of the world. It is equivalent to the proleptic Gregorian calendar system, in which today's rules for leap years are applied for all time. For most applications written today, the ISO-8601 rules are entirely suitable. However, any application that makes use of historical dates, and requires them to be accurate will find the ISO-8601 approach unsuitable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the standard Java will use to properly format our dates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Temporal
&lt;/h2&gt;

&lt;p&gt;Before we do a deep dive I want to introduce you to the &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/temporal/Temporal.html" rel="noopener noreferrer"&gt;Temporal object&lt;/a&gt; which all of the new Date APIs implement (LocalDate, LocalTime, LocalDateTime) it's defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is the base interface type for date, time, and offset objects that are complete enough to be manipulated using plus and minus. It is implemented by those classes that can provide and manipulate information as &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/temporal/TemporalField.html" rel="noopener noreferrer"&gt;fields&lt;/a&gt; or &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/temporal/TemporalQuery.html" rel="noopener noreferrer"&gt;queries&lt;/a&gt;. See &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/temporal/TemporalAccessor.html" rel="noopener noreferrer"&gt;&lt;code&gt;TemporalAccessor&lt;/code&gt;&lt;/a&gt; for the read-only version of this interface.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not going into depth into this just wanted you guys to understand what this is if you encounter it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Methods
&lt;/h2&gt;

&lt;p&gt;The format for this will be in order - The method name, the specified return description, and a quick summary of what it does/or an in-depth dive. If you want to follow along I’m going to use &lt;code&gt;jshell&lt;/code&gt; just import &lt;code&gt;java.time.LocalDate&lt;/code&gt; and copy the same methods.&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;code&gt;LocalDate.now()&lt;/code&gt;: &amp;gt; the current date using the system clock and default time-zone, not null
&lt;/h5&gt;

&lt;blockquote&gt;
&lt;p&gt;As mentioned by the description it will return the current date format based on time zone as example for me it gives &lt;code&gt;2024-07-10&lt;/code&gt; however the format might change based on your locale time dependent on the ISO 8601 format assigned for your country (ex. it might be 2024.07.10 or 24/7/10 this is a standard that your country would use)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;code&gt;LocalDate.now()&lt;/code&gt; method &lt;em&gt;can&lt;/em&gt; take an argument. To use this we will import &lt;code&gt;java.time.ZoneId&lt;/code&gt;.&lt;/p&gt;

&lt;h6&gt;
  
  
  What is ZoneId?
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html" rel="noopener noreferrer"&gt;ZoneId&lt;/a&gt; Released with &lt;code&gt;Java 8SE&lt;/code&gt; defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;code&gt;ZoneId&lt;/code&gt; is used to identify the rules used to convert between an &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html" rel="noopener noreferrer"&gt;&lt;code&gt;Instant&lt;/code&gt;&lt;/a&gt; and a &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html" rel="noopener noreferrer"&gt;&lt;code&gt;LocalDateTime&lt;/code&gt;&lt;/a&gt;. There are two distinct types of ID:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixed offsets - a fully resolved offset from UTC/Greenwich, that uses the same offset for all local date-times&lt;/li&gt;
&lt;li&gt;Geographical regions - an area where a specific set of rules for finding the offset from UTC/Greenwich apply&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simple terms, this resolves the internationalization issue we had with the old &lt;code&gt;Date&lt;/code&gt; API. After importing &lt;code&gt;java.time.ZoneId&lt;/code&gt; we can look at some of the methods it has to offer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ZoneId.getAvailableZoneIds()&lt;/code&gt; Shows us all available zones here are some for example: &lt;code&gt;Europe/Istanbul, America/Eirunepe, Etc/GMT-4, America/Miquelon&lt;/code&gt; (Remember each one of these is unique and we have two types of unique ID’s which are listed above).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ZoneId.systemDefault()&lt;/code&gt; The method is defined as “If the system default time-zone is changed, then the result of this method will also change.” Which is self-explanatory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ZoneId.of("")&lt;/code&gt; We use this to define a custom set ZoneId from the &lt;code&gt;.getAvailableZoneIds()&lt;/code&gt; list. Remember both &lt;code&gt;UTC&lt;/code&gt; and &lt;code&gt;Europe/Istanbul&lt;/code&gt; used as an example here can be used. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ZoneId.from()&lt;/code&gt; Remember the temporal we talked about before? Here we will pass it as an argument. If you're not entirely sure what this does, given a ==TemporalAccessor which represents an arbitrary set of date and time information we’ll get a ZoneId. If you are still a bit clueless you can import &lt;code&gt;java.time.ZoneId&lt;/code&gt; and use &lt;code&gt;ZonedDateTime.now()&lt;/code&gt; which will give you a precise time/date which then you could parse to a ZoneId. Basically &lt;code&gt;ZoneId.from(ZonedDateTime.now())&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;There also a &lt;code&gt;Clock&lt;/code&gt; argument you can pass, but I don’t see any use for it when you could just use ZoneID but feel free to explore that&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now that we learned that - Let’s get the current date in Paris!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LocalDate.now(ZoneId.of("Europe/Paris")) // 2024-07-10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  &lt;code&gt;LocalDate.of(year, month, day of month)&lt;/code&gt;: &amp;gt; Obtains an instance of &lt;code&gt;LocalDate&lt;/code&gt; from a year, month, and day.
&lt;/h5&gt;

&lt;p&gt;Remember &lt;code&gt;LocalDate&lt;/code&gt; represents a Date. In this case, we can set that date to whatever year,month, and day we want!&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;code&gt;LocalDate.ofYearDay(year, dayOfYear)&lt;/code&gt;: &amp;gt;
&lt;/h5&gt;

&lt;p&gt;In a lot of cases, you might only have a year and a day. This function converts it to a Year-Month-Day format. Here’s an example &lt;code&gt;LocalDate.ofYearDay(2023, 234)&lt;/code&gt; will be &lt;code&gt;2023-08-22&lt;/code&gt;. Leap years will also be accounted for.&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;code&gt;LocalDate.parse(text)&lt;/code&gt; : &amp;gt; Obtains an instance of &lt;code&gt;LocalDate&lt;/code&gt; from a text string using a specific format.
&lt;/h5&gt;

&lt;p&gt;Basically, if we generate a String Date format like &lt;code&gt;2023-08-22&lt;/code&gt; this will convert it into a LocalDate format &lt;/p&gt;

&lt;h3&gt;
  
  
  Epoch
&lt;/h3&gt;

&lt;p&gt;There’s one last method I would like to talk about and even though it might not be that useful, it's a good thing to know.&lt;br&gt;
Epoch in simple terms is a date set to the start. Virtually means it's “The start of time”. For example UNIX epoch is set to 1970/1/1 This is when all Unix time is calculated. Now this is not standardized between all computers. Most programming languages will use the UNIX epoch but not between all devices. For example &lt;code&gt;NTP&lt;/code&gt; epoch is 1900/1/1. Now you might be asking why. And the simple answer is I don’t know. Unix was developed in 1969 and released in 71 but I guess the developers found 70 easier to work with and now that’s what we use! &lt;/p&gt;
&lt;h5&gt;
  
  
  &lt;code&gt;LocalDate.ofEpochDay(epochDay)&lt;/code&gt; : &amp;gt;
&lt;/h5&gt;

&lt;p&gt;Just going based on the description I gave about the output of this would be X days from 1970/1/1. Given epochDay is 1 =&amp;gt; &lt;code&gt;1970-01-02&lt;/code&gt; and so on.&lt;/p&gt;

&lt;p&gt;~&lt;br&gt;
~&lt;br&gt;
~&lt;/p&gt;

&lt;p&gt;By now I think you guys are all bored of all this nerdy talk and most likely lost interest completely but we are going to make it way more interesting in just a bit. &lt;br&gt;
&lt;code&gt;LocalDate&lt;/code&gt; methods have a ton of subsets to modify dates as we talked about above. Explaining all of these is just a waste of time. The best thing is for you guys to check ’em out and play around a bit, they are all very simple to understand.&lt;/p&gt;
&lt;h2&gt;
  
  
  Locale
&lt;/h2&gt;

&lt;p&gt;The main idea of this whole article was to teach you internationalization and we are going to start that now. &lt;br&gt;
If you recall above I talked about how &lt;code&gt;LocalDate.now()&lt;/code&gt; might show different numbers/punctuations and this is standardized by &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html" rel="noopener noreferrer"&gt;Locale Class&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;code&gt;Locale&lt;/code&gt; object represents a specific geographical, political, or cultural region. An operation that requires a &lt;code&gt;Locale&lt;/code&gt; to perform its task is called &lt;em&gt;locale-sensitive&lt;/em&gt; and uses the &lt;code&gt;Locale&lt;/code&gt; to tailor information for the user. For example, displaying a number is a locale-sensitive operation— the number should be formatted according to the customs and conventions of the user's native country, region, or culture.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Again the Locale class uses pre-defined ISO standards that Oracle has included. &lt;/p&gt;

&lt;p&gt;As I said - In the early days of the web Java was rushed and we can really see that here. &lt;/p&gt;
&lt;h3&gt;
  
  
  Locale Constant &amp;amp; Why not to use
&lt;/h3&gt;

&lt;p&gt;If you import &lt;code&gt;java.util.Locale&lt;/code&gt; you can see that we have a few constants. &lt;code&gt;Locale.CANADA&lt;/code&gt; as an example. If you're wondering what these are and why they were picked, it's quite simple. Due to the reason mentioned above, the Java devs just picked some Locale constants to support and you should not use them. Now if you look closely we have a &lt;code&gt;Locale.French&lt;/code&gt;&lt;br&gt;
and a &lt;code&gt;Locale.France&lt;/code&gt; and you might be confused, what is this?? I’ll talk about it in a second &lt;/p&gt;

&lt;p&gt;Now how do we go about using these Locales? By using &lt;code&gt;Locale.availableLocales()&lt;/code&gt; you will see a large subset of available locales that you can use. you might see it in the format of &lt;code&gt;en_US&lt;/code&gt; and you might get confused. Following up on the question listed above Java has accounted for different language subsets used in different countries. In this France/French example, We can refer to Canadian French versus French used in France. They are not entirely the same. Now a country like Iran will use Persian no matter the place, so you could just use &lt;code&gt;Locale.of(language)&lt;/code&gt; to specify the Locale, But for French you could rather use &lt;code&gt;Locale.of(language, country)&lt;/code&gt;. Remember if you split what you got from &lt;code&gt;Locale.availableLocales()&lt;/code&gt; by the &lt;code&gt;_&lt;/code&gt; you can just format it like that. An example would be &lt;code&gt;Locale.of("en", "US")&lt;/code&gt; for en_US&lt;/p&gt;

&lt;p&gt;Now let's implement this into our time for our different users around the globe.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
&lt;span class="nc"&gt;LocalDate&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;now&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;

&lt;span class="nc"&gt;DateTimeFormatter&lt;/span&gt;

&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofLocalizedDate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FormatStyle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SHORT&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;localizedBy&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Locale&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;GERMAN&lt;/span&gt;&lt;span class="o"&gt;)));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now don’t mind the extra code, and even me using &lt;code&gt;Locale.GERMAN&lt;/code&gt; cause honestly I was looking for a different output and the easiest way was to use Javas constants. I landed on &lt;code&gt;Locale.GERMAN&lt;/code&gt; which outputs &lt;code&gt;10.07.24&lt;/code&gt; as opposed to what Japan uses (&lt;code&gt;2024/07/10&lt;/code&gt;).&lt;/p&gt;

&lt;h4&gt;
  
  
  Why not use &lt;code&gt;Locale.of()&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Now it might sound weird, but first of all i tell you not to use constants and prefer Locale.of(), then I tell you not to use &lt;code&gt;Locale.of()&lt;/code&gt; an important factor to consider is &lt;code&gt;Locale.of()&lt;/code&gt; was introduced with Java 19 which goes against supporting Java 8 SE to combat that from now on we will use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Locale&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Builder&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setLanguage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"language"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setRegion&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"country"&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now another thing you could use is &lt;code&gt;Locale.setDefault(language, country)&lt;/code&gt; which will work as well.&lt;/p&gt;

&lt;h1&gt;
  
  
  DateTimeFormatter
&lt;/h1&gt;

&lt;p&gt;Now looking at the code above you might recall seeing &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html" rel="noopener noreferrer"&gt;DateTimeFormatter&lt;/a&gt; defined by docs as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Formatter for printing and parsing date-time objects.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;LocalDate.format()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;As I mentioned above, one of the key features of Date/Time Local* APIs was formatting. And this is how we are going to format our dates. Looking at the code above - everything should make sense apart from the &lt;code&gt;.ofLocalizedDate()&lt;/code&gt; method. The easiest way to show what it does is with an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;LocalDate&lt;/span&gt; &lt;span class="n"&gt;anotherSummerDay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;LocalDate&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2016&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DateTimeFormatter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofLocalizedDate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FormatStyle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FULL&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;anotherSummerDay&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DateTimeFormatter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofLocalizedDate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FormatStyle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;LONG&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;anotherSummerDay&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DateTimeFormatter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofLocalizedDate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FormatStyle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MEDIUM&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;anotherSummerDay&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DateTimeFormatter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofLocalizedDate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FormatStyle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SHORT&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;anotherSummerDay&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will output the following in order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Tuesday, August 23, 2016
August 23, 2016
Aug 23, 2016
8/23/16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now sometimes you might want to have your own pattern which you can easily do with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;

&lt;span class="nc"&gt;LocalDate&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;now&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;

&lt;span class="nc"&gt;DateTimeFormatter&lt;/span&gt;

&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofPattern&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"dd-uuuu-MMM"&lt;/span&gt;&lt;span class="o"&gt;)));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I’ll quickly go over what these symbols mean:&lt;br&gt;
&lt;code&gt;dd&lt;/code&gt; =&amp;gt; It's a representation of the day field, now you could also use &lt;code&gt;d&lt;/code&gt; and the difference would be that &lt;code&gt;d&lt;/code&gt; would not have a fixed character limit since it represents 1 digit from 0-9 and 2 from 10-31. if you're lost it basically means &lt;code&gt;dd&lt;/code&gt; would show 01; however &lt;code&gt;d&lt;/code&gt; would show 1. However, going into two digits it's the same&lt;br&gt;
&lt;code&gt;uuuu&lt;/code&gt;/&lt;code&gt;yyyy&lt;/code&gt; =&amp;gt; Is the field for years. And you could also do &lt;code&gt;yy&lt;/code&gt; which would show only the last two digits of the year. ex. 24 rather than 2024&lt;br&gt;
&lt;code&gt;MMM&lt;/code&gt; =&amp;gt; The last field as you might have guessed is for the month - &lt;code&gt;MMM&lt;/code&gt; tells Java that we want a String representation rather than a number. If you want a number use &lt;code&gt;MM&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So by now, you should’ve guessed that the output would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;10-2024-Jul
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Instants
&lt;/h3&gt;

&lt;p&gt;Now that you have a firm grip on Dates. I want to introduce you to &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html" rel="noopener noreferrer"&gt;Instants&lt;/a&gt; defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An instantaneous point on the timeline.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Basically, this refers to &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html" rel="noopener noreferrer"&gt;Instants&lt;/a&gt; showing a specific moment.&lt;br&gt;
By now you might have assumed that &lt;code&gt;LocalDateTime&lt;/code&gt; has a timezone, but it doesn’t as the docs mentioned they are just a representation of date/time. However a &lt;code&gt;ZoneId&lt;/code&gt; is in fact a representation of a time zone.  Also, note that Instants don’t provide methods for altering our dates and times. &lt;/p&gt;

&lt;p&gt;Instants capture the current moment in UTC with the &lt;code&gt;Instant.now()&lt;/code&gt; . Now based on this, you realize that &lt;code&gt;Local*&lt;/code&gt; really doesn’t have a meaning unless it's applied, that’s the reason why you would actually refrain from using it in a business-level application. So prefer using &lt;code&gt;ZonedDateTime&lt;/code&gt; and &lt;code&gt;Insant&lt;/code&gt;. As a general rule of thumb use &lt;code&gt;Locale&lt;/code&gt; When it's a specific point on a timeline rather than a moment in time. A moment would be like the moment I publish this, or the moment you read this, or the moment the world explodes, however a point in a timeline would be like an appointment there’s no moment for an appointment. If you're going on a vacation it's a specific time on a timeline, not a moment. &lt;/p&gt;

&lt;h4&gt;
  
  
  Whats ZonedDateTime?
&lt;/h4&gt;

&lt;p&gt;Quite simple. It's just an &lt;code&gt;Instant&lt;/code&gt; with a &lt;code&gt;ZoneId&lt;/code&gt; and this is why we say &lt;code&gt;Insant&lt;/code&gt; has a timezone. No matter what you do it's not going to represent a time but rather be a specific moment.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Aigh’t well that was quite the thing, wasn’t it? phew&lt;/em&gt;&lt;br&gt;
&lt;em&gt;have a nice one &amp;gt;#&lt;/em&gt; &lt;/p&gt;

</description>
      <category>java</category>
      <category>dateandtime</category>
      <category>localdatetime</category>
    </item>
    <item>
      <title>Lets make an quote-of-the-day instagram bot!</title>
      <dc:creator>ryan</dc:creator>
      <pubDate>Wed, 23 Jun 2021 11:34:35 +0000</pubDate>
      <link>https://forem.com/ry444nn/lets-make-an-quote-of-the-day-instagram-bot-3lbk</link>
      <guid>https://forem.com/ry444nn/lets-make-an-quote-of-the-day-instagram-bot-3lbk</guid>
      <description>&lt;h1&gt;
  
  
  Lets get started
&lt;/h1&gt;

&lt;h1&gt;
  
  
  🎉 Demo
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.instagram.com/dailydouseofquotes/" rel="noopener noreferrer"&gt;https://www.instagram.com/dailydouseofquotes/&lt;/a&gt;&lt;br&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%2Fpsuqu81mepelkebjpylr.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%2Fpsuqu81mepelkebjpylr.png" alt="alt text" width="600" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make a files: &lt;br&gt;
&lt;code&gt;main.py&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Starting the code
&lt;/h2&gt;
&lt;h3&gt;
  
  
  🧪 Importing the libaries
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
import urllib.request
import os
from PIL import Image, ImageDraw, ImageFont, ImageOps
import requests
from instabot import Bot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  📷 Getting an image and saving it
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;dl_image&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;image_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://source.unsplash.com/user/eberhardgross/1080x1080/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlretrieve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;image.jpg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Installing image&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;blockquote&gt;
&lt;p&gt;The following code will get an 1080x1080 image by the author eberhardgross from unsplash, &lt;strong&gt;Why him ?&lt;/strong&gt; I haven't seen anything 18+ from this user and have seen amazing images only!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  🙌 Getting the daily quote
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;dailyquote&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&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;https://quotes.rest/qod.json?language=en&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;response_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&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;response_output&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;This code will get a &lt;strong&gt;json daily quote of the day&lt;/strong&gt; response from quotes.rest, as you can see we will output certain results that we from FROM the dailyquote function &lt;strong&gt;later&lt;/strong&gt;!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  😎 Putting the quote and image in one!!
&lt;/h3&gt;
&lt;h4&gt;
  
  
  🐱‍🚀 Fixing the line order
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;We will be doing this so we can get a good word-per-line system, so we see the whole text!&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;wrap_by_word&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;ret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;ret&lt;/span&gt; &lt;span class="o"&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="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ret&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  🎨 Lets do it all!
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;text_overlay_ig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;wrap_by_word&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;image_file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;realpath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;image.jpg&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;im&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Fixing the quote line order and then opening our image file&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Time to put on everything!&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;draw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ImageDraw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Draw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;im&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ImageFont&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;truetype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;font.ttf&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;shadowColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;thickness&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spacing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&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="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spacing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;im&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;image.jpg&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;h5&gt;
  
  
  🌁 Adding a font.tff file!
&lt;/h5&gt;

&lt;p&gt;i'd recommend using &lt;a href="https://github.com/9ebd7134/Python-quote-of-the-day-instagram-bot/blob/master/font.ttf" rel="noopener noreferrer"&gt;https://github.com/9ebd7134/Python-quote-of-the-day-instagram-bot/blob/master/font.ttf&lt;/a&gt; just click on download and put it in your folder ! The font is easy to read so its perfect&lt;/p&gt;

&lt;p&gt;And now lets put on the quote on the image&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="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;shadowColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;thickness&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spacing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The x, y are the position of the text we want to put, change this but be careful this &lt;strong&gt;won't change based on the text length&lt;/strong&gt;! We could do that but lets stick with this for now&lt;/p&gt;

&lt;p&gt;Everything else is us just putting the text alongside the text shadow on the image.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Time to put the author&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&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="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;shadowColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;thickness&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spacing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fill&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 Same thing but we are changing the x, y positions &lt;strong&gt;AND&lt;/strong&gt; also adding — to the author username&lt;/p&gt;

&lt;h2&gt;
  
  
  😎🙌 Final steps
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dailyquote&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;contents&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;quotes&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;quote&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dailyquote&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;contents&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;quotes&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;author&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;tags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dailyquote&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;contents&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;quotes&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tags&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nf"&gt;dl_image&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;text_overlay_ig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;ptag&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;ptag&lt;/span&gt; &lt;span class="o"&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="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="o"&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="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;This bot was made by ryan s.(@9ebd7134 on github), Hope you enjoyed this quote, This quote was by&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Links:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;📷Image by: https://unsplash.com/user/eberhardgross&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Tags:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;#️⃣ &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ptag&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;bot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Bot&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;login&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&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="n"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;password1234&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upload_photo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;image.jpg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;caption&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 Simply change the caption/content and then bot.login username/password details for this to fully work!&lt;/p&gt;

&lt;h1&gt;
  
  
  🆘 Fixing up some issues
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;I'll be updating this and updating the github page for it, i will make an issue and a pull request talking all about the changes! If you want to fix my code i'd love to see it!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Link for the github:
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/9ebd7134/Python-quote-of-the-day-instagram-bot" rel="noopener noreferrer"&gt;https://github.com/9ebd7134/Python-quote-of-the-day-instagram-bot&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>pythonbot</category>
      <category>automation</category>
      <category>bot</category>
    </item>
    <item>
      <title>My own extension</title>
      <dc:creator>ryan</dc:creator>
      <pubDate>Sat, 10 Apr 2021 06:26:29 +0000</pubDate>
      <link>https://forem.com/ry444nn/my-own-extension-5a50</link>
      <guid>https://forem.com/ry444nn/my-own-extension-5a50</guid>
      <description>&lt;h1&gt;
  
  
  My own extension
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Check out the extension:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/nord-web-theme/" rel="noopener noreferrer"&gt;Firefox Users&lt;/a&gt;&lt;br&gt;
&lt;a href="https://microsoftedge.microsoft.com/addons/detail/pcaeblapppplaeiahlilfekiclnlphch" rel="noopener noreferrer"&gt;Chromium Browser users&lt;/a&gt;&lt;br&gt;
&lt;a href="//github.com/nord-web-themes/Nord-Web-themes"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The first release
&lt;/h2&gt;

&lt;p&gt;I was using the Nord windows theme and saw the amazing community behind it. I wanted to add something to it, something never seen before. My idea was a chrome extension which would make websites more or less like Nord.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;I was really board , and i wanted to make something. So i decided to make nord web themes. I really liked the nord theme too and though many other would love it!&lt;/p&gt;

&lt;h2&gt;
  
  
  The changes
&lt;/h2&gt;

&lt;p&gt;I have learned a lot ! I fixed a lot of issues and added a list of new websites, nevertheless , I really got board over the past weeks. I don't think i'll continue this project, since i am a web developer. I like to seek for challenges myself but making this extension isn't that easy. I'm doing what i want , not what people want.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why am i leaving ?
&lt;/h2&gt;

&lt;p&gt;Over the past years i want from a nord lover, to a nord hater. I just learned that looks don't matter. I wanted to focus on what i do, but, I was less productive. I always wanted to check for the new updates and such. I would understand that many are not like me , but i think it was for the better :) &lt;/p&gt;

</description>
      <category>addon</category>
      <category>extension</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
