<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Start Coding Now - Developer Experience</title><link href="https://startcodingnow.com/" rel="alternate"/><link href="https://startcodingnow.com/category/developer-experience/feed" rel="self"/><id>https://startcodingnow.com/</id><updated>2023-06-15T00:00:00-07:00</updated><entry><title>3 Git Configuration Tips I Use Every Day</title><link href="https://startcodingnow.com/git-config-tips" rel="alternate"/><published>2023-06-15T00:00:00-07:00</published><updated>2023-06-15T00:00:00-07:00</updated><author><name>Lance Goyke</name></author><id>tag:startcodingnow.com,2023-06-15:/git-config-tips</id><summary type="html">&lt;p class="first last"&gt;Some extremely useful tips I learned from Adam Johnson's book, &lt;em&gt;Boost Your Git DX&lt;/em&gt;.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Do you use Git literally every day? Me too.&lt;/p&gt;
&lt;p&gt;I've been using the basics of Git for years, but only recently did I learn some new powerful tricks.&lt;/p&gt;
&lt;p&gt;If you want to move past &lt;tt class="docutils literal"&gt;add&lt;/tt&gt;, &lt;tt class="docutils literal"&gt;commit&lt;/tt&gt;, and &lt;tt class="docutils literal"&gt;push&lt;/tt&gt;, keep reading.&lt;/p&gt;
&lt;div class="section" id="contents"&gt;
&lt;h2&gt;Contents&lt;/h2&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Praise for &lt;em&gt;Boost Your Git DX&lt;/em&gt; by Adam Johnson&lt;/li&gt;
&lt;li&gt;Make a &lt;tt class="docutils literal"&gt;dotfiles&lt;/tt&gt; Repository&lt;/li&gt;
&lt;li&gt;Use Shell Aliases for Git Commands&lt;/li&gt;
&lt;li&gt;Automatically Create Upstream Branches&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div class="section" id="praise-for-boost-your-git-dx-by-adam-johnson"&gt;
&lt;h2&gt;Praise for &lt;em&gt;Boost Your Git DX&lt;/em&gt; by Adam Johnson&lt;/h2&gt;
&lt;p&gt;All of these tips have come from Adam Johnson's book, &lt;a class="reference external" href="https://adamchainz.gumroad.com/l/bygdx"&gt;Boost Your Git DX&lt;/a&gt;. I'm only sharing (with permission) three tips from the book. He's written almost 300 more pages than what I outline here.&lt;/p&gt;
&lt;p&gt;This book transformed my day-to-day operations. As a self-taught engineer, I have found myself starved for mentorship, and &lt;em&gt;Boost Your Git DX&lt;/em&gt; has been my most influential mentor in 2023.&lt;/p&gt;
&lt;p&gt;If you're looking to maximize the usefulness of Git past basic version control, you will &lt;strong&gt;love&lt;/strong&gt; this book.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="make-a-dotfiles-repository"&gt;
&lt;h2&gt;Make a &lt;tt class="docutils literal"&gt;dotfiles&lt;/tt&gt; Repository&lt;/h2&gt;
&lt;p&gt;The &lt;tt class="docutils literal"&gt;dotfiles&lt;/tt&gt; repository serves as a place to save your configuration files, allowing you to &lt;tt class="docutils literal"&gt;git clone&lt;/tt&gt; it down to new computers or accounts. This is a huge plus for your developer experience if you work on multiple machines.&lt;/p&gt;
&lt;p&gt;I can now use my optimized shell on Windows Subsystem for Linux for every version of Ubuntu I have installed, my home Ubuntu server, my powerhouse desktop computer, and my more portable laptop. You could even clone it into your web servers!&lt;/p&gt;
&lt;p&gt;Check if you have files to save:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;ls&lt;span class="w"&gt; &lt;/span&gt;~
ls&lt;span class="w"&gt; &lt;/span&gt;~/.config
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If so, set up a &lt;tt class="docutils literal"&gt;dotfiles&lt;/tt&gt; repository:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;~/dotfiles
&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/dotfiles
git&lt;span class="w"&gt; &lt;/span&gt;init
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Set up a &lt;tt class="docutils literal"&gt;config&lt;/tt&gt; directory to store config files and move in your Git config:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;config
mv&lt;span class="w"&gt; &lt;/span&gt;~/.config/git&lt;span class="w"&gt; &lt;/span&gt;config/git
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Removing the prepended &lt;tt class="docutils literal"&gt;.&lt;/tt&gt; from &lt;tt class="docutils literal"&gt;.config&lt;/tt&gt; means the folder won't be hidden by default.&lt;/p&gt;
&lt;p&gt;Then, make a script to create a symlink for the config files back to their expected location inside the &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.config&lt;/span&gt;&lt;/tt&gt; directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;touch&lt;span class="w"&gt; &lt;/span&gt;setup.sh
chmod&lt;span class="w"&gt; &lt;/span&gt;+x&lt;span class="w"&gt; &lt;/span&gt;setup.sh
&lt;span class="nv"&gt;$EDITOR&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;setup.sh
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Inside &lt;tt class="docutils literal"&gt;setup.sh&lt;/tt&gt;, add the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="c1"&gt;# Enable shell script strictness&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-eu

