<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Samuel Beard</title>
    <description>The latest articles on DEV Community by Samuel Beard (@samuelbeard).</description>
    <link>https://dev.to/samuelbeard</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%2F143315%2F2c6a88de-a118-47c8-9cca-08abc9dabba8.jpeg</url>
      <title>DEV Community: Samuel Beard</title>
      <link>https://dev.to/samuelbeard</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samuelbeard"/>
    <language>en</language>
    <item>
      <title>How to Tame a Roaming Footer</title>
      <dc:creator>Samuel Beard</dc:creator>
      <pubDate>Thu, 07 Nov 2019 14:52:06 +0000</pubDate>
      <link>https://dev.to/samuelbeard/how-to-tame-a-roaming-footer-29da</link>
      <guid>https://dev.to/samuelbeard/how-to-tame-a-roaming-footer-29da</guid>
      <description>&lt;p&gt;Don't you hate it when you don't have enough content on a web page and the footer just hangs there. Directly under said content. Half way up the screen - nowhere near the bottom.&lt;/p&gt;

&lt;p&gt;Here is a quick and simple way of making sure the footer sticks to the bottom of the screen when there isn't enough content to push it down there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"super-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"navbar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.super-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.content&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;flex-grow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can put all the css from the &lt;code&gt;.super-container&lt;/code&gt; into the body if you don't want the extra div.&lt;/p&gt;

&lt;p&gt;So this will make your content section grow to push the footer to the bottom on the screen nicely. And if the content goes past the fold, it will all work as usual.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>css</category>
      <category>design</category>
    </item>
    <item>
      <title>Useful NPX</title>
      <dc:creator>Samuel Beard</dc:creator>
      <pubDate>Wed, 11 Sep 2019 10:39:28 +0000</pubDate>
      <link>https://dev.to/samuelbeard/useful-npx-36fd</link>
      <guid>https://dev.to/samuelbeard/useful-npx-36fd</guid>
      <description>&lt;p&gt;You probably use, or at least have heard of, &lt;code&gt;npx&lt;/code&gt; if you work with Javascript. If not, look it up. It's really handy.&lt;/p&gt;

&lt;p&gt;Here are some commands I run on the reg with npx:&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx okimdone npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have your volume up, a voice will tell you when the command you entered is done. It's really handy for tasks that take ages but want to come back to after.&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx npm-check

&lt;span class="c"&gt;# Options&lt;/span&gt;
&lt;span class="nt"&gt;-u&lt;/span&gt; - Interactive Updates
&lt;span class="nt"&gt;-y&lt;/span&gt; - Update everything
&lt;span class="nt"&gt;-s&lt;/span&gt; - Skip unused
&lt;span class="nt"&gt;-g&lt;/span&gt; - Global
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checks your installed npm packages and gives you info about them. It's great for seeing if you have stuff in your package.json that your aren't actually using in your app.&lt;/p&gt;

&lt;p&gt;Running &lt;code&gt;npx npm-check -su&lt;/code&gt; will simply update all of your packages.&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx npkill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run this from the folder that holds all of your projects. It will list out every node_modules folder from there along with the amount of disc space it is using. You can then go through them and delete the node_modules folders individually by hitting the space bar.&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx generact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are creating components for react, this is really useful.&lt;/p&gt;

&lt;p&gt;Generact will duplicate a component you already have made and give it a new name. It will copy the old components file structure and change the component name anywhere it is written inside it.&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx samuelbeard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just thought this was neat.&lt;/p&gt;




&lt;p&gt;If you know of any more npx tools that are super useful, bung em in the comments.&lt;/p&gt;

</description>
      <category>npx</category>
      <category>npm</category>
      <category>useful</category>
    </item>
    <item>
      <title>Raspberry Pi &amp; Raspbian setup as fast as possible</title>
      <dc:creator>Samuel Beard</dc:creator>
      <pubDate>Tue, 26 Mar 2019 11:39:09 +0000</pubDate>
      <link>https://dev.to/samuelbeard/raspberry-pi--raspbian-setup-as-fast-as-possible-39i6</link>
      <guid>https://dev.to/samuelbeard/raspberry-pi--raspbian-setup-as-fast-as-possible-39i6</guid>
      <description>&lt;p&gt;This is a simple setup guide to install Raspbian on a Raspberry Pi and get it set up headlessly. This means that we we won't ever need to plug a keyboard, mouse or screen into it.&lt;/p&gt;

