<?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: Nick Groos</title>
    <description>The latest articles on DEV Community by Nick Groos (@groos).</description>
    <link>https://dev.to/groos</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%2F408303%2F51f01ddd-4ffd-4ad8-90cf-b2efa4e6407a.jpeg</url>
      <title>DEV Community: Nick Groos</title>
      <link>https://dev.to/groos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/groos"/>
    <language>en</language>
    <item>
      <title>Blockchain with Solidity: What to Learn First</title>
      <dc:creator>Nick Groos</dc:creator>
      <pubDate>Wed, 12 May 2021 14:34:49 +0000</pubDate>
      <link>https://dev.to/groos/learning-blockchain-with-solidity-what-i-googled-first-25o6</link>
      <guid>https://dev.to/groos/learning-blockchain-with-solidity-what-i-googled-first-25o6</guid>
      <description>&lt;p&gt;Getting started in a blockchain development environment can feel completely foreign, especially if you are coming from web development.&lt;/p&gt;

&lt;p&gt;Here is an overview of some key items I had to learn about in my first few days with Solidity:&lt;/p&gt;

&lt;h3&gt;
  
  
  Web3
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://web3.foundation/"&gt;Web3&lt;/a&gt; is a term you will see often. In broad terms, it refers to certain interfaces and tools that make it easy to integrate with crypto wallets (like Metamask) and other blockchain-related functionality. There are a growing number of libraries that expose Web3 functionality in different dev environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Metamask
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://metamask.io/"&gt;Metamask&lt;/a&gt; is currently the standard browser-based wallet to use while learning blockchain development. It has built-in integration with IDE and Testnet environments (more on this below) which makes it easy to acquire and use test Ether.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You have to pay gas (ether) to "change" the blockchain. This includes making a payment transaction, updating the state of a smart contract, or deploying a smart contract.&lt;/li&gt;
&lt;li&gt;Consider your gas payment to be the transaction fee paid to the miners running the network&lt;/li&gt;
&lt;li&gt;Your Solidity code should be optimized to &lt;a href="https://medium.com/@tyguyo/efficient-ethereum-smart-contract-storage-361e4f126bbd"&gt;reduce gas cost&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Remix and Hardhat
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://remix.ethereum.org/"&gt;Remix&lt;/a&gt; is an online IDE for compiling and deploying contracts written in Solidity. It is the quickest way to start working with smart contracts. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://hardhat.org/"&gt;Hardhat&lt;/a&gt; is a framework for doing blockchain development in a local environment. It can also deploy to live and testnet environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Testnets and Testnet Faucets
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Testnets are test blockchain environments. Use them to deploy and test smart contracts without having to spend real crypto on gas.&lt;/li&gt;
&lt;li&gt;Testnet Faucets will send cryptocurrency to your Metamask wallet which can be used on the Testnet environments.

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://faucet.kovan.network/"&gt;Kovan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://faucet.ropsten.be/"&gt;Ropsten&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://faucet.rinkeby.io/"&gt;Rinkeby&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


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

&lt;h3&gt;
  
  
  ERC-20
&lt;/h3&gt;

&lt;p&gt;This is a spec for implementing fungible tokens. &lt;a href="https://ethereum.org/en/developers/docs/standards/tokens/erc-20/"&gt;Read about it here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ERC-721
&lt;/h3&gt;

&lt;p&gt;This is a spec for implementing non-fungible tokens. &lt;a href="https://ethereum.org/en/developers/docs/standards/tokens/erc-721/"&gt;Read about it here&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I hope this list can save some time for anyone else out there learning Solidity. Let me know in the comments if there is something you think I should add.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why are you using 'git pull' ?</title>
      <dc:creator>Nick Groos</dc:creator>
      <pubDate>Mon, 10 May 2021 16:54:11 +0000</pubDate>
      <link>https://dev.to/groos/why-are-you-using-git-pull-1p8i</link>
      <guid>https://dev.to/groos/why-are-you-using-git-pull-1p8i</guid>
      <description>&lt;p&gt;I have noticed that for whatever reason, new developers love to use &lt;code&gt;git pull&lt;/code&gt; for merging code. To get latest from another branch, they will do something like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Switch to the other branch&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git pull&lt;/code&gt; the latest code for that branch&lt;/li&gt;
