<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: sidney</title>
    <description>The latest articles on Forem by sidney (@sidney).</description>
    <link>https://forem.com/sidney</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%2F407728%2F49ac5859-52d6-41d5-9123-e1791b4f7da5.jpg</url>
      <title>Forem: sidney</title>
      <link>https://forem.com/sidney</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sidney"/>
    <language>en</language>
    <item>
      <title>My Best Friend Wants to Learn JavaScript – Here's What I Want Her to Know.</title>
      <dc:creator>sidney</dc:creator>
      <pubDate>Thu, 23 Jul 2020 15:07:06 +0000</pubDate>
      <link>https://forem.com/sidney/my-best-friend-wants-to-learn-javascript-here-s-what-i-want-her-to-know-npi</link>
      <guid>https://forem.com/sidney/my-best-friend-wants-to-learn-javascript-here-s-what-i-want-her-to-know-npi</guid>
      <description>&lt;h6&gt;
  
  
  Cover image: Bubble Bobble
&lt;/h6&gt;

&lt;p&gt;The other day, during a marathon FaceTime call, a good friend of mine offhandedly mentioned that she wanted to learn JavaScript. She has some knowledge of HTML and CSS (plus a dash of Python) but has never approached JS before. Being a beginner myself, I wanted to save her some pain– so I started gathering some links I've found helpful as I've been starting out.&lt;/p&gt;

&lt;p&gt;If you're reading this and you're not my friend Lea, that's okay too. Whoever you are, this is a very basic guide to some free resources for starting in JS, compiled by someone who &lt;a href="https://i.pinimg.com/originals/07/34/86/073486b72afbbe62164aca22dc6c7436.png"&gt;cares you.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is JavaScript?
&lt;/h2&gt;

&lt;p&gt;In my own words, in simplest terms: JavaScript is a programming language that can make things happen on web pages – without having to refresh the page. It's what lets you add comments that appear instantly, and makes the heart button turn red when you click it. But it's also super flexible, and can be used to build MUCH more complex things. Here are some overviews that say it better than I can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://javascript.info/intro"&gt;Here is a description of what JS is&lt;/a&gt; on the JS site itself.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics"&gt;Here's a great write-up in the MDN Docs,&lt;/a&gt; which will prove to be invaluable throughout your JS experience. It also includes a "Hello World" exercise to get you started. Which brings me to...&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Just reading up doesn't give you a gut understanding about how to work with JS. Different people like to approach learning a new programming language in different ways. You may want to start with an online course that walks you through the basics, or you might want to jump in feet-first and Google "How to do this in JS" as you go. Here are some options.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://medium.com/javascript-in-plain-english/javascript-for-absolute-beginners-519dca78ce4a"&gt;Sunil Sandhu's great plain-English JS Beginner's Guide&lt;/a&gt; is a really great primer.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codecademy.com/learn/introduction-to-javascript"&gt;Codecademy has a course on beginning JS.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Learn.co's curriculum on &lt;a href="https://github.com/learn-co-curriculum/js-and-the-web"&gt;JS/the web&lt;/a&gt; and &lt;a href="https://github.com/learn-co-curriculum/js-and-the-world"&gt;JS/the world&lt;/a&gt; are good starting points, and their repository has a ton of JS intro readme resources.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps"&gt;MDN Docs: JavaScript First Steps&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://javascript.info/"&gt;javascript.info&lt;/a&gt; is pretty verbose, but has EVERYTHING. In fact, you could probably stop reading my post right now and go over there and be better off.&lt;/li&gt;
&lt;li&gt;And finally, I highly recommend Dan Abramov and Maggie Appleton's &lt;a href="https://justjavascript.com/"&gt;Just JavaScript&lt;/a&gt;, which will come to you as a series of gorgeous emails and help you form your mental models of JS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Okay, but how do I actually... do it?
&lt;/h2&gt;

&lt;p&gt;First, you'll need an environment to program in. JavaScript traditionally works in-browser, so all you really need is a browser and a text editor to get started. JS devs tend to prefer Chrome and Firefox because of their robust developer tools. (&lt;a href="https://developers.google.com/web/tools/chrome-devtools/console"&gt;here's a guide to the Chrome console,&lt;/a&gt; and here's &lt;a href="https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console"&gt;one for Firefox&lt;/a&gt;) &lt;/p&gt;