&lt;p&gt;This is a tutorial for MacOS and Linux because it makes use of the terminal. If there is demand, I will write a Windows specific version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make sure you have these things:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your Raspberry Pi&lt;/li&gt;
&lt;li&gt;A way to power your Raspberry Pi&lt;/li&gt;
&lt;li&gt;A micro SD card&lt;/li&gt;
&lt;li&gt;A micro SD card adapter so you can plug it into your computer&lt;/li&gt;
&lt;li&gt;A computer&lt;/li&gt;
&lt;li&gt;If your Pi doesn't have WiFi built in, you'll need a WiFi dongle.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Wifi is built in to the &lt;code&gt;Raspberry Pi Zero W&lt;/code&gt; and &lt;code&gt;Raspberry Pi 3&lt;/code&gt; and on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Download these things:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Etcher - &lt;a href="https://www.balena.io/etcher/"&gt;https://www.balena.io/etcher/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Rasbian Stretch Lite - &lt;a href="https://www.raspberrypi.org/downloads/raspbian/"&gt;https://www.raspberrypi.org/downloads/raspbian/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's carry on with the tutorial assuming you have everything installed and downloaded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Rasbian
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Unzip the Rasbian zip folder that you downloaded. There should be a &lt;code&gt;.img&lt;/code&gt; file in there.&lt;/li&gt;
&lt;li&gt;Using your USB adapter, plug in your micro SD card to your computer.&lt;/li&gt;
&lt;li&gt;Open Etcher on your computer.&lt;/li&gt;
&lt;li&gt;Select the &lt;code&gt;.img&lt;/code&gt; Rasbian file in the left section.&lt;/li&gt;
&lt;li&gt;Select the micro SD card in the middle section.&lt;/li&gt;
&lt;li&gt;Click "Flash" and wait.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once that is done, Rasbian is installed.&lt;/p&gt;

&lt;p&gt;By default, Rasbian disallows ssh connections. So we will need to enable them. Also, we want the Pi to be able to connect to our WiFi right away so we don't need to connect a screen and keyboard to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enable SSH over Wifi
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If the micro SD card has unmounted from your computer, reconnect it.&lt;/li&gt;
&lt;li&gt;In the Terminal, go to the SD card.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Mac&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; /Volume/MySDCard/
&lt;span class="c"&gt;# Linux (Can vary or require additional steps)&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; /media/MySDCard/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add a blank file simply called &lt;code&gt;ssh&lt;/code&gt; to the micro SD card.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add a file called &lt;code&gt;wpa_supplicant.conf&lt;/code&gt; to the micro SD card.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano wpa_supplicant.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file needs to contain your WiFi name and password. Here is a template you can edit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Once these two files are on your SD card, remove it and plug it into your Raspberry Pi.&lt;/li&gt;
&lt;li&gt;If the PI needs a Wifi adapter, plug it in. Then power up the Pi.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The only cable you need to have plugged into the Pi is the power cable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find Your Pi's IP Address
&lt;/h2&gt;

&lt;p&gt;You can do this by simply looking at your routers UI. Just find the device called 'Raspberry Pi'.&lt;/p&gt;

&lt;p&gt;If you want to find the IP in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;arp &lt;span class="nt"&gt;-na&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; b8:27:eb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give you an IP address starting with '192.168.'. That's your Pi's internal IP address. You can only access your Pi from another device on the same network using this address.&lt;/p&gt;

&lt;p&gt;All Raspberry Pi device MAC addresses start with 'B8:27:EB'.&lt;/p&gt;

&lt;h2&gt;
  
  
  Access and Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SSH onto your Pi
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sh pi@192.168.x.x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the Xs with your Pis IP address.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When asked for a password, type 'raspberry'. It will look like nothing is being typed. Don't worry, it is.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The first thing we want to do here is to change that default password.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Update
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are all set and ready to go! Just use your new password when SSHing to the Pi from now on.&lt;/p&gt;




&lt;p&gt;If you have questions, feel free to ask.&lt;/p&gt;

&lt;p&gt;You can also check out the &lt;a href="https://raspberrypi.stackexchange.com/"&gt;Raspberry Pi Stack Exchange&lt;/a&gt;&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
