<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leonard Smith</title>
    <description>The latest articles on DEV Community by Leonard Smith (@ignu).</description>
    <link>https://dev.to/ignu</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%2F364469%2F88109583-211b-4540-9fd1-d9c4cd5af84c.jpg</url>
      <title>DEV Community: Leonard Smith</title>
      <link>https://dev.to/ignu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ignu"/>
    <language>en</language>
    <item>
      <title>Shell 101: Keeping Dotfiles in Source Control</title>
      <dc:creator>Leonard Smith</dc:creator>
      <pubDate>Thu, 17 Dec 2020 07:10:27 +0000</pubDate>
      <link>https://dev.to/ignu/shell-101-keeping-dotfiles-in-source-control-97m</link>
      <guid>https://dev.to/ignu/shell-101-keeping-dotfiles-in-source-control-97m</guid>
      <description>&lt;p&gt;I want shell customizations made in my dotfiles to be both seamless and permanent.&lt;/p&gt;

&lt;p&gt;So before we start customizing our shell, let's take five minutes and put our dotfiles in a git repostiroy so we can reproduce our environment and remove friction to future updates.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6Rprx1gY9Ps"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;First we're going to create a new git repo in whatever directory we keep our code in. (For me, it's in &lt;code&gt;~/code&lt;/code&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/ &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/code
~/code &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;dotfiles
~/code &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;dotfiles
~/code/dotfiles &lt;span class="nv"&gt;$ &lt;/span&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we're going to make an install script to make installs automated in the future.&lt;/p&gt;

&lt;p&gt;We're going to keep our profile in a &lt;code&gt;zshrc&lt;/code&gt; file in source control and use the &lt;code&gt;ln&lt;/code&gt; command to make a symbolic link to it at &lt;code&gt;~/.zshrc&lt;/code&gt; (the default place zsh will look for a profile).&lt;/p&gt;

&lt;p&gt;We're also going to delete an existing &lt;code&gt;~/.zshrc&lt;/code&gt; if it exists.&lt;/p&gt;

&lt;p&gt;(If you have anything existing in your &lt;code&gt;~/.zshrc&lt;/code&gt; make sure you back it up now.)&lt;/p&gt;

&lt;p&gt;In .&lt;code&gt;/install.sh&lt;/code&gt; we write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Linking Files... 🚀"&lt;/span&gt;

&lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.zshrc"&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; ~/.zshrc

&lt;span class="nb"&gt;ln&lt;/span&gt; ./zshrc ~/.zshrc

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Done 🌈"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make it executable, we &lt;code&gt;chmod 755 ./install.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we're going to have to actually create a &lt;code&gt;zshrc&lt;/code&gt;. Let's just write something basic for now to make sure our script works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;l&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ls -al"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this and run &lt;code&gt;./install.sh&lt;/code&gt; and bam, we have a &lt;code&gt;.zshrc&lt;/code&gt;. However, you might notice our current shell doesn't actually have our changes. We need to open a new shell (our run &lt;code&gt;source ~/.zshrc&lt;/code&gt;) to see our new &lt;code&gt;l&lt;/code&gt; command. This is a lot of friction to make future changes, so lets write two new functions in our &lt;code&gt;zshrc.&lt;/code&gt; to make updates seamless next time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;function &lt;/span&gt;reprofile&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Dotfiles reloaded 🌈"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;function &lt;/span&gt;editzsh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;# replace vi with your editor of choice&lt;/span&gt;
  vi ~/.zshrc
  reprofile
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(You can replace &lt;code&gt;vi&lt;/code&gt; with your editor of choice, but &lt;code&gt;editzsh&lt;/code&gt; really shines if you use a terminal based editor, since &lt;code&gt;reprofile&lt;/code&gt; will automatically run and resource your profile after you exit your terminal based editor.)&lt;/p&gt;

&lt;p&gt;That's it for our starter template! If you don't want to type that manually you can fork &lt;a href="https://github.com/ignu/dotfiles-example/tree/blank-slate"&gt;all the code we just wrote&lt;/a&gt; or peak at my &lt;a href="https://github.com/ignu/dotfiles"&gt;existing dotfiles&lt;/a&gt; for some ideas and to see where this series is heading.&lt;/p&gt;

</description>
      <category>bash</category>
      <category>zsh</category>
      <category>shell</category>
    </item>
    <item>
      <title>React Everywhere</title>
      <dc:creator>Leonard Smith</dc:creator>
      <pubDate>Thu, 12 Jan 2017 00:00:00 +0000</pubDate>
      <link>https://dev.to/ignu/react-everywhere-3mfg</link>
      <guid>https://dev.to/ignu/react-everywhere-3mfg</guid>
      <description>&lt;p&gt;Thanks for everyone who came my React workshop at &lt;a href="http://codemash.org"&gt;CodeMash&lt;/a&gt;! Please leave feedback in the &lt;a href="https://eventsxd.com/download"&gt;EventsXD&lt;/a&gt; App.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repositories used in the session:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/ignu/react-everywhere-web-demo"&gt;Web Demo&lt;/a&gt; &lt;a href="http://codemash.surge.sh"&gt;(deployed here)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ignu/react-everywhere-native-demo"&gt;Native Demo for React Everywhere&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ignu/codemash-react-workshop"&gt;The project we were building during the day&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/ignu/react-everywhere-workshop"&gt;Slides&lt;/a&gt; (you'll need to &lt;code&gt;npm install &amp;amp;&amp;amp; npm run&lt;/code&gt;) to  view them&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  More feature ideas, if you still want to hack:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Store data offline using &lt;a href="https://github.com/rt2zz/redux-persist"&gt;redux-persist&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Move the initial &lt;code&gt;fetch&lt;/code&gt; into the redux store using &lt;a href="https://github.com/gaearon/redux-thunk"&gt;redux-thunk&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Update the title using &lt;a href="https://github.com/nfl/react-helmet"&gt;react-helmet&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Filter Sessions that are in the past&lt;/li&gt;
&lt;li&gt;List a Speaker's sessions on their page&lt;/li&gt;
&lt;li&gt;Filter by Tag&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Further Learning/Playing
&lt;/h1&gt;

&lt;h3&gt;
  
  
  React
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://egghead.io/courses/getting-started-with-redux"&gt;Getting Started with Redux - Course by @dan_abramov&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FormidableLabs/react-music"&gt;FormidableLabs/react-music: Make beats with React!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/enaqx/awesome-react"&gt;awesome-react: A collection of awesome things regarding React ecosystem.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  React Native
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/jondot/ReactNativeKatas"&gt;ReactNativeKatas&lt;/a&gt;  ahands-on, and fun learning experience for React Native&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rnplay.org/"&gt;React Native Playground: Play with React Native in browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devchat.tv/react-native-radio"&gt;React Native Radio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://github.com/este/este"&gt;este&lt;/a&gt; starter kit for one code base for client-side web, server, iOS and Android&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jondot/awesome-react-native"&gt;Awesome React Native&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>speaking</category>
      <category>react</category>
    </item>
  </channel>
</rss>