&lt;p&gt;In terms of text editors, you've got a lot of choice. It's possible to write JavaScript in something as plain as TextEdit, but specialized apps like &lt;a href="https://atom.io/"&gt;Atom&lt;/a&gt; or &lt;a href="https://code.visualstudio.com/"&gt;Visual Studio Code&lt;/a&gt; are made for writing code and will make things easier. It's totally up to you what text editor you want to use – some are simpler, some more structured. There are tons. &lt;a href="https://www.google.com/search?rlz=1C5CHFA_enUS899US902&amp;amp;ei=zR0ZX8vgMqG-0PEP4Y2l0AY&amp;amp;q=best+code+editors&amp;amp;oq=best+code+editors&amp;amp;gs_lcp=CgZwc3ktYWIQAzIICAAQsQMQkQIyAggAMgIIADICCAAyAggAMgIIADICCAAyAggAMgIIADICCAA6BQgAEJECOgQIABBDOgsILhCxAxDHARCjAjoICC4QxwEQowI6BQgAELEDUOICWOgPYKgQaABwAHgCgAG0AogBrhiSAQcxLjIuOS4ymAEAoAEBqgEHZ3dzLXdpesABAQ&amp;amp;sclient=psy-ab&amp;amp;ved=0ahUKEwiL-5f4z-LqAhUhHzQIHeFGCWoQ4dUDCAw&amp;amp;uact=5"&gt;Google around!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use your browser's console to get familiar with the ins and outs of writing JavaScript. Then, when you want to test out your knowledge on your own web pages, all you have to do is create an HTML file with a &lt;code&gt;&amp;lt;script&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt; tag (&lt;a href="https://www.w3schools.com/js/js_whereto.asp"&gt;you can either insert JavaScript right in the file or link an external one&lt;/a&gt;, which is just a file with the extension .js). Open up your HTML file in the browser and you can test your code, and/or see all your &lt;a href="https://codeburst.io/javascript-error-messages-debugging-d23f84f0ae7c"&gt;errors in the console.&lt;/a&gt; :)&lt;/p&gt;

&lt;p&gt;You can also use online tools like &lt;a href="https://jsfiddle.net/"&gt;jsfiddle&lt;/a&gt; or &lt;a href="https://codepen.io/"&gt;codepen&lt;/a&gt; to play with JavaScript, which might be a good option to get your feet wet with minimal setup.&lt;/p&gt;

&lt;p&gt;To run JavaScript on your computer without having to use the browser, you should &lt;a href="https://docs.npmjs.com/downloading-and-installing-node-js-and-npm"&gt;install node.js and npm&lt;/a&gt;. &lt;a href="https://www.w3schools.com/nodejs/"&gt;Here's a guide to using it,&lt;/a&gt; although I admit I haven't played around much in Node.js yet. Once it's installed, you can type &lt;code&gt;node&lt;/code&gt; in your terminal to open up a JS console right on your computer, or run .js files using &lt;code&gt;node filepath.js&lt;/code&gt;. Pretty cool!&lt;/p&gt;

&lt;h2&gt;
  
  
  Slightly more advanced things
&lt;/h2&gt;

&lt;p&gt;Once you're familiar with the basics of JavaScript, here are a few resources I like for more advanced concepts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://maggieappleton.com/garden"&gt;Maggie Appleton's site&lt;/a&gt; has some wonderful illustrations and explanations about JS concepts.&lt;/li&gt;
&lt;li&gt;Similarly, Dan Abramov has recently started &lt;a href="https://whatthefork.is/"&gt;whatthefork.is&lt;/a&gt; for explaining JS thingies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the end of the links I have for now – I might add more resources for things like working with APIs as we go, or this might become a series, as long as Lea wants to keep hearing from me!&lt;/p&gt;

&lt;p&gt;Stay safe.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Make Your Terminal Phenerminal: Customizing Colors and Prompts</title>
      <dc:creator>sidney</dc:creator>
      <pubDate>Thu, 02 Jul 2020 17:15:00 +0000</pubDate>
      <link>https://forem.com/sidney/make-your-terminal-phenerminal-customizing-colors-and-prompts-3oa7</link>
      <guid>https://forem.com/sidney/make-your-terminal-phenerminal-customizing-colors-and-prompts-3oa7</guid>
      <description>&lt;h6&gt;
  
  
  Cover illustration by me, Sidney
