<?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 Montez Smith on Medium]]></title>
        <description><![CDATA[Stories by Montez Smith on Medium]]></description>
        <link>https://medium.com/@montezsmith?source=rss-fcfc9fb9aaf0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8SwmP5yoDrTE9Ddm0z_itQ.jpeg</url>
            <title>Stories by Montez Smith on Medium</title>
            <link>https://medium.com/@montezsmith?source=rss-fcfc9fb9aaf0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 07:15:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@montezsmith/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[How to Setup Redux & React Router]]></title>
            <link>https://medium.com/@montezsmith/how-to-setup-redux-react-router-571adfde4f23?source=rss-fcfc9fb9aaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/571adfde4f23</guid>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Montez Smith]]></dc:creator>
            <pubDate>Tue, 23 Jul 2019 18:51:38 GMT</pubDate>
            <atom:updated>2019-07-24T21:03:38.864Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Because who can keep track of all those moving parts?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wfiHa3L5X60w6fVrdyNBA.jpeg" /><figcaption>Image courtesy of codeburst.io</figcaption></figure><p>This article was written for the immersive software engineering students at the Flatiron School. This articles assumes that you are already familiar with React &amp; Redux.</p><p>If you’re like me, you often struggle to remember all the setup pieces you need to get your store working. So if you need a cheat-sheet / step by step guide, you’ve found the right place. For this example, let’s say we’re setting up our store to manage user data and actions, such as logging in and out.</p><p>First install the following redux, react-redux, react-router &amp; redux-thunk libraries:</p><pre>npm install redux react-redux redux-thunk redux-devtools-extension react-router react-router-dom</pre><p>Note: redux-thunk helps to return anything but plain objects from inside of promises. This is helpful when it comes to fetches!</p><p>2. In your src folder, create 4 sub folders: actions, reducers, components, store.</p><p>3. In your actions folder, create a file called types.js. In this file you’ll write the names of the actions you’ll send in to your reducers.</p><pre>export const LOGIN_ACTION = &quot;LOGIN_ACTION&quot;<br>export const LOGOUT_ACTION = &quot;LOGOUT_ACTION&quot;</pre><p>4. Now in your actions folder, create another file called functions.js. In this file, you’ll write the functions that will dispatch actions to trigger the state changes in the corresponding reducer.</p><pre>..actions/functions.js</pre><pre>import { LOGIN_ACTION, LOGOUT_ACTION } from &#39;/types&#39;</pre><pre>//Sample Login Function</pre><pre>export function login(data) {<br>  return dispatch =&gt; {</pre><pre>fetch(&#39;http://localhost:3000/sign_up&#39;, <br>  method: &#39;POST&#39;,<br>  headers: {&quot;Content-Type&quot;: &quot;application/json&quot;},<br>  body: JSON.stringify(data))<br>  .then(res =&gt; res.json())<br>  .then(res =&gt; {<br>dispatch(type: LOGIN_ACTION, payload: {id: res.id, username: res.username}}</pre><pre>  })<br>}</pre><pre>//Sample Logout Function</pre><pre>export function logout() {<br> return =&gt; {<br>   dispatch(type: LOGOUT_ACTION)<br> }<br>}</pre><p>5. In your reducers folder, create a file called user.js. Your reducer should only manage the data corresponding to one model.</p><p>6. Create your userState object. This object should contain all the placeholders for your expected data. Next, create the userReducer function (which takes in the initial state, and action type), and export the reducer.</p><pre>../reducers/user.js</pre><pre>import { LOGIN_ACTION, LOGOUT_ACTION } from &#39;../actions/types&#39;</pre><pre>const userState = {  <br>  loggedIn: false,<br>  user: {id: 0, username: &quot;&quot;}<br>} </pre><pre>const userReducer = (state = userState, action) =&gt; {                          </pre><pre>switch(action.type) {     </pre><pre> case LOGIN_ACTION:   <br>  return {   ...state, user: action.payload, loggedIn: true   }  <br> case LOGOUT_ACTION:<br>  return firstState <br> default:    <br>  return state <br> }</pre><pre>} </pre><pre>export default userReducer</pre><p>7. Within the reducers folder, create another file called index.js. Import combineReducers from redux. Then import your userReducer from your user file. Next create a constant called rootReducer and set it to the function combineReducers. CombineReducers will take in an object that has the key, which is of name of the model that the reducer is managing, set to the value of its corresponding reducer.</p><p>Then export the reducer.</p><pre>../reducers/index.js</pre><pre>import { combineReducers } from &#39;redux&#39;;<br>import userReducer from &#39;./user&#39; </pre><pre>const rootReducer = combineReducers({  <br>   user: userReducer<br>}) </pre><pre>export default rootReducer</pre><p>8. In the store file, create a file called configureStore.js. On the top of this file we’ll import createStore and applyMiddleware from redux. CreateStore allows us to create our store and connect it to our overall app. *Optional: On the next line import composeWithDevTools from redux-devtools-extension. Next we’ll import thunk from redux-thunk, and finally we’ll import our rootReducer from ‘./reducers’.</p><p>After we’ve imported these tools, we’ll call applyMiddleware and pass it the argument of thunk. Then we’ll save it to a const variable called middleware. Next we’ll create a store using the createStore function. We’ll invoke this function passing it our rootReducer, and a callback, composeWithDevTools that takes in the middleware constant that we just created. And we’ll save it into store. Finally, we’ll export the store.</p><pre>src<br> |__ actions<br> |__ reducers<br> |__ store<br>    |__ configureStore.js </pre><pre>// In store/configureStore.js </pre><pre>import { createStore, applyMiddleware } from &#39;redux&#39;<br>import { composeWithDevTools } from &#39;redux-devtools-extension&#39;<br>import thunk from &#39;redux-thunk&#39;<br>import rootReducer from &#39;./reducers&#39;;</pre><pre>const middleware = applyMiddleware(thunk)</pre><pre>const store = createStore(rootReducer, composeWithDevTools(middleware))</pre><pre>export default store;</pre><p>9. In App, go to the index.js file and import Provider from react-redux under the other react imports. Next import { BrowserRouter as Router, Route } from ‘react-router-dom’. Then on the next line import the store from our file ‘./store/configureStore’. (See code under item 10.)</p><p>10. After you’ve imported the BrowserRouter, Provider and store, write a constant called Root, set it to an anonymous function that takes in the de-structured store. This function will have an implicit return that has a HOC component called Provider . Provider will hav a prop named store which is set to the store. Inside of the Provider tags, create another HOC called Router. Inside of Router, write a Route component that has a path set to “/” and component label set to App.</p><pre>// In ../index.js</pre><pre>import { Provider } from &#39;react-redux&#39;<br>import { BrowserRouter as Router, Route } from &#39;react-router-dom&#39;<br>import store from &#39;./store/configureStore&#39;</pre><pre>const Root = ({ store }) =&gt; (<br>  &lt;Provider store={store}&gt;<br>    &lt;Router&gt;<br>     &lt;Route path=&quot;/&quot; component={App} /&gt;<br>    &lt;/Router&gt;<br>  &lt;/Provider&gt;<br>)</pre><pre>ReactDOM.render(&lt;Root store={store} /&gt;, document.getElementById(&#39;root&#39;));</pre><p>11. Under this function, on the line that say RenderDOM, write a self closing component tag called Root, that has a prop tag called store and pass in the store.</p><p>Great! Now that we’ve the redux boilerplate code setup. We can actually start using it in our application!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=571adfde4f23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Add Initial Values into Your Redux Form]]></title>
            <link>https://medium.com/@montezsmith/how-to-add-initial-values-into-your-redux-form-ca29e4e17d4a?source=rss-fcfc9fb9aaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca29e4e17d4a</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-redux]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux-form]]></category>
            <dc:creator><![CDATA[Montez Smith]]></dc:creator>
            <pubDate>Sun, 14 Oct 2018 16:23:31 GMT</pubDate>
            <atom:updated>2018-10-14T16:24:11.331Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lp9bCUSIc1Foh1fa2qaVWw.jpeg" /><figcaption>Image by Christin Hume</figcaption></figure><p>Last month I deployed an app called <a href="https://carded-v3.firebaseapp.com/">Carded</a>, (an answer to the clutter of business cards trapped in your wallet), that relied heavily on the use of Redux Form. As I was building my app, the problem I struggled with most was getting my form to pre-populate with data that was returned from a fetch. I ran through tons of articles trying to figure out how to get this working with the react-redux library, but the references I found were a bit confusing. So if you’re in a similar position or just want to figure out how to utilize initial values in your Redux form, keep reading after the break!</p><p><em>***This article assumes that you are using </em><a href="https://reactjs.org/"><em>React</em></a><em>, </em><a href="https://redux.js.org/"><em>Redux</em></a><em> and the </em><a href="https://github.com/reduxjs/react-redux"><em>react-redux</em></a><em> library in your app.***</em></p><p>To create a Redux-Form in your app, follow the instructions as listed in the official documentation <a href="https://redux-form.com/7.4.2/docs/gettingstarted.md/">here</a>.</p><p>Once that’s done, your form component should look something like this:</p><pre>import React from &#39;react&#39;<br>import { Field, reduxForm } from &#39;redux-form&#39;<br>import {connect} from &#39;react-redux&#39;</pre><pre>let ContactForm = props =&gt; {<br>  const { handleSubmit } = props<br>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;div&gt;<br>        &lt;Field name=&quot;firstName&quot; component=&quot;input&quot; type=&quot;text&quot; /&gt;<br>      &lt;/div&gt;<br>      &lt;div&gt;<br>        &lt;Field name=&quot;lastName&quot; component=&quot;input&quot; type=&quot;text&quot; /&gt;<br>      &lt;/div&gt;<br>      &lt;div&gt;<br>        &lt;Field name=&quot;email&quot; component=&quot;input&quot; type=&quot;email&quot; /&gt;<br>      &lt;/div&gt;<br>      &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>    &lt;/form&gt;<br>  )<br>}</pre><p>To populate your form with initial values, you’ll need to pass data to your form from your store. To do this, in your mapStateToProps() function, create a key called initialValues that is set to an object that contains the keys and values of the data you’d like to place in your form.</p><p>Note: Because Redux Form uses combineReducers (a function that takes multiple data stores and combines then into one), when mapping your state values, you’ll have to reference the store key in which the data you want to use is held. (You should have set up different data stores and reducers during Step 1 of the creation of your Redux Form.)</p><p>For this example, let’s say all the data I need to give to my contact form is held within my “welcome” store.</p><pre>const mapStateToProps = (state) =&gt; {<br>  return {<br>    initialValues: {<br>      firstName: state.welcome.firstName,<br>      lastName: state.welcome.lastName,<br>      email: state.welcome.email<br>    }<br>  }<br>}</pre><p>Next add the initialValue keys to your destructed props statement. Then to associate a value to a field in your form, go into your form and set the Field name attribute equal the key of the respective data value.</p><p>Tip: If you want to easily see if your values were loaded properly, in each field set a placeholder attribute. <strong><em>Note that placeholder data is set differently.</em></strong></p><pre>import React from &#39;react&#39;<br>import { Field, reduxForm } from &#39;redux-form&#39;<br>import {connect} from &#39;react-redux&#39;</pre><pre>let ContactForm = props =&gt; {<br>  <strong>const { handleSubmit, firstName, lastName, email } = props</strong><br>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;div&gt;<br>        &lt;Field <strong>name=&quot;firstName&quot;</strong> component=&quot;input&quot; type=&quot;text&quot;       <strong>placeholder={firstName}</strong>/&gt;<br>      &lt;/div&gt;<br>      &lt;div&gt;<br>        &lt;Field <strong>name=&quot;lastName&quot;</strong> component=&quot;input&quot; type=&quot;text&quot; <strong>placeholder={lastName}</strong> /&gt;<br>      &lt;/div&gt;<br>      &lt;div&gt;<br>        &lt;Field <strong>name=&quot;email&quot; </strong>component=&quot;input&quot; type=&quot;email&quot; <strong>placeholder={email}</strong> /&gt;<br>      &lt;/div&gt;<br>      &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>    &lt;/form&gt;<br>  )<br>}</pre><p>Finally, connect your Redux Form to your component. Because we’re using the react-redux library, our connect function has to wrap around the entire reduxForm function in order to pass down all the necessary functionality and data to our form.</p><p>In the reduxForm function, you’ll have to pass in two key-value pairs, one is <strong>form</strong>, which will be set name of your form. You can call your form whatever you want, just make it unique! The second key is <strong>enableReinitialize</strong>, which is set to true. Although this is optional, I like to use it because this tells the form check to see if the initial values have been updated upon initializing.</p><pre>export default connect(mapStateToProps)(reduxForm({ form: &#39;contactForm&#39;, enableReinitialize: true})(ContactForm))</pre><p>I hope this guide helps you to better utilize the initial values functionality in Redux Form! Let me know how your form building goes in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca29e4e17d4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who doesn’t love some PWA? — A Starter Guide to Progressive Web Apps]]></title>
            <link>https://medium.com/@montezsmith/who-doesnt-love-some-pwa-a-starter-guide-to-progressive-web-apps-4e911d98439d?source=rss-fcfc9fb9aaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e911d98439d</guid>
            <category><![CDATA[progressive-web-app]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flatiron-school]]></category>
            <dc:creator><![CDATA[Montez Smith]]></dc:creator>
            <pubDate>Sun, 19 Aug 2018 16:25:23 GMT</pubDate>
            <atom:updated>2020-06-20T18:36:17.761Z</atom:updated>
            <content:encoded><![CDATA[<p>Back in 2009, Apple released a few lighthearted and cheesy commercials where they showed that their smartphones could do almost anything. From the practical to the absurd, if you needed your phone to do something, you could be sure that “There’s An App For That.”</p><p>In 2018, that fact still stands, and not just in regards to iOS apps. Between the top 2 app markets for smartphones (Google Play &amp; Apple App Store), there are currently over 5 million apps for smartphone users to choose from. This sounds great, until you realize that you might have to download an app for every site that you like on your phone.</p><p>What’s the problem with having a million apps on your phone? Nothing... that is if you like having minimal phone storage or downloading apps for websites that really don’t <em>do</em> anything. As a smartphone user, this annoys me. And as a web developer, this really annoys me. Luckily, there is hope for those of us who don’t like having more than a few apps on our devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*qf4NZH9Ar6as1W1irPTmlQ.gif" /><figcaption>You after having to download another app.</figcaption></figure><p><strong>Your savior &amp; mine: Progressive Web Apps or PWAs.</strong></p><p>Progressive Web Apps are simply web applications that look, feel and function like native mobile applications.</p><p>Have you ever visited a site on your phone and popup appears with an option that says “Add to Homescreen”? If you click that button, a new app would instantly appear on your phone. Then once you opened that app, you’d experience the site that you visited in your browser, in the same way you would an app that you downloaded from the app store.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FheSvwQgEMLM%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DheSvwQgEMLM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FheSvwQgEMLM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1458071d22c8b0d95611d3b7e84a5223/href">https://medium.com/media/1458071d22c8b0d95611d3b7e84a5223/href</a></iframe><h3><strong>Wait, how does this work?</strong></h3><p>As mentioned earlier, PWAs are just web applications. So to make one, there are no additional languages or frameworks that a developer needs to know outside of HTML, CSS &amp; Javascript (also called the Application Shell). However, there are three baseline requirements that a web application must have in order for it to be considered Progressive:</p><ol><li><strong>Manifest.json</strong></li></ol><p>Web App Manifest is a json file that displays key information about an app like it’s name, logo, description, and start-url. This file gives developers the ability to control how the app should appear, direct what the user can launch, and define its appearance at start.</p><figure><img alt="Image result for manifest json" src="https://cdn-images-1.medium.com/proxy/1*JriGgd9OB3rwcXG0lyxERw.png" /><figcaption>Example Manifest.json file from Neha Sharma</figcaption></figure><p>2. <strong>Service Workers</strong></p><p>Service Workers are event-driven scripts that run in the background of your application. They act as a proxy between network servers and your application in order to cache information, do periodic background syncs, load data offline, and send push notifications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfCUsUZXIiKwWSaK6Cd7sw.png" /><figcaption>Example Service Worker file from Shruti Kapoor.</figcaption></figure><p>3. <strong>Served Over HTTPS</strong></p><p>PWAs must be served over HTTPS, due to the usage of Service Workers. Service Workers are constantly making network requests, which could be intercepted without protection. Therefore PWAs are required to have a Secure Sockets Layer (SSL) to prevent middle-man attacks.</p><p>For a more extensive list on PWA requirements, check out the <a href="https://developers.google.com/web/progressive-web-apps/checklist">PWA Google Checklist</a>.</p><h3><strong>This is cool, but is there really an advantage to using PWAs over Native Apps?</strong></h3><p>PWAs take all the best things about web apps and phone apps and combine them into one powerful tool. Although they have tons of features that are similar to their parents, PWAs are unique in the way that they enhance user experiences through accessibility, speed, &amp; safety.</p><p><strong>Accessibility</strong></p><p>PWAs make the internet more accessible due to the way they are designed. This article has mentioned the word Progressive a lot, but what does it really mean? In this context, <strong>Progressive</strong> means that an app can be downloaded from any browser, and will work no matter in the world you’re located.</p><p>In addition to being Progressive, PWAs are also <strong>Responsive</strong> and <strong>Connectivity-Independent</strong>. This is awesome because whenever you open your app, the content on the screen will adjust to whatever device you’re using AND you’ll be able to interact with your app whether you have low or no connectivity!</p><p><strong>Speed</strong></p><p>The Service Workers that are included in PWAs handle a lot of different functions, and aside from helping to load data offline, its second best feature is its caching abilities. Thanks to fast caching, a user can do everything from downloading the app to interacting with page content really quickly, and without ever touching the network.</p><p><strong>Safety</strong></p><p>Thanks to the HTTPS requirement for PWAs, users can be assured that any data that they send across this app is encrypted and protected. On the development side, this requirement helps protect an app from malicious attacks that could break the app entirely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*on10HwtVcvGs3KAm.jpg" /><figcaption>Key features of a Progressive Web App which can boiled down to Accessibility, Speed &amp; Safety</figcaption></figure><h3>Are PWA’s The Future?</h3><p>Personally, I believe that PWAs are the next step for app development.</p><p>But there is one major hurdle that they have to overcome first. At this time, PWAs can’t “talk” to each other, let alone other native apps. For most websites this may not be a problem. But one of the cool things about native apps is that they can pull information from one another to give a user a more dynamic experience. For example, Nike’s Training App can give exercise activity and heart-rate data to Apple’s health app so that a user can see the aggregate of all their fitness data in one space.</p><p>There isn’t any word on when / if these features are coming down the pipeline. However, I’m not convinced that they won’t. Prior to the release of iOS 11.3, PWAs didn’t have access to the iPhone hardware. Now, PWA’s can use the iPhone’s</p><ul><li>Geolocation</li><li>Sensors (Magnetometer, Accelerometer, Gyroscope)</li><li>Camera</li><li>Audio output</li><li>Speech Synthesis (with headsets connected only)</li><li>Apple Pay</li><li>WebAssembly, WebRTC, WebGL as well as many other experimental features.</li></ul><p>PWAs are the perfect bridge between the web and smartphones. I predict that as their popularity increases, having PWA will no longer be optional but rather a necessity. Do you think that PWAs could eventually replace native apps? Let me know your thoughts below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e911d98439d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Rich or Die Mining: The Rundown on Cryptocurrency]]></title>
            <link>https://medium.com/@montezsmith/get-rich-or-die-mining-the-rundown-on-cryptocurrency-ddf6ac44fee6?source=rss-fcfc9fb9aaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddf6ac44fee6</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[digital-currency]]></category>
            <category><![CDATA[flatiron-school]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Montez Smith]]></dc:creator>
            <pubDate>Sun, 29 Jul 2018 15:21:30 GMT</pubDate>
            <atom:updated>2018-07-30T01:53:18.087Z</atom:updated>
            <content:encoded><![CDATA[<p>I was sitting on the floor of my college dorm room when my roommate first told me about Bitcoin. I had no idea what they were going on about, but it sounded like they were excited about making Monopoly money online. I couldn’t see how that translated into actual dollars so I just nodded my head and smiled. Fast forward 10 years and now Bitcoin is a popular currency type, but not many people outside the tech world are sure what a Bitcoin is or how you get some. And up until yesterday, I was also one of those people (sorry Roomie). So if curiosity has finally gotten the better of you, here’s a quick primer:</p><p><strong>So, what is Bitcoin?</strong></p><p>Bitcoin is a digital currency that was created by Satoshi Nakamoto in 2008. It is one of many different types of <a href="https://blockgeeks.com/guides/what-is-cryptocurrency/">cryptocurrencies</a>, but it was the first to establish a large scale, digital cash system without a central entity.</p><p><strong>Ok, cool…what does that mean?</strong></p><p>In the physical world, banks and other 3rd parties (think Visa, Mastercard, etc.) are in control of monitoring cash transactions between parties to correct and balance account ledgers. But with Cryptocurrency, everyone in the network has a list of all the transactions that were ever made, as well as a record of all account balances. Thus, eliminating the need for 3rd parties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*g4oppqCMmc99TCoeh3ydSA.gif" /><figcaption>Banks around the world seeing themselves out.</figcaption></figure><p><strong>But wait, what keeps people honest? Couldn’t someone in the network just modify records as they see fit?</strong></p><p>Nope, no one in the network can modify a transaction. Once a transaction is made, the whole network gets alerted and then once that transaction is verified, it becomes part of the record of transactions (called the Blockchain). Think of the Bitcoin network as a huge excel spreadsheet that all members have access to. They can see the past transactions, but they can’t modify them. However, the sheet can be updated by members to add new confirmed transactions.</p><p><strong>How are transactions verified?</strong></p><p>Ok, strap in for this one. Transactions are verified by Miners, members of the Bitcoin network who use their computer power to verify the validity of Bitcoin exchanges.</p><p>Let say you (Lena) give your best friend Alex, 5 Bitcoins. A transfer request is generated and your signature (a digital private key) is attached to the request. Your data is then sent out to the Bitcoin network, where miners will compete to solve a cryptographic puzzle that will produce a hash (a unique string). Through math, this hash is checked against your public bitcoin key to confirm that:</p><ul><li>Your account is valid.</li><li>You have the bitcoin to make a transaction.</li><li>You have not already sent your bitcoin to someone else.</li></ul><p>Once this information is verified, the record of this transaction is then bundled into a block (a group of other completed transactions) and added to the blockchain (remember that immutable excel spreadsheet?). Finally your transaction is completed and now your account balance will be updated as well as Alex’s. It sounds like all of this would take days, but altogether, it only takes 10 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KKW6WoG3mlQeSTW5.png" /><figcaption>A Breakdown of a Cryptocurrency transaction.</figcaption></figure><p><strong>Sheesh, why is all this necessary?</strong></p><p>It’s a complex system, but it serves two purposes. The first is that it verifies that all transactions are legitimate but secondly, it helps to produce new Bitcoins! For the miner that solves the cryptographic puzzle, they are awarded with newly generated Bitcoins and thus help expand the network.</p><p><strong>Who can become a Miner?</strong></p><p>Anyone. But there’s a high cost to entry. To mine Bitcoins you’ll need to purchase hardware that will give your computer the power and energy needed to process and solve the cryptographic puzzles, which can cost thousands of dollars. The complexity of the cryptography puzzles are so intricate that they “cannot be solved in other ways than through brute force so that essentially requires a huge number of attempts.”</p><p>Just to give you insight on how much computing power is necessary for mining, a study from 2015 showed that processing one Bitcoin transaction required the same amount of electricity as powering <a href="http://blockgeeks.com/bitcoins-energy-consumption/">1.57 American households</a> for one day. Yikes.</p><p>For more on how to become a miner, start with <a href="https://www.digitaltrends.com/computing/how-to-mine-bitcoin/">this article</a>.</p><p><strong>This is all great, but how is value associated to Bitcoin or to any cryptocurrency for that matter?</strong></p><p>It’s simple really. Bitcoin has value, because we give it value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*prGrntBwb0TQJex-hoi2Qw.gif" /></figure><p>Currency, both physical and digital is only given value by the society who use it. “Basic economics tells us that if something is both rare (scarce) and useful (utility) it must have value and demand a specific price, with all other things being equal. Based on these two elements, scarcity and utility, price is determined based on the market’s supply and demand.”²</p><p>Despite, the ability for new Bitcoins to be generated through mining. There is a predetermined cap for the amount of Bitcoins that will be created, which is 21 million. Currently there are 16.2 million Bitcoins in circulation. So it’s scarcity box is checked off. As for utility, thousands of merchants around the world accept Bitcoin as valid currency. Some of the companies leading the charge are: Overstock, Intuit, Microsoft, Etsy and more.</p><p>As more companies begin to accept Bitcoins and other forms of cryptocurrency, digital cash becomes more valuable. In fact, as of July 29th, 2018 at 10:44am EST, 1 Bitcoin was worth $8, 225.74.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*F1SNDeSw8c5Rtz6VnUDeQA.gif" /><figcaption>Me thinking about how I missed my opportunity to be rich.</figcaption></figure><p>I hope you found this article insightful! Based on what you’ve read, would you consider using or mining cryptocurrency?</p><p>______</p><p>¹ <a href="https://blockgeeks.com/guides/what-is-cryptocurrency/"><em>What is Cryptocurrency?</em></a> BlockGeeks. BlockGeeks.com</p><p>² <a href="https://www.luno.com/blog/en/post/how-bitcoin-price-determined"><em>Why does Bitcoin have value and how is the price determined?</em></a><em> </em>Visser, Lisa. Luna.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddf6ac44fee6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who The (Post)man: A Quick Look Into Basic API Testing]]></title>
            <link>https://medium.com/@montezsmith/who-the-post-man-a-quick-look-into-basic-api-testing-507716faffe0?source=rss-fcfc9fb9aaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/507716faffe0</guid>
            <category><![CDATA[flatiron-school]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Montez Smith]]></dc:creator>
            <pubDate>Sun, 08 Jul 2018 14:30:21 GMT</pubDate>
            <atom:updated>2018-07-29T21:58:12.310Z</atom:updated>
            <content:encoded><![CDATA[<p>Despite using the internet every single day, I’ve never really thought about <em>how </em>typing a URL into my browser connects me to content from Buzzfeed, Twitter or anywhere else. Let alone how these sites store, manipulate or display the content that I submit to them. So you can imagine how quickly my mind was blown when my classmates and I were introduced to APIs and the Request Response Cycle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*_pGj3DixmBImxcAl_HWWdA.gif" /><figcaption>Actual footage of me learning about APIs</figcaption></figure><p>In class, I felt like I understood the <em>concept</em> of how APIs worked, but not how they <em>actually </em>worked. So to solidify my knowledge I practiced accessing different APIs with a API testing software called Postman. But before taking a look into the Postman platform, I had do a quick review of what APIs are.</p><p><strong>The Basics: What’s an API &amp; what does it do?</strong></p><p>API is an acronym for Application Programming Interface, and it’s used interchangeably to refer to:</p><ul><li>An app, server, or piece of software that is used in handling data requests.</li><li>A set of coded instructions that act as a messenger to take requests that tell a system what to do, and returns a response.</li></ul><p>In the scope of http requests, APIs are the hidden instructions that are responsible for pulling data from a server or database and displaying it to a user based on their inputs (or requests). For example, think about going to a travel-planning site like Kayak.com. A user would go to Kayak.com, put in their desired travel dates and destinations, and then based on those parameters, Kayak would pull data from different airlines’ API to display flight options to the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2DEgkbyXJ1M6ndxYn3bfQ.png" /><figcaption>Kayak.com</figcaption></figure><p><strong>The importance of APIs &amp; API Testing</strong></p><p>APIs are an integral part of the internet. Without them, we wouldn’t be able to easily access and filter data from such vast amounts of information. Could you imagine trying to plan a trip by going to every single airline’s website to compare flights and prices?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*_ZoHJ7KRRRVBVsp9oCzw_w.jpeg" /><figcaption>Photo of you sitting at home, because APIs aren’t here to aggregate your flight data.</figcaption></figure><p>Needless to say, it’s important that APIs are not only accessible but <em>functional</em>. So like with any part of web or app development, developers must test the API’s connectivity before releasing anything to the public. Enter Postman.</p><p><strong>API Testing with Postman</strong></p><p>Postman is a free API testing tool that was delivered to browsers and native apps in October 2014. It has pretty sleek interface and lots of cool features, but for the purposes of this article I’ll only be looking into GET and POST request testing using the Twitter API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQ5MBcMhVGAONkSoEzayTw.png" /><figcaption>Twitter’s API reference for accessing Tweets.</figcaption></figure><p>To get started, I went over to the Twitter API documentation to find out what their API would allow to me access, and also learn if I needed any special login or authentication keys. Their documentation is huge, so I narrowed my focus down to just retrieving and/or posting tweets.</p><p>From here, I learned that to get a specific tweet from a user I would need the GET url, which is <a href="https://api.twitter.com/1.1/statuses/show.json/:id.">https://api.twitter.com/1.1/statuses/show.json/:id</a>. Next, I’d have to create a Test Twitter application from <a href="https://apps.twitter.com/">Twitter’s Developer platform</a>, so that I could receive a special access token and secret access token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xnbwU-bSY4-Q5RbpCJUXw.png" /><figcaption>The values for this app didn’t matter so much, but I just needed to get to the Access Tokens!</figcaption></figure><p>After my test app was successfully created, I had to navigate to the Keys &amp; Access Token tab to generate my API access tokens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*NYixosPsOHzzwxRiSMiFmQ.png" /></figure><p>Now that I had all the necessary information, it was time for me to head over to Postman to test Twitter’s GET url. I opened up Postman and in the top params section where it says GET, I placed the get url from twitter. Then in the section under that url I placed the key, which was :id, and then I selected a random number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJm0DJVg7YK8IuGeZDc_bg.png" /><figcaption>Top of Postman’s Main Workspace Page</figcaption></figure><p>Next I went to the authorization section under where I wrote in my key, and selected the Oauth 1.0 to add in my Twitter Token information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*mB5-NkGG-hkXpb6d3BmOZQ.png" /><figcaption>Where I entered the Twitter Authentication information on Postman</figcaption></figure><p>Finally, I was ready to hit send. If my request was successful I expected to be able to see the information of a tweet that had an id of 30. And…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ic1vF05arzr5j5Nl2zgNkA.png" /><figcaption>The results of my Twitter GET request</figcaption></figure><p>That’s exactly what I received, plus some more! I could see the day and time the tweet was created, the id of tweet, the text of the tweet, the tweet’s author and way more information.</p><p>Now I was ready the test the POST url of Twitter, as well as see how Postman would handle that information. With a POST request, I expected to be able to submit a tweet. So I went back to the Twitter API docs to retrieve the POST url, <a href="https://api.twitter.com/1.1/statuses/update.json/">https://api.twitter.com/1.1/statuses/update.json/</a> and learn the parameters that I would have to include.</p><p>Once I had this information, I went back to Postman and switched the type of address in the params field to POST. Next, I added in the POST url and in the keys below I wrote a sample status of “a cool new tweet”. Thankfully, Postman saved my Oauth information, so I was able to hit send and…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYSHbWYDnon_7AK8_yl9Tw.png" /><figcaption>The results of my Twitter POST request</figcaption></figure><p>It worked! Now in the body of the Postman window I could see the date and time my tweet was created, my tweet’s ID, the text I wrote, my actual Twitter profile information, and more! Also, I had a hunch to check my Twitter timeline and my tweet actually showed up on my profile!</p><p><strong>The Takeaway</strong></p><p>By using Postman, I got to better understand the power of APIs and the kinds of that data that can be transmitted whenever we click a link. I had a lot of fun experimenting with these urls, because in a way, it made the data real. I started to see all the different ways a developer could take this information and manipulate it to create a variety of new experiences for users. (For example, what if I just wanted to only show tweets from a certain time or specific location to certain users?)</p><p>Now that I’m feeling more comfortable with accessing APIs, I look forward to utilizing them to create more robust applications. I hope that through my experience, you were able to take a look at how Postman works and are inspired to test APIs that interest you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=507716faffe0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pry Your Eyes Out: Pry Troubleshooting Tips]]></title>
            <link>https://medium.com/@montezsmith/pry-your-eyes-out-pry-troubleshooting-tips-629386b0cac?source=rss-fcfc9fb9aaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/629386b0cac</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[pry]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[flatiron-school]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Montez Smith]]></dc:creator>
            <pubDate>Sat, 16 Jun 2018 19:57:30 GMT</pubDate>
            <atom:updated>2018-06-16T19:57:30.153Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m one of those problem-solving kind of people. You know, the ones who stay fixated on an issue until it’s handled. That’s probably why I’m so interested in coding. There’s always some problem to fix, some code to debug. But what happens when your debugger has a bug? After some program crashes, freezes and general despair, I found some solutions to working with the debugging tool, Pry.</p><p>If you’re new to programming (and/or Ruby) like me, then you might not see why this is such a big deal. Testing/debugging is a huge part of the development process, and it’s best to test the functionality of your code as you’re building your program rather than waiting until it’s complete.</p><p><em>Pro-Tip: There’s always an error. The question is do you want to spend your time finding it or fixing it?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*jX8qGZC3WOIm1LFvBNL5jA.png" /><figcaption>You trying to figure out the bug in your program without Pry</figcaption></figure><p>So what is <a href="http://pryrepl.org/">Pry</a>? Pry is a Ruby gem that creates a Read-Evaluate-Print-Loop (REPL) or interactive shell environment where you can test your variables and methods without manipulating your actual code. It’s a fantastic tool with lots of cool features, but in my experience using it, sometimes Pry doesn’t launch properly. Which isn’t the most helpful thing when you’re trying to figure out a coding problem.</p><p>If you’re having similar issues or just want some preemptive tips, here’s some ways I’ve gotten pry to well…pry:</p><h3><strong>Switch from using binding.pry to Pry.Start</strong></h3><p>The cool thing about Pry is that it allows you to see into a method, by launching a REPL wherever you placed binding.pry in your code. But for whatever reason, sometimes pry will just ignore that line and run your program regularly. When this happens, remove the binding.pry and add Pry.start (with no single quotes) to the end of your file.</p><p>Unlike binding.pry, Pry.start opens up a new Pry session, and you’ll have manually input the variables &amp; methods that you want to test. (Except in cases when you place Pry.start into separate a console or environment file that runs when you call it, the pry session should start with all your variables inputted for you).</p><h3>Use binding.pry twice in the same file</h3><p>If the previous method doesn’t work, try calling binding.pry twice in the same file. Sometimes pry will miss the first time you call it, and will launch in the second location that it’s placed. It’s a weird workaround, but it has worked 70% of the time for me. With the other 30%, binding.pry will launch from the first place that it’s called. You may have to play around with this solution to see what works best for you.</p><h3>Use Require ‘Bundler’, Bundler.require</h3><p>If the first two solutions don’t produce positive results, install the <a href="https://bundler.io/bundle_install.html">Bundler gem</a> and at the top of your file put:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*98p2GajfaiP_geu1YtU7bw.png" /></figure><p>Bundler is a Ruby gem that manages all your existing Ruby gems. It also helps to ensure that all your gems are up to date and present in development, staging and production. Using this in junction with Pry has helped me to check if I’m using the latest version of Pry and effectively launch a session.</p><h3><strong>Use Pry-Remote</strong></h3><p><a href="https://github.com/Mon-Ouie/pry-remote">Pry-remote</a> has all of the same functionality and commands as Pry. However, it allows you to start a Pry session remotely through Distrubuted Ruby (DRb), a library which allows multiple Ruby processes to talk to each other over a network. For more on Pry-remote and installation, check out this more in-depth <a href="https://www.bignerdranch.com/blog/debugging-remote-processes-with-pry-remote/">article</a>. I’m still in the beginning stages of testing this, but I have yet to run into any errors!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*CtYH328CRQYSZsblH5s2Ig.gif" /><figcaption>Raw footage of me after my Pry session launched successfully.</figcaption></figure><p>These workarounds have come in clutch when Pry has made me want to Pry my eyes out. I hope these tips have helped, because we all know that development is tough; Debugging your debugger shouldn’t be.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=629386b0cac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>