<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tim M. on Medium]]></title>
        <description><![CDATA[Stories by Tim M. on Medium]]></description>
        <link>https://medium.com/@Tim_M.?source=rss-2bdac7d4cd24------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bihE8vxize7tQlBXtZsd3w.png</url>
            <title>Stories by Tim M. on Medium</title>
            <link>https://medium.com/@Tim_M.?source=rss-2bdac7d4cd24------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:58:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Tim_M./feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Security Analysis: Rails]]></title>
            <link>https://medium.com/@Tim_M./security-analysis-rails-624db0dd6ca9?source=rss-2bdac7d4cd24------2</link>
            <guid isPermaLink="false">https://medium.com/p/624db0dd6ca9</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[Tim M.]]></dc:creator>
            <pubDate>Tue, 25 Oct 2022 07:51:56 GMT</pubDate>
            <atom:updated>2022-10-25T07:51:56.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K07JY770tumlnoKI.jpg" /></figure><h3>What is Rails?</h3><p>Rails is a web application framework that is used to build web applications. It is written in Ruby and runs on the Ruby interpreter. Rails has been around for over 10 years and has been used by many companies, including Twitter, Groupon, and Shopify.</p><p>Rails security vulnerabilities are a big problem because they can lead to data breaches or other security issues. In this blog, we will discuss some of the most common vulnerabilities found in Rails applications and how to fix them.</p><h3>Common Vulnerability: SQL injection</h3><p>The most common vulnerability in Rails is SQL injection. This vulnerability occurs when the user enters a string of text into a form field and the string gets converted into SQL code without being sanitized first. To fix this vulnerability, developers should always sanitize any input strings before converting them to SQL code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*ySjN6pjDMXKPR2-B.png" /></figure><h4>Preventing SQL injections in Rails</h4><p>Rails uses an Object Relational Mapping (ORM) framework called ActiveRecord to abstract interactions with a database. ActiveRecord, in most cases, protects against SQL Injections by default. However, there are ways how it can be used insecurely, which can lead to security issues.</p><p>Using ActiveRecord, we can select the user with the supplied id and retrieve that user’s username:</p><pre>User.find(params[:id]).username</pre><p>The above will return the username of the user whose user id matches the one supplied via the <em>params</em> hash. Let’s take a look at the SQL query generated by the code above on the backend:</p><pre>SELECT  &quot;users&quot;.* FROM &quot;users&quot;  WHERE &quot;users&quot;.&quot;id&quot; = ? LIMIT 1  [[&quot;id&quot;, 1]]</pre><p>As we can see from the SQL query above, when using the <em>find</em> method on the <em>User </em>object ActiveRecord is binding <em>id</em> to the SQL statement, protecting us from SQL Injection.</p><p>What if we wanted to select a user which matches a username and password, commonly seen in authentication forms? You might see something like this:</p><pre>User.where(&quot;username = &#39;#{username}&#39; AND encrypted_password = &#39;#{password}&#39;&quot;).first</pre><p>If we supply a username with the value <em>‘) OR 1–</em> the corresponding SQL query on the backend becomes:</p><pre>SELECT  &quot;users&quot;.* FROM &quot;users&quot;  WHERE (username = &#39;&#39;) OR 1--&#39; AND encrypted_password = &#39;a&#39;)  ORDER BY &quot;users&quot;.&quot;id&quot; ASC LIMIT 1</pre><p>By injecting our specially crafted SQL, what we have done is told the database to return all rows from the <em>users</em> table where the <em>username</em> is <em>null</em> or <em>true</em>. This makes the SQL statement return true along with all of the data in the <em>users</em> table.</p><h3>Common Vulnerability: Cross-site scripting</h3><p>Another common vulnerability in Rails is cross-site scripting (XSS). This occurs when an attacker injects malicious scripts into an application’s pages or posts using a variety of methods such as email, chat messages, or social media posts. To fix this vulnerability, developers should always validate user input before displaying it on the page and never trust data coming from outside sources such as cookies or URL parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*JhzTjM-5ME-JIJMO.png" /></figure><h4>Preventing Cross-Site Scripting (XSS)</h4><p>To help prevent cross-site scripting (XSS) vulnerabilities, we sanitize input and encode output using correct encoding for the output context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z0dbBM6QfbF9QhO2.png" /></figure><h4>Sanitizing Input</h4><p>Rails makes sanitizing user input easy with its MVC (Model View Controller) design. All data stored or retrieved from the database should pass through the model, so this is a great place to sanitize our stored data. Using active record validations within our models, we can ensure that data is present and/or in a specific format.</p><p>You can also sanitize the input/output in your view using the sanitize method. The sanitize method HTML encodes all tags and removes any attributes that are not explicitly allowed. Let’s pass it regular JavaScript XSS and see how it reacts:</p><pre>&lt;%= sanitize &#39;&lt;img src=x onerror=prompt(1)&gt;&#39; %&gt;</pre><p>The above will output:</p><pre><em>&lt;img src=&quot;x&quot;&gt;</em></pre><p>As we can see, the sanitize method has allowed our <em>img</em> tag with the <em>src</em> attribute, but it has removed the <em>onerror</em> event attribute. By default, if we don’t whitelist which tags/attributes we want, Rails will make that decision for us on what it believes is safe.</p><p>If we whitelist the <em>src</em> and <em>onerror</em> attributes, our XSS payload is executed:</p><pre>&lt;%= sanitize &#39;&lt;img src=x onerror=prompt(1)&gt;&#39;, attributes: %w(src onerror) %&gt;</pre><p>The above will output:</p><pre>&lt;img src=&quot;x&quot; onerror=&quot;prompt(1)&quot;&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xHIoH8tnchShfmFC.jpg" /></figure><h3>Ruby on Rails Security Gems</h3><p>As we’ve seen, Rails offers many built-in security features that help protect our applications, sensitive data, and users from web-based attacks. But we have also seen that these have their limitations. For security features that Rails doesn’t offer out of the box, there are always open source options: gems, lots and lots of gems. Here are some of the top Rails security gems that you can put in your Gemfile.</p><h3>Devise</h3><p>Devise is a popular access control, authentication, and authorization gem for Rails. It offers secure password storage using <em>bcrypt</em> to hash salted passwords, user lockouts, user registration, forgotten password functionality, and more.</p><p>Although Devise’s own README states “If you are building your first Rails application, we recommend you to not use Devise”, I would ignore this statement. If you’re security-aware and have built applications in other frameworks before, I don’t see any issue with using Devise for your first Rails application.</p><p>URL: <a href="https://github.com/heartcombo/devise">https://github.com/plataformatec/devise</a></p><h3>Brakeman</h3><p>Brakeman is a Static Code Analysis tool for Rails applications. It searches your application’s source code for potential vulnerabilities. Although it does report the occasional false positive, personally, I think this is a great gem and one that I would definitely recommend running against your application before going into production. Even better, run it after every commit.</p><p>URL: <a href="https://github.com/presidentbeef/brakeman">https://github.com/presidentbeef/brakeman</a></p><h3>Secure Headers</h3><p>Developed by Twitter, SecureHeaders is a Gem that implements security-related HTTP headers into your application’s HTTP responses. Headers such as Content Security Policy to help protect against Cross-Site Scripting (XSS) attacks, HTTP Strict Transport Security (HSTS) to ensure your site is only accessible over secure SSL connections, X-Frame-Options, and others.</p><p>URL: <a href="https://github.com/twitter/secureheaders">https://github.com/twitter/secureheaders</a></p><h3>Rack Attack</h3><p>Developed by Kickstarter, Rack::Attack is a Gem for blocking &amp; throttling abusive requests. Personally, I use Rack::Attack to prevent form abuse. For example, instead of implementing a CAPTCHA on a submission form, I use Rack::Attack to ensure it is not submitted too many times in a short space of time. This should prevent automated tools from abusing the form submission. It also supports whitelisting and blacklisting of requests.</p><p>URL: <a href="https://github.com/kickstarter/rack-attack">https://github.com/kickstarter/rack-attack</a></p><h3>Codesake Dawn</h3><p>Codesake::Dawn is similar to Brakeman in that it scans your source code for potential vulnerabilities. However, Codesake::Dawn also has a database of known vulnerabilities, which it uses to scan your Ruby, Rails, and gems for known issues.</p><p>URL: <a href="https://github.com/codesake/codesake-dawn">https://github.com/codesake/codesake-dawn</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*EzE4-jMUvM5pFDCS.png" /></figure><h3>Ruby on Rails Code Quality Gems</h3><p>Sloppy and messy code leads to bugs and some bugs may have security implications. Better quality code means more secure code. Let’s take a look at what gems we can use to ensure our code is nice and clean.</p><h3>Rails Best Practices</h3><p>The Rails best practices gem is a great gem for ensuring that your code adheres to best practices. It will help you make your code more readable and eloquent by scanning through it and giving you suggestions on how to improve the syntax.</p><p>URL: <a href="https://github.com/railsbp/rails_best_practices">https://github.com/railsbp/rails_best_practices</a></p><h3>Rubocop</h3><p>Rubocop is not specific to Rails and can be used for any Ruby application. It uses the <a href="https://github.com/bbatsov/ruby-style-guide">Ruby Style Guide</a> as a reference to scan your code and ensure that you adhere to it. This includes tings like variable naming, method size, using outdated syntax, etc.</p><p>URL: <a href="https://github.com/bbatsov/rubocop">https://github.com/bbatsov/rubocop</a></p><h3>Conclusion</h3><p>Rails does a lot of things right when it comes to security. When you develop a Rails application, it feels like Rails has your back. However, don’t let this sense of security lull you into a state of not caring about security. As we have seen, there are pitfalls, and it only takes one mistake for your sensitive information such as credit card data to end up on pastebin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*SM_E3OggFnS4HSYP" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=624db0dd6ca9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Scopes and Architectures]]></title>
            <link>https://medium.com/@Tim_M./api-scopes-and-architectures-d08454b94597?source=rss-2bdac7d4cd24------2</link>
            <guid isPermaLink="false">https://medium.com/p/d08454b94597</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Tim M.]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 12:03:48 GMT</pubDate>
            <atom:updated>2022-10-03T12:08:40.007Z</atom:updated>
            <content:encoded><![CDATA[<p>A guide to understanding Application Programming Interfaces (APIs).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tYbEdbAA4CSI1kBj" /><figcaption>Image source: <a href="https://www.howtogeek.com/343877/what-is-an-api/">HowToGeek</a></figcaption></figure><h4>What is an API?</h4><p>An Application Programming Interface, or API for short, is a mechanism that allows software to communicate with other software using a predetermined set of protocols and definitions. To better understand this, imagine a software system that keeps track of important data like the weather. How does the weather application on your phone keep track of the forecast for you? It “talks” to the aforementioned software system (the National Weather Bureau’s server, for example), via an API in order to show you the most up-to-date information.</p><h4>API Architectures</h4><p><strong><em>SOAP — Simple Object Access Protocol</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*uFuUIHKm7Zq7MyJ_.png" /><figcaption>Image source: <a href="https://phoenixnap.com/kb/soap-vs-rest">PhoenixNAP</a></figcaption></figure><p>APIs utilizing the SOAP architecture use XML, or Extensible Markup Language, to exchange messages. This is a largely outdated method and was more popular in the past.</p><p><strong><em>RPC — Remote Procedure Calls</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/0*WgH9bRpRRhJxOzc5.png" /><figcaption>Image source: J<a href="https://www.javatpoint.com/what-is-rpc-in-operating-system">avatpoint</a></figcaption></figure><p>For an API using RPC architecture, the client must complete a function on the server in order for the server to send the requested output back to the client.</p><p><strong><em>Websocket — A modern API architecture that persists client/server connections.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*GhCn0kP9y1GZmCXR.png" /><figcaption>Image source: W<a href="https://www.wallarm.com/what/a-simple-explanation-of-what-a-websocket-is">allarm</a></figcaption></figure><p>Websocket APIs support constant two-way communication between clients and the server. In a typical RESTful API, which we’ll get into next, the connection is terminated once a response from the server is received. Whereas with a websocket API, the connection between the client and server is persisted, making it arguably more efficient than a RESTful API.</p><p><strong><em>REST — Representational State Transfer</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*y62-9OEOo6da9ELW.png" /><figcaption>Image source: <a href="https://www.astera.com/type/blog/rest-api-definition/">Astera</a></figcaption></figure><p>The most popular and flexible APIs today are REST APIs. These have a set of functions like GET, POST, DELETE, etc. that clients can use to access a database. One of the main features that gives it an edge over websocket APIs, at least from a security standpoint, is that it is stateless. The server does not save client data between requests. Additionally, the response from the server is plain data, usually in JSON format, which enhances readability. REST APIs increase development speed, allow rapid deployment, and are easily maintained.</p><h4>API Scopes of Use</h4><p>Now that we have some knowledge on the different architectural types of APIs, let’s take a brief look at the different ways they can be implemented.</p><ol><li><strong>Private APIs</strong> belong to an enterprise and are only used for intraoperational systems and internal database access.</li><li><strong>Public APIs</strong> are open and may be used by anyone; usually accessed by authorization or payment.</li><li><strong>Partner APIs</strong> are typically accessed by external developers to facilitate partnerships between businesses.</li><li><strong>Composite APIs</strong> combine multiple APIs to solve complex organizational requirements.</li></ol><h4>Conclusion</h4><p>Thanks for reading, and I hope this helped you understand APIs! If you’d like to take a deeper dive into the world of APIs, check out the source links below.</p><h4>Sources:</h4><p><a href="https://www.mulesoft.com/resources/api/what-is-an-api">MuleSoft</a></p><p><a href="https://www.redhat.com/en/topics/api/what-are-application-programming-interfaces">Red Hat</a></p><p><a href="https://aws.amazon.com/what-is/api/">Amazon</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d08454b94597" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Hooks: An Overview]]></title>
            <link>https://medium.com/@Tim_M./react-hooks-an-overview-14e302a57d94?source=rss-2bdac7d4cd24------2</link>
            <guid isPermaLink="false">https://medium.com/p/14e302a57d94</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[hook-effect]]></category>
            <category><![CDATA[hooks-state]]></category>
            <dc:creator><![CDATA[Tim M.]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 20:43:28 GMT</pubDate>
            <atom:updated>2022-09-13T13:49:13.769Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EywR3vl4LJT9-mQd" /><figcaption>Photo by <a href="https://unsplash.com/@lautaroandreani?utm_source=medium&amp;utm_medium=referral">Lautaro Andreani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Hooks are functions that let you “hook into” React state and lifecycle features from function components. Hooks don’t work inside classes — they let you use React without classes.</h4><h4>React provides a few built-in Hooks like useState. You can also create your own Hooks to reuse stateful behavior between different components. This article will focus on a couple of React’s built-in hooks.</h4><ol><li>State hook</li></ol><pre>import React, { useState } from &#39;react&#39;;<br>function Example() {<br>  // Declare a new state variable, which we&#39;ll call &quot;count&quot;  const [count, setCount] = useState(0);<br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;You clicked {count} times&lt;/p&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;<br>        Click me<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>The state hook allows us to add a default “state” to any functional component and use a setter function to update that component’s default state when needed. In the example above, our state hook is imported at the top, followed by our function component and its state variable — count and setCount. The default value of count is set to 0, and each time a user clicks the button, setCount looks at the previous value of count and adds 1 to it. For more use cases of this particular hook, check out the official React documentation <a href="https://reactjs.org/docs/hooks-state.html">here.</a></p><p>2. Effect hook</p><pre>import React, { useState, useEffect } from &#39;react&#39;;<br>function Example() {<br>  const [count, setCount] = useState(0);<br><br>  // Similar to componentDidMount and componentDidUpdate:  useEffect(() =&gt; {    // Update the document title using the browser API    document.title = `You clicked ${count} times`;  });<br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;You clicked {count} times&lt;/p&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;<br>        Click me<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>The effect hook allows us to perform side effects directly from a functional component. What in the world does that mean? Well, for starters, “side effects” in this case, are things like data fetching or manually changing the DOM from react components. The name comes from the fact that they can affect other components, but can’t be done during rendering.</p><p>In the example above, you can see that we still have our state hook from before, but we’ve added some code that changes the document title each time our count state changes. (useEffect(() =&gt; { document.title = `You clicked ${count} times`; });).</p><p>By default, React will run each effect after every render — including the first one. This can cause issues if, for example, you were using it to fetch data from a backend. In that case, you would include an empty “dependency array” to let React know that it does not depend on any other values from props or state, so it never needs to re-render. For a more in-depth guide on how to use the effect hook, check out the official React documentation <a href="https://reactjs.org/docs/hooks-effect.html">here</a>.</p><p>Now that you know a little about React’s built-in hooks, feel free to check out their handy documentation about building your very own hooks <a href="https://reactjs.org/docs/hooks-custom.html">here</a>, and happy hooking!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*g2ersvScU7U6bNLK.gif" /><figcaption>Source: <a href="https://getyarn.io/yarn-clip/72f601b0-2ecf-4010-8719-4be30736cca0/gif">https://getyarn.io/yarn-clip/72f601b0-2ecf-4010-8719-4be30736cca0/gif</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14e302a57d94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 helpful keyboard shortcuts for new programmers]]></title>
            <link>https://medium.com/@Tim_M./5-helpful-keyboard-shortcuts-for-new-programmers-c1ba2ffc515c?source=rss-2bdac7d4cd24------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1ba2ffc515c</guid>
            <category><![CDATA[shortcuts]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[keyboard]]></category>
            <dc:creator><![CDATA[Tim M.]]></dc:creator>
            <pubDate>Mon, 22 Aug 2022 04:01:33 GMT</pubDate>
            <atom:updated>2022-08-22T06:08:31.884Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jCLpKKkd_7WySBVV" /><figcaption>Photo by <a href="https://unsplash.com/@s_o_f_i_k?utm_source=medium&amp;utm_medium=referral">Sofya</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>It’s no secret that learning to code from scratch is a difficult and time-consuming process. Sometimes I wish I could simply <strong><em>Ctrl + C</em></strong> and <strong><em>Ctrl + V</em></strong> all of this new information into my brain. Unfortunately, we can’t do that …yet. So, in the meantime, here are some neat keyboard shortcuts that I’ve found useful as a new student at Flatiron School.</p><h4>1. Copy and Paste (Ctrl + C and Ctrl + V)</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FzRwA2JgARLVYgWtfgY%2Fvideo&amp;display_name=GIPHY&amp;url=https%3A%2F%2Fgiphy.com%2Fclips%2Ferichamlet-zRwA2JgARLVYgWtfgY&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2FzRwA2JgARLVYgWtfgY%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="480" height="360" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e6eeaaeb8566ecc1c70097d3063bc4b/href">https://medium.com/media/9e6eeaaeb8566ecc1c70097d3063bc4b/href</a></iframe><p>Something I did on a regular basis, even before starting my programming journey, was copy and paste information from one place to another. It’s probably the most widely-known shortcut on this list, but I decided to include it because, well, it’s <em>extremely </em>helpful!</p><h4>2. Home and End</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FXBLsbXDiXd7C0MZypz%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FXBLsbXDiXd7C0MZypz%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FXBLsbXDiXd7C0MZypz%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="243" frameborder="0" scrolling="no"><a href="https://medium.com/media/124575cbe85e54143b53627f30c24f1f/href">https://medium.com/media/124575cbe85e54143b53627f30c24f1f/href</a></iframe><p>As a programmer, you’ll likely be using the arrows on your keyboard to traverse your code. If you find yourself on a particular line of code that you want to move to the beginning or end of, your keyboard has you covered! The “Home” key will take you to the beginning of the line, while the “End” key will take you to the end of the line so you can add that sweet, sweet semicolon that you might have forgotten.</p><h4>3. Editing multiple lines of code at once (Ctrl + Alt + Up/Down)</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FJ5xVN35LXqTyE%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FJ5xVN35LXqTyE%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FJ5xVN35LXqTyE%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="325" frameborder="0" scrolling="no"><a href="https://medium.com/media/eccc7bbecd091b194ac65f80cf9a1a3a/href">https://medium.com/media/eccc7bbecd091b194ac65f80cf9a1a3a/href</a></iframe><p>Let’s spice things up a bit! Say you wanted to edit multiple lines of code at once for …reasons. This keyboard shortcut adds a cursor to each line either above or below your current line. A great way I’ve found to use this shortcut is to “comment-out” certain blocks of code quickly. Speaking of commenting-out lines of code, there’s a shortcut for that as well!</p><h4>4. Commenting-out lines of code (Ctrl + /)</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FC87IXdLfJ44Zq%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FC87IXdLfJ44Zq%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FC87IXdLfJ44Zq%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="186" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb94a49ff3574038ccf09a84ad903b4d/href">https://medium.com/media/eb94a49ff3574038ccf09a84ad903b4d/href</a></iframe><p>In JavaScript, and many other programming languages, you can “comment-out” lines or blocks of code to make them practically invisible (to the engine, at least). This is helpful for many reasons, but the thing I use it most for is to “save” a line or block of code that I might want to use again later, but don’t want JavaScript to keep executing in the meantime, like a good ol’ console.log(something). Combining this shortcut with the previous one is powerful!</p><h4>5. Quick saving (Ctrl + S)</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Ft7tP1DI6XfYJFMZZ94%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Ft7tP1DI6XfYJFMZZ94%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Ft7tP1DI6XfYJFMZZ94%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="305" frameborder="0" scrolling="no"><a href="https://medium.com/media/323d65d5d6c9de2907b7ec83254b430f/href">https://medium.com/media/323d65d5d6c9de2907b7ec83254b430f/href</a></iframe><p>I apologize in advance for this, but I’ve saved the best for last. Get it? This tip is about saving, and I.. yeah, sorry. But seriously, don’t forget to save your work as often as possible! Your keyboard can help out with this as well. Instead of finding that file button, hovering over it, and clicking “save”, a quick (Ctrl + S) will do the same thing and save you a BIT of time. Those BITS of time add up, and after awhile you’ll have saved a hefty BYTE! Get it?!?</p><h4>Conclusion</h4><p>While my last tip may have devolved into a couple groan-inducing dad jokes, I hope you found these tips somewhat useful and implement them into your programming where applicable. Thanks for reading my first blog post!</p><p>Most of these shortcuts are relatively simple and you probably already knew about them. If you’re interested in some lesser-known and extra-spicy shortcuts, check out <a href="https://itnext.io/keyboard-shortcuts-for-a-developer-e6d1203774f6">this blog post</a> by TheBoringDeveloper!</p><h4>Sources</h4><p>“Keyboard Shortcuts.” <a href="https://www.w3schools.com/tags/ref_keyboardshortcuts.asp.">https://www.w3schools.com/tags/ref_keyboardshortcuts.asp.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1ba2ffc515c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>