&lt;/h6&gt;

&lt;p&gt;When I was a kid, opening up Terminal and playing &lt;a href="https://www.masteringemacs.org/article/fun-games-in-emacs"&gt;emacs games&lt;/a&gt; or watching &lt;a href="https://lifehacker.com/watch-star-wars-in-text-via-telnet-373571"&gt;telnet star wars&lt;/a&gt; felt like the ultimate hacker experience. Now that I use the command line for more mundane tasks like navigating my directories and generating Rails apps, I like the interface to be a little more exciting than the simple black-and-white default. &lt;/p&gt;

&lt;p&gt;As a total beginner, I didn't know there was such a thing as a framework like &lt;a href="https://ohmyz.sh/"&gt;Oh My Zsh&lt;/a&gt;, which lets you choose from its vast collection of themes– I didn't even know you could use programs other than Terminal as terminal emulators! Here's how I made my vanilla Zsh Terminal pretty in a very simple way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Terminal Themes and Colors
&lt;/h2&gt;

&lt;p&gt;If you open up Terminal's Preferences panel, you'll be able to choose from or edit themes, or "profiles." &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vsiOhYJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2q9pw84e8y9zsaaqgt5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vsiOhYJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2q9pw84e8y9zsaaqgt5k.png" alt="The Terminal preferences window on the Profiles tab."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You could create your own profile from scratch, choosing the &lt;a href="https://en.wikipedia.org/wiki/ANSI_escape_code"&gt;ANSI&lt;/a&gt; colors by hand, but I wanted my Terminal to take on the color scheme &lt;a href="https://ethanschoonover.com/solarized/"&gt;Solarized&lt;/a&gt; by Ethan Schoonover. Luckily, you can download a &lt;code&gt;.terminal&lt;/code&gt; file from the site that, when opened, creates a new Terminal profile with the Solarized colors.&lt;/p&gt;

&lt;p&gt;A whole lot more &lt;code&gt;.terminal&lt;/code&gt; files can be found in &lt;a href="https://github.com/lysyi3m/macos-terminal-themes"&gt;this repository by lysyi3m&lt;/a&gt;– if your computer won't let you open them because they're from an unidentified developer, just right-click and "Open With" Terminal. (Make sure 'display ANSI colors' is checked.)&lt;/p&gt;

&lt;p&gt;If you install a Zsh framework like Oh My Zsh, changing themes can be as simple as &lt;a href="https://github.com/ohmyzsh/ohmyzsh/wiki/themes"&gt;editing a line in your configuration file.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You know what else is as simple as editing a line in your configuration file?&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting a Frog in Your Prompt
&lt;/h2&gt;

&lt;p&gt;When I was tipped off that you could customize your command-line prompt, there was one obvious question I had to find out the answer to– "Can I put a frog in it?"&lt;/p&gt;

&lt;p&gt;Fortunately, gloriously, the answer is yes (as long as your terminal supports unicode, which it should). And I'm far from the first person to &lt;a href="https://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html"&gt;think&lt;/a&gt; - &lt;a href="https://osxdaily.com/2013/04/08/add-emoji-command-line-bash-prompt/"&gt;of&lt;/a&gt; - &lt;a href="https://loige.co/random-emoji-in-your-prompt-how-and-why/"&gt;putting&lt;/a&gt; - &lt;a href="https://medium.com/@joshuaxavier/how-to-customise-your-command-prompt-to-include-an-emoji-647e1f3e4027"&gt;emojis&lt;/a&gt; - &lt;a href="https://thomasweng.com/emoji_in_terminal/"&gt;in the prompt&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With zsh, you'll want to look for a file in your root directory called &lt;code&gt;zshrc&lt;/code&gt;. (It might be a hidden dotfile, which you can show in Finder by doing ⌘ + ⇧ + .) Once inside with the text editor of your choice, your target is the line that contains the default &lt;code&gt;prompt&lt;/code&gt;, which in Zsh is something like &lt;code&gt;%m%#&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Looking at a zsh prompt can be intimidating if you don't know how to read it, but all the prompt escapes can be found &lt;a href="http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Prompt-Expansion"&gt;here&lt;/a&gt; in the zsh manual. &lt;code&gt;%m&lt;/code&gt; gives the machine's hostname up to the first dot, and &lt;code&gt;%#&lt;/code&gt; shows a &lt;code&gt;#&lt;/code&gt; only if the shell is running with privileges.&lt;/p&gt;

