<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Blog | Mark Hernandez (lion-byte)</title>
  <subtitle>A feed of the latest blog posts.</subtitle>
  <link href="https://www.lion-byte.com/rss.xml" rel="self" />
  <link href="https://www.lion-byte.com" />
  <updated>2020-04-05T00:00:00Z</updated>
  <id>https://www.lion-byte.com/</id>
  <author>
    <name>Mark Hernandez</name>
    <email>mark@lion-byte.com</email>
  </author>
  
  <entry>
    <title>Fetch and Query Parameters</title>
    <link href="https://www.lion-byte.com/blog/fetch-and-query-params/"/>
    <updated>2020-04-05T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/fetch-and-query-params/</id>
    <content type="html">&lt;p&gt;Lately at work, I&#39;ve been updating some front-end code to be more modern. Among
the changes, I was swapping a lot of API calls to use
&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API&quot;&gt;Fetch&lt;/a&gt; instead of
&lt;a href=&quot;https://dojotoolkit.org/reference-guide/1.9/dojo/request/xhr.html&quot;&gt;Dojo&#39;s xhr&lt;/a&gt;
or &lt;a href=&quot;https://api.jquery.com/jQuery.ajax/&quot;&gt;jQuery&#39;s ajax&lt;/a&gt;. Fetch calls return a
promise, so that meant that we could use it with async/await syntax. Although
it&#39;s been easy to make this change, the Fetch API doesn&#39;t technically support
adding query parameters to the URL for HTTP GET, unlike most other library
implementations of this.&lt;/p&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Desired: GET `/api/item?q=test`&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// Below will not work&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/api/item&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;get&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token constant&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;test&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ...&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While using
&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent&quot;&gt;encodeURIComponent&lt;/a&gt;
&lt;em&gt;could&lt;/em&gt; solve this, I felt weird seeing it written out. This would also pose an
issue if there were multiple parameters needed or if some of the parameters were
optional.&lt;/p&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Desired: GET `/api/item?q=test`&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;/api/item?q=&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;encodeURIComponent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;test&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;get&#39;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ...&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thankfully, &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/URL_API&quot;&gt;URL API&lt;/a&gt;
and
&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams&quot;&gt;URLSearchParams&lt;/a&gt;
helped clean up this code.&lt;/p&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Desired: GET `/api/item?q=test`&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; url &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/api/item&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; location&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;href&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
url&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;searchParams&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;q&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;test&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token function&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;get&#39;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;res&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; res&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ...&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I really love how readable and flexible it is! We&#39;re also using Babel and
core-js@3 in our builds, so the URL API is polyfilled automatically when needed!
This code snippet might not be as succinct as just using a library&#39;s version of
fetch, but I&#39;d like to keep our build sizes lower if I can help it.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Year in Review - 2019</title>
    <link href="https://www.lion-byte.com/blog/year-in-review-2019/"/>
    <updated>2020-01-18T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/year-in-review-2019/</id>
    <content type="html">&lt;p&gt;Last year was wild all around.&lt;/p&gt;
&lt;p&gt;Since I graduated from UNL December 2018, I was relieved of one source of
constant anxiety. Although, I didn&#39;t have a job lined up beforehand, so I was
pretty much scrambling to find interviews here in Omaha.&lt;/p&gt;
&lt;p&gt;After about 2 months of searching and sending resumes, I was hired at National
Indemnity Company. It was exciting to start my first full-time job, but I knew
that I wasn&#39;t working with the latest technologies. Regardless, I did gain
skills and techniques for working with legacy codebases.&lt;/p&gt;
&lt;p&gt;Months passed, and I still felt like my already developed skills weren&#39;t being
put to good use. I knew git and git workflows. I knew about writing
pure/semi-pure functions and unit testing them. I knew so much modern JavaScript
features and knew that they would never be used here. Obviously I was
nit-picking what I didn&#39;t like, but I was really concerned about falling behind
the rest of the industry.&lt;/p&gt;
&lt;p&gt;Additional factors at work eventually led to my decision to find work elsewhere.
Luckily, Derek Waskel, an old classmate of mine, reached out to me for a
position at gWorks. It felt strange to leave a place only after 8 months, but I
felt this was the best choice to make. I&#39;ve been really satisfied being a part
of the team here.&lt;/p&gt;
&lt;p&gt;Last year, I wrote goals did not really meet them. To be fair, they were
extremely vague and I had less free-time to focus on them. I&#39;ve actually stopped
having new year resolutions and opted towards a lookback approach; hence, this
post. No one can tell the future, and I don&#39;t feel like disappointing myself
with arbitrary goals.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Building RPJournal</title>
    <link href="https://www.lion-byte.com/blog/building-rpjournal/"/>
    <updated>2019-02-19T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/building-rpjournal/</id>
    <content type="html">&lt;h2&gt;Past Situations&lt;/h2&gt;