&lt;span class="c1"&gt;# Show each command when running script&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-x

&lt;span class="c1"&gt;# Ensure config directory exists&lt;/span&gt;
mkdir&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;~/.config

&lt;span class="c1"&gt;# Link Git config if it doesn’t exist&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;!&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;~/.config/git&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/config/git"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/.config/git
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If the target &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.config/git&lt;/span&gt;&lt;/tt&gt; file already exists, it will not be overwritten.&lt;/p&gt;
&lt;p&gt;If it doesn't exist, the script will create a symbolic link or "symlink" with &lt;tt class="docutils literal"&gt;ln &lt;span class="pre"&gt;-s&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Run the script to link your config files from your &lt;tt class="docutils literal"&gt;dotfiles&lt;/tt&gt; directory into your home directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;./setup.sh
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Check if it's working, commit the files to your repo, and push them up to your preferred Git host.&lt;/p&gt;
&lt;p&gt;When you want to pull your config down to a new server&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;clone&lt;span class="w"&gt; &lt;/span&gt;&lt;github_repo_location&gt;
./setup.sh
&lt;/github_repo_location&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you've made updates to your config from one machine, &lt;tt class="docutils literal"&gt;add&lt;/tt&gt; + &lt;tt class="docutils literal"&gt;commit&lt;/tt&gt; + &lt;tt class="docutils literal"&gt;push&lt;/tt&gt; them to your dotfiles repo, then &lt;tt class="docutils literal"&gt;pull&lt;/tt&gt; them down to your other machines.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="use-shell-aliases-for-git-commands"&gt;
&lt;h2&gt;Use Shell Aliases for Git Commands&lt;/h2&gt;
&lt;p&gt;Though I believe the &lt;tt class="docutils literal"&gt;dotfiles&lt;/tt&gt; repo has saved me the most headache when working on multiple machines, these shell aliases are the change that I use the absolute most.&lt;/p&gt;
&lt;p&gt;Aliases allow you to type abbreviations for longer commands. Some examples:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;tt class="docutils literal"&gt;g&lt;/tt&gt; for &lt;tt class="docutils literal"&gt;git&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt;&lt;tt class="docutils literal"&gt;ga&lt;/tt&gt; for &lt;tt class="docutils literal"&gt;git add&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt;&lt;tt class="docutils literal"&gt;gc&lt;/tt&gt; for &lt;tt class="docutils literal"&gt;git commit&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To enable these, you can type them directly into a single shell session, or you can add a line to your shell's startup file (Bash: &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.bashrc&lt;/span&gt;&lt;/tt&gt;, Zsh: &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.zshrc&lt;/span&gt;&lt;/tt&gt;) to persist them across all interactive login shell sessions.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="c1"&gt;# ex: alias &lt;name&gt;=&lt;command/&gt;&lt;/name&gt;&lt;/span&gt;
&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;g&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;git
&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;ga&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;add
&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;gc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;commit
&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;gp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;push
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Make sure to restart your shell to load the new configuration if you put it in your &lt;tt class="docutils literal"&gt;.bashrc&lt;/tt&gt; or &lt;tt class="docutils literal"&gt;.zshrc&lt;/tt&gt; file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/.zshrc
ga&lt;span class="w"&gt; &lt;/span&gt;.
gc&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"added new config"&lt;/span&gt;
gp&lt;span class="w"&gt; &lt;/span&gt;--set-upstream&lt;span class="w"&gt; &lt;/span&gt;origin&lt;span class="w"&gt; &lt;/span&gt;main
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="automatically-create-upstream-branches"&gt;
&lt;h2&gt;Automatically Create Upstream Branches&lt;/h2&gt;
&lt;p&gt;Once a project is more established, I prefer to work on new features in their own respective Git branches.&lt;/p&gt;
&lt;p&gt;The problem is that when I push my changes to GitHub, the branch does not yet exist on the remote, so I have to type this wordy &lt;tt class="docutils literal"&gt;gp &lt;span class="pre"&gt;-u&lt;/span&gt; origin &lt;span class="pre"&gt;new-feature-1&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;But what I &lt;em&gt;really&lt;/em&gt; want to type is &lt;tt class="docutils literal"&gt;gp&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;To automatically create an upstream branch and link it to your local branch, you can use the &lt;tt class="docutils literal"&gt;push.autoSetupRemote&lt;/tt&gt; option.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;config&lt;span class="w"&gt; &lt;/span&gt;--global&lt;span class="w"&gt; &lt;/span&gt;push.autoSetupRemote&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will add a new setting to your global Git configuration file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="s"&gt;[push]&lt;/span&gt;
    autoSetupRemote &lt;span class="s"&gt;= true&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This Git feature was added in Git v2.37, so you may check your &lt;tt class="docutils literal"&gt;git &lt;span class="pre"&gt;--version&lt;/span&gt;&lt;/tt&gt; to see if you need to upgrade.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="summary"&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;There you have it! Three Git tips I use all the time since discovering them in Adam Johnson's book, &lt;a class="reference external" href="https://adamchainz.gumroad.com/l/bygdx"&gt;Boost Your Git DX&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;May your contribution streak be long and light green 🙏.&lt;/p&gt;