&lt;p&gt;Here's my prompt, step by step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PS1="%F{green} %2~ 🐸 &amp;gt; %f"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;%F{color}&lt;/code&gt; starts a color, in my case &lt;code&gt;green&lt;/code&gt; to match my frog friend&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;%2~&lt;/code&gt; shows a &lt;code&gt;~&lt;/code&gt; at the home directory, or else the last two folders in your path when you're navigating around&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;🐸&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt;, characters on their own, followed by a space&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;%f&lt;/code&gt; ends a color, returning my input to the default blue.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  All Together Now
&lt;/h2&gt;

&lt;p&gt;As a final touch, I got rid of that "last login" message by running &lt;code&gt;touch .hushlogin&lt;/code&gt; in my root directory. Here's what a new Terminal window looks like, in the Solarized Light profile: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sbqKku2b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hchnqkaxzt2lfug57tal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sbqKku2b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hchnqkaxzt2lfug57tal.png" alt="Ahhh."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ahhh.&lt;/p&gt;
&lt;h2&gt;
  
  
  More Resources
&lt;/h2&gt;

&lt;p&gt;Armin Briegel at &lt;a href="https://scriptingosx.com/"&gt;scriptingosx.com&lt;/a&gt; does a great job explaining &lt;a href="https://scriptingosx.com/2019/07/moving-to-zsh-06-customizing-the-zsh-prompt/"&gt;how to customize the zsh prompt,&lt;/a&gt; and has a whole book on moving to zsh from bash. I highly recommend looking at his posts on &lt;a href="https://scriptingosx.com/2017/07/minimal-terminal-prompt/"&gt;minimal Terminal&lt;/a&gt; and &lt;a href="https://scriptingosx.com/2016/04/randomize-window-backgrounds-in-terminal/"&gt;rotating background colors&lt;/a&gt;, if you really want to get fancy.&lt;/p&gt;

&lt;p&gt;Laurie's post, below, outlines a way to get a different emoji depending on whether your last command was successful:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/laurieontech" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IbgcSZ9C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--yUg9Bm4o--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/67245/e2a3dc5d-879f-4b4e-ab35-09915fd2dd2f.jpg" alt="laurieontech image"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/laurieontech/adding-an-emoji-status-to-terminal-zsh-4cnd" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Adding an Emoji Status to Terminal (ZSH)&lt;/h2&gt;
      &lt;h3&gt;Laurie ・ Aug 21 '19 ・ 2 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#linux&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;p&gt;And if you're a command-line beginner like me, it's worth it to make use of aliases to supercharge your experience, as my classmate Anmol writes about here: (just put the aliases into your &lt;code&gt;zshrc&lt;/code&gt; file instead of &lt;code&gt;bashrc&lt;/code&gt;)&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@anmolpreet.kaur/how-to-save-valuable-time-with-bash-aliases-452bf02f206d" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i8Y9-7Xw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/fit/c/56/56/1%2ALq-yuQpzxe8utJN-cP5Lfg.png" alt="Anmolpreet Kaur"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@anmolpreet.kaur/how-to-save-valuable-time-with-bash-aliases-452bf02f206d" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;How to Save Valuable Time with Bash Aliases | by Anmolpreet Kaur | Medium&lt;/h2&gt;
      &lt;h3&gt;Anmolpreet Kaur ・ &lt;time&gt;Jun 16, 2020&lt;/time&gt; ・ 3 min read
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KBvj_QRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/medium_icon-90d5232a5da2369849f285fa499c8005e750a788fdbf34f5844d5f2201aae736.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Happy emoji-ing!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>zsh</category>
      <category>terminal</category>
      <category>mac</category>
    </item>
  </channel>
</rss>