&lt;p&gt;So I&#39;ve been regularly playing tabletop role-playing games for a couple of
years - with the occasional breaks. Some breaks have gone for up to to 6 weeks.
Since we didn&#39;t really keep much notes outside of our character sheets, we had
try to remember by scrolling up through our previous chat logs to make sense of
the current plot.&lt;/p&gt;
&lt;p&gt;That worked during the year and a half that the campaign lasted. I only wished
we recorded &lt;em&gt;more&lt;/em&gt; of the funny moments we said only over voice chat.&lt;/p&gt;
&lt;p&gt;About 6 months passed, and I really wanted to get into another campaign. My
other friend was excited to be our dungeon master for our local friend group!&lt;/p&gt;
&lt;h2&gt;Little Wishes for Improvement&lt;/h2&gt;
&lt;p&gt;This time around, he asked that someone be the note-taker for our sessions.
Given that I had a lot of spare paper lying around, I took... &lt;em&gt;initiative&lt;/em&gt; and
offered to do it. While I wouldn&#39;t say these notes were exhaustive, they did
help a lot months into our campaign.&lt;/p&gt;
&lt;p&gt;As the notes spanned over about a dozen pages, I wanted to move towards a more
compact format. I spent a couple days transferring my notes to a single Google
Docs file with the same structure as my college class lectures. It&#39;s still my
current solution, since I became very efficient with the learned shortcuts.&lt;/p&gt;
&lt;p&gt;Although I am largely satisfied with typing it all out, I still find myself
needing to keep a couple sheets and sticky notes at my side. I&#39;m perfectly fine
keeping my character&#39;s inventory on paper; that&#39;s always shifting. It&#39;s the
other details like quests, NPCs, sketches/pictures, etc. I didn&#39;t want to
maintain additional small files. I also wanted all this information to flow
together well, like in many story-driven RPGs.&lt;/p&gt;
&lt;h2&gt;Prototype&lt;/h2&gt;
&lt;p&gt;After going through Wes Bos&#39;s &lt;a href=&quot;https://advancedreact.com/&quot;&gt;Advanced React&lt;/a&gt;
course, I decided to plan out my own solution for this need. Although my
dependencies differ slightly from the course, the concepts really let me
accelerate the process.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.lion-byte.com/images/blog/rpjournal-1.png&quot; alt=&quot;Prototype adventure page for a podcast called &#39;Till Death Do Us Blart&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The application centers around three types of models: &lt;em&gt;Adventures&lt;/em&gt;, &lt;em&gt;Sessions&lt;/em&gt;,
and &lt;em&gt;Quests&lt;/em&gt;. Adventures are the main model that reference an RPG campaign or
story, as well as the sessions and quests for it. The screenshot above shows the
initial presentation of an Adventure page.&lt;/p&gt;
&lt;p&gt;At this point, there&#39;s the usual create, read, and update functions for each
data model. I put off deleting until after user authentication is added. I&#39;m
happy with the potential for this after setting up the basic version.&lt;/p&gt;
&lt;h2&gt;Later Plans&lt;/h2&gt;
&lt;p&gt;I planned a break between the prototype and the &amp;quot;phase II&amp;quot; start date so that I
can use it and think about improvements. I&#39;m definitely going to modify some
actions to flow a little nicer, like creating and updating sessions. I&#39;m not
going to list all of my tasks here, but I am putting them in a GitHub
&lt;a href=&quot;https://github.com/MarkH817/RPJournal/projects/2&quot;&gt;project page&lt;/a&gt;. I&#39;ll write
about it more once that phase is done and deployable somewhere.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Year in Review - 2018</title>
    <link href="https://www.lion-byte.com/blog/year-in-review-2018/"/>
    <updated>2018-12-29T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/year-in-review-2018/</id>
    <content type="html">&lt;h2&gt;2018&lt;/h2&gt;