&lt;/div&gt;
</content><category term="Developer Experience"/><category term="git"/></entry><entry><title>Some Shortcuts in Atom Text Editor</title><link href="https://startcodingnow.com/some-shortcuts-in-atom-text-editor" rel="alternate"/><published>2019-09-23T00:00:00-07:00</published><updated>2019-09-23T00:00:00-07:00</updated><author><name>Lance Goyke</name></author><id>tag:startcodingnow.com,2019-09-23:/some-shortcuts-in-atom-text-editor</id><summary type="html">&lt;p class="first last"&gt;I use these all the time!&lt;/p&gt;
</summary><content type="html">&lt;p&gt;One of the things that blew me away when I started to get back into
coding in this new day and age was the text editors.&lt;/p&gt;
&lt;p&gt;I knew about Notepad and Notepad++, but working with
&lt;a class="reference external" href="https://atom.io/"&gt;Atom&lt;/a&gt; &lt;strong&gt;really&lt;/strong&gt; sped up the code writing process.&lt;/p&gt;
&lt;p&gt;Here are a few shortcuts that I couldn’t live without.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Delete line (Ctrl + Shift + K)&lt;/li&gt;
&lt;li&gt;Duplicate line (Ctrl + Shift + D)&lt;/li&gt;
&lt;li&gt;Select whole term (Ctrl + D)&lt;/li&gt;
&lt;li&gt;Select next copy of this term (Ctrl + D)&lt;/li&gt;
&lt;li&gt;Close window (Ctrl + W)&lt;/li&gt;
&lt;li&gt;Comment out line or group of lines (Ctrl + /)&lt;/li&gt;
&lt;li&gt;Toggle sidebar visibility (Ctrl + \)&lt;/li&gt;
&lt;li&gt;Snippets! (Type something, then hit TAB)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can type “html” then hit TAB and it will give you a bunch of
boilerplate.&lt;/p&gt;
&lt;p&gt;Duplicating lines is good when you have different, but related
functions.&lt;/p&gt;
&lt;p&gt;I’ve even been writing a few articles in Atom, working locally and
easily making lists with (“ol” + TAB), (“ul” + TAB), and (“li” + TAB).&lt;/p&gt;
&lt;p&gt;Which ones did I miss that &lt;strong&gt;you&lt;/strong&gt; can’t live without?&lt;/p&gt;
</content><category term="developer experience"/><category term="atom"/><category term="keyboard-shortcuts"/><category term="notepad"/><category term="shortcuts"/><category term="text-editor"/><category term="text-editors"/></entry></feed>