&lt;li&gt;Switch back to the working branch&lt;/li&gt;
&lt;li&gt;Merge the freshly pulled code into the working branch&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, &lt;code&gt;git pull&lt;/code&gt; can get the job done. And developers will go months or years unaware of the much more nimble &lt;code&gt;git fetch&lt;/code&gt;.  &lt;/p&gt;




&lt;p&gt;The problem is that the steps above require us to switch branches, a slow git operation, &lt;em&gt;two times&lt;/em&gt;. We can achieve the same outcome without switching branches by using &lt;code&gt;git fetch&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git fetch origin develop
git merge origin/develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we have the latest from /develop into our current working branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The seemingly small efficiency gained from a workflow that uses &lt;code&gt;git fetch&lt;/code&gt; instead of &lt;code&gt;git pull&lt;/code&gt; will result in hours of saved time over the course of a project.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;For more context I recommend &lt;a href="https://stackoverflow.com/questions/292357/what-is-the-difference-between-git-pull-and-git-fetch"&gt;this discussion about 'git fetch' vs 'git-pull'&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Non-ASCII characters in Azure metadata fields</title>
      <dc:creator>Nick Groos</dc:creator>
      <pubDate>Wed, 17 Jun 2020 13:54:35 +0000</pubDate>
      <link>https://dev.to/groos/non-ascii-characters-in-azure-metadata-fields-4n09</link>
      <guid>https://dev.to/groos/non-ascii-characters-in-azure-metadata-fields-4n09</guid>
      <description>&lt;h1&gt;
  
  
  Azure Blob Storage and Azure Search - Handling non-ASCII characters with Azure Indexers
&lt;/h1&gt;

&lt;p&gt;Azure Blob Containers will only accept ASCII characters in metadata fields. In order to store a character like "ó" in your metadata fields, URL encode the metadata before writing to Azure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;title: encodeURIComponent(docTitle),
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The encoded data will look like "%C3%B3" to preserve the non-ASCII characters. Simply decode before displaying on the front end. &lt;/p&gt;

&lt;h2&gt;
  
  
  But what if my metadata needs to be searchable in Azure Search?
&lt;/h2&gt;

&lt;p&gt;I pushed the above change to production, and it broke our search page. Special characters were not searchable because there were no special characters in the search index (they were encoded). And encoding the search queries before executing a search just seemed like a bad idea.&lt;/p&gt;

&lt;p&gt;Azure Indexers, which we used to get our data from the blob into the search index, &lt;a href="https://docs.microsoft.com/en-us/azure/search/search-indexer-field-mappings#urlDecodeFunction"&gt;allow you to configure field mapping functions to transform your data as you are adding it to the search index&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"urlDecode" is one of these mapping functions. The configuration looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
      "sourceFieldName": "title",
      "targetFieldName": "my_document_title",
      "mappingFunction": {
        "name": "urlDecode"
      }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now the special characters are stored unencoded in the search index and ready to be searched.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>webdev</category>
    </item>
    <item>
      <title>One cool trick for your React props</title>
      <dc:creator>Nick Groos</dc:creator>
      <pubDate>Sat, 13 Jun 2020 18:04:15 +0000</pubDate>
      <link>https://dev.to/groos/cheeky-react-props-4674</link>
      <guid>https://dev.to/groos/cheeky-react-props-4674</guid>
      <description>&lt;p&gt;Here is a concise way to pass props that have the same name as the value being passed. Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Component prop1={prop1} prop2={prop2}/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The spread operator lets us use this cool syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Component {...{ prop1, prop2 }}/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;They can be combined too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Component {...{ prop1, prop2 }} prop3={prop3}/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This syntax can look a little strange at first but should be quite clear once you see it a few times. Use with discretion for readability concerns.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