&lt;h3&gt;Gatsby JS&lt;/h3&gt;
&lt;p&gt;I moved my personal site to Gatsby around February. There’s been plenty of
design changes since then, but the framework still worked all the same to me.
It’s been incredibly insightful in how I should organize my other projects. It’s
also been a great introduction to tools like GraphQL. I’ve made a couple of mini
projects with this framework with very little trouble!&lt;/p&gt;
&lt;h3&gt;GraphQL&lt;/h3&gt;
&lt;p&gt;Since Gatsby had a pleasant development experience, I decided to implement a
GraphQL server and front-end portion using Apollo-Server and Apollo-Client,
respectively. This was for a synthetic biology group to create safety diagrams.
I built the whole application in less than 6 weeks!&lt;/p&gt;
&lt;h3&gt;VS Code&lt;/h3&gt;
&lt;p&gt;I moved from Atom to VS Code almost exactly a year ago. Throughout this year,
I’ve enjoyed VS Code more and more. I used a lot less extensions compared to
what I used in Atom, but I got way more productive afterwards with this. The
Intellisense and TypeScript checking built-in made me enjoy documenting
functions and methods since they provide helpful tooltips. It’d also helped with
git commits and syncing with a slim git diff interface.&lt;/p&gt;
&lt;h3&gt;Styled-Components&lt;/h3&gt;
&lt;p&gt;This is more of a recent find, for me. This has quite easily replaced LESS for
my use cases. I tried to do a similar file organization with LESS, but it was
tedious to go back-and-forth between that and the related React component.
Styled-Components has the nesting styles feature that’s also found in LESS and
SASS. With that, I don’t think I’ll be using anything else since I usually stick
with React. Cascading styles have never been an issue for me, since I make sure
class names are unique, but this does make it less time-consuming for
solo-/mini-projects.&lt;/p&gt;
&lt;h3&gt;First Conference Attendance: NebraskaJS&lt;/h3&gt;
&lt;p&gt;I’ve watched plenty of conference talks posted on YouTube, but there’s something
special about seeing the talks live. However, feelings of imposter syndrome
crept up on me as the day went on. I’m pretty sure I was one of the youngest in
the audience. Despite that, I did get a glimpse of where I should move my focus
for future projects.&lt;/p&gt;
&lt;h3&gt;Move to Omaha&lt;/h3&gt;
&lt;p&gt;For years, I lived in Lincoln on the UNL campus. My graduation was coming up
later in mid-December, so I moved in with some friends in Omaha. I was always
expecting to go to Omaha, since it’s more lively and active.&lt;/p&gt;
&lt;h2&gt;Future Goals in 2019&lt;/h2&gt;
&lt;h3&gt;Working Out&lt;/h3&gt;
&lt;p&gt;This isn’t a surprising goal, but it’s always good to be active. I’ve been
meaning to go back to the gym, but I keep feeling so self-conscious when I
arrive. I need to stop that. Who cares about whatever I’m doing there (so long
as I’m not putting myself in danger)? I&#39;m definitely going to ease that anxiety
with some Discover Weekly playlists on Spotify.&lt;/p&gt;
&lt;h3&gt;More Blog Posts&lt;/h3&gt;
&lt;p&gt;Would you be surprised that I filled out at least two journals within the last
four years? The entries are more for myself when I re-read them in the future.
I’m going to try to write at least 1-2 posts per month with either things I’m
learning or some slice of life entries. I&#39;ll find a better voice for these
entries as time goes on.&lt;/p&gt;
&lt;h3&gt;Art&lt;/h3&gt;
&lt;p&gt;I have plenty of sketchbooks, ink pens, and markers on my shelves. It’s been a
long time since I used them, but I really love coming back to them every now and
again. I’d like to revisit this hobby more often. At least create something
beyond a sketch once a month.&lt;/p&gt;
&lt;h3&gt;Side Projects&lt;/h3&gt;
&lt;p&gt;I&#39;ve made a
&lt;a href=&quot;https://www.npmjs.com/package/generator-lionbyte&quot;&gt;JavaScript project generator&lt;/a&gt;,
two &lt;a href=&quot;https://soft-sight.netlify.com/&quot;&gt;gift&lt;/a&gt;
&lt;a href=&quot;https://festive-carson-768b57.netlify.com/&quot;&gt;websites&lt;/a&gt; for some friends, and
this blog all on my free time throughout this year. That&#39;s not including
development and contributions to the year-long senior design project or the
safety diagram project. These side projects and other open-ended projects allow
me to freely experiment with tools and formats! I&#39;d like to continue doing so
more often. There are new libraries and releases being developed, and I would
like to at least play around with them.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Commuting and Podcasts</title>
    <link href="https://www.lion-byte.com/blog/commuting-and-podcasts/"/>
    <updated>2018-12-15T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/commuting-and-podcasts/</id>
    <content type="html">&lt;p&gt;Ha, well it&#39;s been a while since I last wrote a post here. Working on summer
projects, finishing my last classes, and moving to Omaha filled up my past 6
months. During that time, I’ve been commuting to Lincoln, which was lengthy
compared to having everything within 15 minutes.&lt;/p&gt;
&lt;p&gt;For the first couple of months, I just had the radio playing. However, the
signal to my favorite station gets hazy the closer I get to Lincoln. Other
stations played either five songs on repeat or country songs. I grabbed my
Spotify Discover Weekly for at least two months, but sometimes the algorithm
missed my tastes pretty badly.&lt;/p&gt;
&lt;p&gt;I mixed in podcasts between weekly playlists. It turns out that this was the
perfect situation to listen and catch up on lengthy podcast episodes. They’ve
made my 2 hours of driving per day something to enjoy rather than suffer!&lt;/p&gt;
&lt;p&gt;My main collection of podcasts includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Syntax&lt;/strong&gt; - This is all about web development, but they’re a lot more lively
than most others on the topic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Developer Tea&lt;/strong&gt; - This podcast focuses on the human-side of software
development: stress, goal management, the reasons behind fundamental rules in
development, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wonderful!&lt;/strong&gt; - An enthusiast podcast celebrating the small or large items or
activities!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shmanners&lt;/strong&gt; - An etiquette podcast for often unspoken rules in special
occasions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;My Brother, My Brother, and Me&lt;/strong&gt; - A comedy podcast by three brothers giving
advice comedically.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’ve been listening to most of these for over a year; I came across Developer
Tea only three months ago. I would wholeheartedly recommend checking out these
shows if you’re curious.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>JavaScript Crash Course</title>
    <link href="https://www.lion-byte.com/blog/js-crash-course/"/>
    <updated>2018-07-10T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/js-crash-course/</id>
    <content type="html">&lt;p&gt;I wrote most of this post roughly a year ago for my Design Studio team, since
some of our team members have not used JavaScript before. This is only meant to
be a starting point in learning JavaScript.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;JavaScript Syntax&lt;/h2&gt;
&lt;p&gt;JavaScript is a loosely-typed language. Instead of using &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;boolean&lt;/code&gt;, etc.,
to initialize a variable, &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, and &lt;code&gt;const&lt;/code&gt; are used instead.&lt;/p&gt;
&lt;h3&gt;Variable Initialization&lt;/h3&gt;
&lt;p&gt;Note: We will use only &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Cannot assign another value to this variable&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; isEclipseFunky &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; age &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;Tony&#39;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// This is a plain object.&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; allStar &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;some&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;body&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;once&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;told me&#39;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// List of numbers&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; numberList &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;25.01&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// Can hold mixed different types of data&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; mixedList &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;token string&quot;&gt;&quot;I&#39;m a string using double-quotes&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token string&quot;&gt;&#39;I am a string using single-quotes&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;I&#39;m a string using backticks&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token number&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Functions&lt;/h3&gt;
&lt;p&gt;Functions in JavaScript are a bit more flexible here. They can be assigned to
variables and arguments to other functions.&lt;/p&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;addNums&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;a&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; a &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; b
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; addResult &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;addNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// 3&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// Using a function as an input&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// It will use the callbackFunction input within the function.&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// Many APIs and libraries do this&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;multiplyNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;a&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; b&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; callbackFunction&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; result &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; a &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; b
  &lt;span class=&quot;token function&quot;&gt;callbackFunction&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;result&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// Note: The function is unnamed. It&#39;s fine if we only use it once.&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;multiplyNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;answer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;answer&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// 24&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// Alternatively, we can write it like this:&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;multiplyNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token parameter&quot;&gt;answer&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;answer&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// 45&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Classes&lt;/h3&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Person&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; age&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;name &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; name
    &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;age &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; age
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;token comment&quot;&gt;// This is a method&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;introduce&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token template-string&quot;&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;My name is &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;name&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;. I am &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;age&lt;span class=&quot;token interpolation-punctuation punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt; years old.&lt;/span&gt;&lt;span class=&quot;token template-punctuation string&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// New instance of Person class&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; p1 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;Marty&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
p1&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;introduce&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// console reads: &#39;My name is Marty. I am 15 years old.&#39;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// You can extend classes as well&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Student&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Person&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; age&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; id&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; age&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;id &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; id
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;token function&quot;&gt;showId&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    console&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;token comment&quot;&gt;// `introduce ()` still exists&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Modules&lt;/h2&gt;
&lt;p&gt;You can have functions, classes, and constants &lt;code&gt;export&lt;/code&gt;ed from one file and
&lt;code&gt;require&lt;/code&gt;d / &lt;code&gt;import&lt;/code&gt;ed in another.&lt;/p&gt;
&lt;p&gt;Let&#39;s have a simple example. Assume that both files are in the same directory.&lt;/p&gt;
&lt;h3&gt;Exporting&lt;/h3&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// `math.js`&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;addNums&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;a&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; a &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; b
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;multiplyNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;a&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; a &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; b
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// (1) Here&#39;s where we export the functions&lt;/span&gt;
module&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;exports &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;addNums&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; addNums&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token literal-property property&quot;&gt;multiplyNums&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; multiplyNums
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// (2) Note: if the property name and variable names are the same&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// like in the lines above, then it can be written as such:&lt;/span&gt;
module&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;exports &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  addNums&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  multiplyNums
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For JavaScript that is transpiled with &lt;code&gt;webpack&lt;/code&gt;, &lt;code&gt;parcel&lt;/code&gt;, or any other
bundler, you can use the ES6 syntax for exporting.&lt;/p&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// (3) Exporting as it is defined&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token function-variable function&quot;&gt;addNums&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;a&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;multiplyNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;a&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Requiring / Importing&lt;/h3&gt;
&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// `index.js`&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// This will import from `math.js` in the same directory&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// (1) You can specify which functions, classes, or constants you want using this syntax. More on this in the links below&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; addNums&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; multiplyNums &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;./math&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// (2) The other way is like this:&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/*
  const math = require(&#39;./math&#39;)
  const addNums = math.addNums
  const multiplyNums = math.multiplyNums
*/&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// (3) ES6 `import` syntax&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/*
  import { addNums, multiplyNums } from &#39;./math&#39;
*/&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; addResult &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;addNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// 6&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; multResult &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;multiplyNums&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// 21&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note: &lt;code&gt;import&lt;/code&gt; / &lt;code&gt;export&lt;/code&gt; is not available in Node.js natively at this time.
Only &lt;code&gt;module.exports&lt;/code&gt; and &lt;code&gt;require()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;There are other neat features to ES6 that you can learn in the resources linked
below.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Node.JS&lt;/h2&gt;
&lt;p&gt;Node.js is a runtime environment that interprets JavaScript - similar to JVM for
Java. Node.js lets a JavaScript program be organized into separate
files/modules.&lt;/p&gt;
&lt;h3&gt;NPM&lt;/h3&gt;
&lt;p&gt;NPM is &lt;em&gt;unofficially&lt;/em&gt; called the Node Package Manager. (Technically it&#39;s not an
acronym according to the NPM team, but whatever.) This is used to manage
JavaScript packages and projects.&lt;/p&gt;
&lt;h3&gt;package.json and package-lock.json&lt;/h3&gt;
&lt;p&gt;Node.js projects, like any other project, will have to manage dependencies. They
also need to be tested, built, etc. Luckily, the package.json file holds all the
information listed above!&lt;/p&gt;
&lt;p&gt;The important sections in that file are as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;name&lt;/code&gt; - Project name&lt;/li&gt;
&lt;li&gt;&lt;code&gt;version&lt;/code&gt; - Project version&lt;/li&gt;
&lt;li&gt;&lt;code&gt;description&lt;/code&gt; - Project description&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scripts&lt;/code&gt; - Command-line scripts that are run. It&#39;s way better save the
commands here than trying to memorize them. (Or have them forgotten, and no
one can run anything.)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;main&lt;/code&gt; - Specifies the primary file where everything runs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dependencies&lt;/code&gt; - Holds list of required dependencies for the project&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devDependencies&lt;/code&gt; - Holds list of dependencies used only for development&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All packages added to the project update the package-lock.json file. This file
saves the specific versions and the dependencies&#39; dependencies. This was added
in version 5 of npm.&lt;/p&gt;
&lt;h3&gt;CLI Commands&lt;/h3&gt;
&lt;p&gt;NPM uses the package.json file to run the commands below&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm install &amp;lt;package-name&amp;gt;&lt;/code&gt; - adds package to &lt;code&gt;dependencies&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm install -D &amp;lt;package-name&amp;gt;&lt;/code&gt; - adds package to &lt;code&gt;devDependencies&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm run &amp;lt;command&amp;gt;&lt;/code&gt; - runs the appropriate script in the &lt;code&gt;scripts&lt;/code&gt; section&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm start&lt;/code&gt; - equivalent to &lt;code&gt;npm run start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm test&lt;/code&gt; - equivalent to &lt;code&gt;npm run test&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;p&gt;Hopefully this gives you a clear idea about JavaScript and Node.js. I&#39;ll update
this post as needed in the future. Linked below are some other tutorials or
resources that may be helpful to you.&lt;/p&gt;
&lt;h2&gt;More Info/Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://devdocs.io/javascript/&quot;&gt;DevDocs - JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://babeljs.io/learn-es2015/&quot;&gt;Learn ES2015&lt;/a&gt; (Note: ES6 and ES2015 are
different names for the same thing.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://javascript.info/&quot;&gt;The Modern JavaScript Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://node.university/blog/502765/node-for-java-devs&quot;&gt;Node for Java Developers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://dzone.com/articles/what-is-Nodejs-for-java-developers&quot;&gt;What is Node.JS for Java Developers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.npmjs.com/getting-started/using-a-package.json&quot;&gt;Using a &lt;code&gt;package.json&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  
  <entry>
    <title>Design Studio, XKit, and TypeScript</title>
    <link href="https://www.lion-byte.com/blog/ds-xkit-and-typescript/"/>
    <updated>2018-06-17T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/ds-xkit-and-typescript/</id>
    <content type="html">&lt;p&gt;It&#39;s been over six weeks since my spring semester ended and a quite a bit has
happened since my last post.&lt;/p&gt;
&lt;h2&gt;Design Studio&lt;/h2&gt;
&lt;p&gt;In my capstone course for my computer science major,
&lt;a href=&quot;https://newsroom.unl.edu/announce/cse/7994/45857&quot;&gt;I received a Rockstar Developer award&lt;/a&gt;
for &amp;quot;outstanding work leading and contributing to the overall final product and
growth of their team members.&amp;quot; I am grateful for the peer nomination for the
award. I loved being the team&#39;s Development Manager for in this year.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.lion-byte.com/images/blog/ds-rockstar.jpg&quot; alt=&quot;Design Studio Rockstar Award attributed to Mark Hernandez for the 2017-2018 year.&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After the Design Studio showcase, I chose to keep working on the project as an
Undergraduate Research Assistant for Myra Cohen. She was amazed at the outcome
and welcomed my continued contribution to this and other undergraduate research
projects. I&#39;m looking forward to that!&lt;/p&gt;
&lt;h2&gt;XKit&lt;/h2&gt;
&lt;p&gt;Since I have had a bit of spare time outside of that project, I&#39;ve been itching
to contributing to
&lt;a href=&quot;https://github.com/new-xkit/XKit&quot;&gt;an open source project, XKit&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Tumblr is a blogging platform that I use fairly frequently, and XKit feels like
a must-have since there&#39;s so many enhancements. XKit is a browser extension that
customizes and improves Tumblr&#39;s interface. There&#39;s a whole collection of
enhancements available within the project. My favorite enhancement is &amp;quot;One-Click
Postage&amp;quot; since it makes reblogging posts easier with less clicks.&lt;/p&gt;
&lt;p&gt;XKit has been actively maintained since 2014 and has some legacy code to show. I
love using the extension and wanted to lend any assistance I could provide. I
started by improving their CI test speed by updating their configurations. It
was minor but needed since they were using an unmaintained version of Node.&lt;/p&gt;
&lt;p&gt;I then saw that only &lt;code&gt;eslint&lt;/code&gt; was used in their test script. No unit or
integration tests. Due to the project’s structure, their testing options were
limited without doing a whole rework.&lt;/p&gt;
&lt;p&gt;Initially, I wanted to modularize the project to allow more tests to be added.
They&#39;ve discussed doing so before in a GitHub issue labeled
&lt;a href=&quot;https://github.com/new-xkit/XKit/issues/478&quot;&gt;The Great Modularization Project#478&lt;/a&gt;.
It became very apparent extremely quickly that this wasn&#39;t going to be an simple
task.&lt;/p&gt;
&lt;p&gt;The structure of the API revolves around a single god-object variable with parts
of it being defined dynamically. Those were not great practices but that&#39;s due
to the design choices made early on in the project.&lt;/p&gt;
&lt;p&gt;Instead of tackling a large task, I thought it would be better to try and
improve their test suite. That way, big changes can be made faster without the
fear of breaking any features.&lt;/p&gt;
&lt;p&gt;Given that unit tests weren&#39;t currently available, I looked into using
TypeScript since it provides a type system on top of JavaScript.&lt;/p&gt;
&lt;h2&gt;TypeScript&lt;/h2&gt;
&lt;p&gt;When I first learned about TypeScript two years ago, I will admit that I was
hesitant about using it. I felt fairly confident that I could do without it, so
I just wrote it off as &amp;quot;JavaScript for those who know just Java.&amp;quot;&lt;/p&gt;
&lt;p&gt;However, after I swapped over to VS Code back in December, I noticed nice
autocomplete suggestions that were very relevant. This was because of the
Intellisense packed into the editor. It even gave type specific methods since it
was using TypeScript as well! This, in my opinion, was a good way of introducing
TypeScript.&lt;/p&gt;
&lt;p&gt;I added TypeScript to my side projects in later months and found a couple
uncaught faults. It was mostly just placing the wrong input in a library&#39;s
function. The configuration was very simple, and the documentation was stellar!&lt;/p&gt;
&lt;p&gt;So after trying it out, I decided to add TypeScript to the XKit project.&lt;/p&gt;
&lt;p&gt;It&#39;s been a challenge to write the declaration file since the API docs are both
incomplete and outdated in some places. I took time to look into the source code
and took notes. I wrote a decent chunk of definitions before running &lt;code&gt;tsc&lt;/code&gt; and
there were around 700 marked errors.&lt;/p&gt;
&lt;p&gt;Many errors came from type mismatches in some extensions. The rest of those were
because some API methods were defined in another file. This was just recently
refactored so that they&#39;re all in one file, which makes my task a lot easier.&lt;/p&gt;
&lt;p&gt;This is still a work in progress, and I will be happy to make more contributions
to this and other projects in the future.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Updating generator-lionbyte</title>
    <link href="https://www.lion-byte.com/blog/updating-generator-lionbyte/"/>
    <updated>2018-03-11T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/updating-generator-lionbyte/</id>
    <content type="html">&lt;p&gt;On March 9, 2018, I updated my package
&lt;a href=&quot;https://www.npmjs.com/package/generator-lionbyte&quot;&gt;&lt;code&gt;generator-lionbyte&lt;/code&gt;&lt;/a&gt; to
v1.0.1!&lt;/p&gt;
&lt;p&gt;Today, I want to share all the changes I made and my thoughts as I was working
on it.&lt;/p&gt;
&lt;p&gt;If you want to follow along or review the changes at your leisure, here are
links to the version tags:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/MarkH817/generator-lionbyte/tree/v0.4.0&quot;&gt;v0.4.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/MarkH817/generator-lionbyte/tree/v1.0.1&quot;&gt;v1.0.1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can check the diffs on this page:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/MarkH817/generator-lionbyte/compare/v0.4.0...v1.0.1&quot;&gt;Compare changes from v0.4.0 to v1.0.1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Why I Decided to Update&lt;/h2&gt;
&lt;p&gt;I was using VS Code&#39;s debugger for Java for homework in my network
communications class, and I thought it was a pretty great tool. I wanted to do a
better job of debugging my JavaScript projects and rely less on console.log().&lt;/p&gt;
&lt;p&gt;I did a quick search for any how-to articles and found
&lt;a href=&quot;https://spin.atomicobject.com/2016/10/29/debug-es6-code-in-node-js/&quot;&gt;one by Matt Rozema&lt;/a&gt;.
Essentially, there were 3 options: debug the transpiled version, installing
another package for debugging, or setting the IDE&#39;s configuration to use
&lt;code&gt;babel-node&lt;/code&gt;. All of these options seemed tedious to me, and I wanted to avoid
it if I could.&lt;/p&gt;
&lt;p&gt;Then I thought, &amp;quot;Maybe I don&#39;t need to use babel-node?&amp;quot; The feature I absolutely
wanted to keep was async/await; they make it easier to work with Promises.
According to &lt;a href=&quot;https://node.green/&quot;&gt;node.green&lt;/a&gt;, that particular ES2017 feature is
&lt;a href=&quot;https://node.green/#ES2017-features-async-functions&quot;&gt;available all the way back to Node v7.10.1&lt;/a&gt;!
I use the latest available Node version on my personal machines, so I&#39;m content.&lt;/p&gt;
&lt;p&gt;As I was looking through the page, I saw that ES6 import/export was not natively
supported. I read Vance Lucas&#39;s article
&lt;a href=&quot;http://vancelucas.com/blog/dont-transpile-javascript-for-node-js/&quot;&gt;Don’t Transpile JavaScript for Node.js &lt;/a&gt;
afterward. He basically reaffirmed that I came to the right conclusions. He
mentioned that &lt;code&gt;babel&lt;/code&gt; converts import/export down to require() and
module.exports. It&#39;s still useful for client-side code, since &lt;code&gt;webpack&lt;/code&gt; can
parse and transpile it.&lt;/p&gt;
&lt;p&gt;Thus, I decided to start updating my package.&lt;/p&gt;
&lt;h2&gt;Prettier&lt;/h2&gt;
&lt;p&gt;Although &lt;code&gt;prettier&lt;/code&gt; doesn&#39;t necessarily affect the functionality, this
basically helped save me from my past self. The last time I really worked on
this project was around mid-December, so I should make everything easier to read
and resume. I saw that &lt;code&gt;prettier&lt;/code&gt; paired well with &lt;code&gt;standard&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Removing babel-node Usage&lt;/h2&gt;
&lt;p&gt;This was tedious, but not difficult. I re-wrote the modules to use require and
module.exports as needed.&lt;/p&gt;
&lt;p&gt;Then I saw that the build scripts I wrote using &lt;code&gt;gulp&lt;/code&gt; would be useless for
Node.js specific projects. It was using &lt;code&gt;gulp-babel&lt;/code&gt; to transpile the code, but
I don&#39;t intend to write any code to be used for Node versions &amp;lt; 8.&lt;/p&gt;
&lt;p&gt;Therefore, I decided that I don&#39;t need gulp anymore.&lt;/p&gt;
&lt;h2&gt;Removing gulp Usage&lt;/h2&gt;
&lt;p&gt;There were a lot of tasks, and I was using &lt;code&gt;gulp-hub&lt;/code&gt; to let the tasks be split
into separate files. The problem was, that took a long time to load all the
separate files before running a single task.&lt;/p&gt;
&lt;p&gt;The task files were distributed among the subgenerators. The server and default
project types no longer needed them, so that was easy. In a way, it was pretty
satisfying to delete all those files.&lt;/p&gt;
&lt;p&gt;When I went to the static-site project type, I saw that it was heavily relying
on gulp. It was... not the best, to say the least. I&#39;m starting to realize that
I was using way too much RAM during development with that configuration.&lt;/p&gt;
&lt;h2&gt;Using webpack@4 (Legato)&lt;/h2&gt;
&lt;p&gt;Since I was removing all gulp tasks, I thought it would be better to fully
utilize &lt;code&gt;webpack&lt;/code&gt;. Although it recently updated to v4, codenamed &amp;quot;Legato,&amp;quot; it&#39;s
a good chance for me upgrade my other projects using v3.&lt;/p&gt;
&lt;p&gt;I previously only used webpack to package the JavaScript portion of a project.
Now I&#39;m letting it build and bundle everything. Most plugins have already
updated to support this version, but some have to be installed with either
@latest or @next. As of March 11, 2018, it is the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;extract-text-webpack-plugin@next&lt;/li&gt;
&lt;li&gt;html-webpack-plugin@latest&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can look at the webpack
&lt;a href=&quot;https://github.com/MarkH817/generator-lionbyte/tree/v1.0.1/src/static-site/templates&quot;&gt;configuration files that I defined here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Lessons Learned&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Node.js versions &amp;gt; 8 already support all JavaScript features I want and &lt;em&gt;more&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;prettier&lt;/code&gt; and &lt;code&gt;standard&lt;/code&gt; code formatters are a nice pair&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gulp&lt;/code&gt; is still pretty good, but has better use cases for it&lt;/li&gt;
&lt;li&gt;&lt;code&gt;webpack&lt;/code&gt; does so much for web development&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  
  <entry>
    <title>Hello</title>
    <link href="https://www.lion-byte.com/blog/hello/"/>
    <updated>2018-02-16T00:00:00Z</updated>
    <id>https://www.lion-byte.com/blog/hello/</id>
    <content type="html">&lt;p&gt;Hello! My name is Mark Hernandez, and I am a web developer.&lt;/p&gt;
&lt;h2&gt;Previous Site Attempts&lt;/h2&gt;
&lt;p&gt;Now this isn&#39;t the first time I&#39;ve tried to build my personal site. I think I
tried about two or three times? I deleted those versions, so I can&#39;t provide any
visual comparisons.&lt;/p&gt;
&lt;h3&gt;Beginning&lt;/h3&gt;
&lt;p&gt;At first, I tried Jekyll. (This was all before I used NodeJS. Probably in my
second year of college.) It was great, but running Ruby on Windows wasn&#39;t. I
believe I was trying to use LESS instead of SASS. I couldn&#39;t modify it very much
because I was missing some gems. I left it untouched for a long time and
eventually scrapped it.&lt;/p&gt;
&lt;p&gt;By all means, Jekyll is still a great static site generator and is very robust!
The documentation is well-organized and thorough.&lt;/p&gt;
&lt;h3&gt;One and a Half Years Later&lt;/h3&gt;
&lt;p&gt;I had a pretty good understanding of NodeJS, React, Gulp, and Webpack. I made my
custom Yeoman generator
(&lt;a href=&quot;https://github.com/MarkH817/generator-lionbyte&quot;&gt;generator-lionbyte&lt;/a&gt;) for
myself to demonstrate my understanding of the tools.&lt;/p&gt;
&lt;p&gt;I used this to try making my personal site again. Since I was using this custom
configuration, everything had to be changed manually. I took a step back and
searched for a better solution for myself.&lt;/p&gt;
&lt;h2&gt;Hello Gatsby&lt;/h2&gt;
&lt;p&gt;Now this... this is beautiful.&lt;/p&gt;
&lt;p&gt;With Gatsby, I created this site within 2-3 weeks, and it&#39;s way better than
anything I attempted to do before. All pages are built on React components. The
development and build processes for Webpack were already configured! Most
importantly, there&#39;s a huge ecosystem of plugins to extend Gatsby&#39;s abilities!&lt;/p&gt;
&lt;p&gt;Where was I when this lovely static-site generator came out? This is probably
going to be my go-to tool for any front-end portion of future projects!&lt;/p&gt;
&lt;h3&gt;Netlify Deployment&lt;/h3&gt;
&lt;p&gt;Originally, I was just deploying to GitHub pages. It&#39;s fine, but I wanted to use
a custom domain name. Unfortunately, I wouldn&#39;t have had &lt;code&gt;https&lt;/code&gt; if I stayed
there.&lt;/p&gt;
&lt;p&gt;After scrolling around on Twitter, I saw a couple tweets mentioning Netlify.
It&#39;s incredible how simple it is to deploy there -- with &lt;code&gt;https&lt;/code&gt; support too! It
builds and deploys from my main branch on the repository.&lt;/p&gt;
&lt;h2&gt;Lessons Learned&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Gatsby and Netlify are so great individually and together&lt;/li&gt;
&lt;li&gt;Webpack does a lot more than what I realized&lt;/li&gt;
&lt;li&gt;My appreciation for open source projects continuously increases&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
</feed>
