<?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 Christopher Landaverde on Medium]]></title>
        <description><![CDATA[Stories by Christopher Landaverde on Medium]]></description>
        <link>https://medium.com/@christupher?source=rss-7e5a28075294------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9PSgYNZJEl17vDy0SXyQ5Q.jpeg</url>
            <title>Stories by Christopher Landaverde on Medium</title>
            <link>https://medium.com/@christupher?source=rss-7e5a28075294------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:46:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@christupher/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 use Google Apps Script with Hubspot API?]]></title>
            <link>https://towardsdev.com/google-sheets-etl-job-3abc810c3306?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/3abc810c3306</guid>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[google-data-studio]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[google-sheets]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Wed, 15 Jun 2022 14:18:10 GMT</pubDate>
            <atom:updated>2022-08-16T08:16:58.902Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-jpT-CuqtA2HMRAV-4EhwA.png" /></figure><h3>Why I like Apps Script?</h3><h4>I write less code.</h4><p>It may not be the most robust solution, but it’s a lifesaver when I need a rapid solution for these ETL jobs. With less than one function, I could transform the API request and auto-populate the google sheets.</p><h4>Google Ecosystem</h4><p>If you’re in analytics as an agency, then by proxy, you’re in this ecosystem because of Google Analytics. So it’s great to have a tool that allows you to use different tools in the ecosystem without much complexity. Below is just an example of many of the other things that you can do. I could even automate the slide deck component of my job. The possibilities are endless!</p><h3>How do I set up an automated ETL job that will pull into Google Sheets and then update my dashboard?</h3><ol><li>On Apps Script, work on creating the function that you will use to create your API Request and havGoogle Ecosystem.ing that being submitted into google sheets.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*RzBn76F9nyAOn5AO-SC_sQ.png" /></figure><p>As you can see, I’m making a GET request through HubSpot, and I’m looking for the <strong><em>amount, created date, updated, and deal name.</em></strong></p><p>2. If everything works, you see your google sheet population based on the function you wrote and should populate your results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*vvMJo43DsRhwJ-YNN_7qcw.png" /></figure><p>2. Now go back to your app script and click on triggers. For example, set your function and change the event source to “time-driven” -&gt; “week timer” and have it be “every Monday,” and I change the time of the day to 11 AM on a Monday and click ‘save.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*KXQhnlm2-DcTEiQjE7HXaA.png" /></figure><h3>GOOGLE DATA STUDIO</h3><ol><li>Now you have google sheets, go to data studio and click on data source.</li><li>Find the tab’s label; now, you have that connection to your data source.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjLE7Kuz_87qbbikfVM0OA.png" /><figcaption>Now google data studio automatically refreshes services <a href="https://support.google.com/datastudio/answer/7020039?hl=en#zippy=%2Cin-this-article">every 12 hours, or you can manually update them with a click on “refresh.”</a></figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FkEsnZ1vP4QibxrIMiP%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FkEsnZ1vP4QibxrIMiP%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FkEsnZ1vP4QibxrIMiP%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/b196e666899400fecce6432dd0ce6791/href">https://medium.com/media/b196e666899400fecce6432dd0ce6791/href</a></iframe><p>This is one of many things possible using an apps script, and I would highly implore you to use this situation when a task is handed to your desk to automate this. You’re looking for the quickest way possible to prototype this baby pipeline.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3abc810c3306" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/google-sheets-etl-job-3abc810c3306">How to use Google Apps Script with Hubspot API?</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Shorten URLS with Google Sheets?]]></title>
            <link>https://christupher.medium.com/shorten-urls-with-google-sheets-feb6f8401d8?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/feb6f8401d8</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bitly]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Mon, 13 Jun 2022 20:56:30 GMT</pubDate>
            <atom:updated>2022-06-15T14:23:16.220Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h1xliRUB09qzhl8S" /><figcaption>Photo by <a href="https://unsplash.com/@ilyapavlov?utm_source=medium&amp;utm_medium=referral">Ilya Pavlov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I hate how few solutions there are for shortening URLs in bulk, bitly does have a bulk URL uploader, but I don’t find it intuitive as I would upload an excel sheet, and some minor formatting issues would require me to reupload my entire excel sheet of 200 rows to bitly.</p><p>This might save you from purchasing another Zapier connection.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F67ThRZlYBvibtdF9JH%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F67ThRZlYBvibtdF9JH%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNTZjeDV2cTk1dGhrcmQ0ZG5qdDFuOHlsanhtbXNzbmI5MGhzYmI5YyZlcD12MV9naWZzX2dpZklkJmN0PWc%2F67ThRZlYBvibtdF9JH%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c9cc64028dda1dd4e36cd54632f0c6e/href">https://medium.com/media/7c9cc64028dda1dd4e36cd54632f0c6e/href</a></iframe><p>Thanks to this <a href="https://gist.github.com/misterhay/38a500545ce7abc75b875f33f01c9f51">great gist</a>, it greatly simplifies the process of working with the API; If you have never used an app script, here’s the best way to do it.</p><ol><li>Go to extensions and click ‘apps script’.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmP-oDxdkoOAdXTUKj5wZQ.png" /></figure><p>2. Go to the github gist and click “Raw”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ug_js_GLl8RjcZP87g2LFg.png" /></figure><p>3. Copy the functions bitlyGroupID() and bitlyShorten(longURL). You need the bitlyGroupID to get the GUID which is a need parameter when using the API on the bitlyShorten function.</p><p>4. Go to settings and API ‘and enter a password to get a secret key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HV7yBBr12OmMS_VnZT7oiw.png" /></figure><p>5. Put the access token for a function labeled “bitlyShorten” and for bitlygroupID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YA0LEWKL5FINtf0iPRL4Og.png" /></figure><p>6. Put some documentation on top of the function, as this will make it a custom function on your google sheets. When putting custom functions in app script you must use JSDoc</p><blockquote>“Custom functions will appear in this list if their script includes a <a href="https://jsdoc.app/about-getting-started.html">JsDoc</a> @customfunction tag, as in the DOUBLE() example below.” <a href="https://developers.google.com/apps-script/guides/sheets/functions">https://developers.google.com/apps-script/guides/sheets/functions</a></blockquote><p>Now go to your google sheets:</p><ol><li>As if you were writing a function in google sheets, type the name of the function that you put on app scripts. As I set here, I put bitly shorten. If you don’t see anything, that must mean that your app script must not be connected to your google sheets.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*LVbMqbeyyH9Zd83IlgESBw.png" /></figure><p>2. Now put the URL on the row, enter the bitly shorten URL function with the URL on the preceding row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*CyHMrFnlMIy69cWuIgTxbA.png" /></figure><p>3. Now, if all goes well, you should have a shortened bitly link URL.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FxT0xeiQCDFiJEu2vXG%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FxT0xeiQCDFiJEu2vXG%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FxT0xeiQCDFiJEu2vXG%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8bd10fc7ca2b8e31d2b6b65b1cbcb58/href">https://medium.com/media/f8bd10fc7ca2b8e31d2b6b65b1cbcb58/href</a></iframe><p>This gist and solution works with V4 version of the Bitly API and with a little bit of extra work saved me time and money. Try it out yourself and let me know what you think.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=feb6f8401d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[User ID Tracking with GA-4 on Angular]]></title>
            <link>https://javascript.plainenglish.io/user-id-tracking-with-ga-4-on-angular-b16500833cac?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/b16500833cac</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[google-tag-manager]]></category>
            <category><![CDATA[google-analytics]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Fri, 18 Feb 2022 02:43:23 GMT</pubDate>
            <atom:updated>2022-06-28T02:32:47.054Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YuI9TnPIRHlZiRxyfk32fQ.gif" /></figure><p>If you are trying to find how to tell the difference between a user who is logged in and not logged in. I highly suggest you read this <a href="https://www.analyticsmania.com/post/google-analytics-user-id-with-google-tag-manager/">Analytics Mania article </a>as he thoroughly explains the multiple ways to track a user. One of his methods helped me find my solution. I’m just here to recap how I implemented it on my own.</p><h3>Step 1: The DOM.</h3><p>So through my conversations with my developer, I found out that user sessions are tracked by local storage. It’s a standard method to track storage data which led me to find a special ID*</p><p>Writing on the local storage, I was able to find out the key that unique UUID that I can match to a user on my database with that UUID. Now you’re searching for the UUID because you can’t send anything specific that could identify a user to google as they won’t accept that. So in my case scenario, it required doing “</p><pre>localStorage.getItem(&#39;xxxx&#39;)</pre><p>The (‘xxx’) being the key value that brought the UUID.</p><h3>Step 2: Google Custom Variable</h3><p>You’re going to need to create a custom variable on google tag manager using the variable type called “Custom JavaScript” Below is the script that I used to get the UUID and return it.</p><pre>function getuserid() {<br>  var obj = JSON.parse(localStorage.getItem(&#39;xxxx&#39;));<br>  return obj.id;<br>}</pre><h3>Step 3: GA-4 Tag</h3><p>So I want to track a logged-in user’s behavior on all different pages, so I set it as a variable that will run every time the GA-4 tag fires.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*xcotrum5hC9GxGabwdnMww.png" /></figure><h3><strong>Step 4:</strong> Check that it’s working on debug mode.</h3><p>That’s the only way for you to know if it’s being tracked regardless of what the google tag assistant may say.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*FquGFwnyoe1dQbhfBWqIcQ.png" /></figure><h3>Conclusion:</h3><p>This may not be a fool-proof solution, but it is a solution that works at the current moment that doesn’t require any developer help. Of course, ideally, the best solution is to have a developer willing to send that information after a specific web event. But just in case you find yourself with this ask on a Monday morning from a product manager, this solution might be for you.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>. Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><em> and </em><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>. Check out our </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Community Discord</em></strong></a><em> and join our </em><a href="https://inplainenglish.pallet.com/talent/welcome"><strong><em>Talent Collective</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b16500833cac" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/user-id-tracking-with-ga-4-on-angular-b16500833cac">User ID Tracking with GA-4 on Angular</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pass Data Between Pages React Native]]></title>
            <link>https://christupher.medium.com/pass-data-between-pages-react-native-c17839db54f1?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/c17839db54f1</guid>
            <category><![CDATA[react-navigation]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Mon, 03 May 2021 15:19:21 GMT</pubDate>
            <atom:updated>2022-02-09T02:44:00.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6iQ9xJAe6ZAbwEAxmhRZw.png" /></figure><h3>Sending Information from Page to Page with React-Native:</h3><p>You’re working on a react-native app, and you want the information you’re putting about the users to be saved from page to page to officially click a submit button that will send all this information towards your API.</p><h4>1. You’re going to need react-native navigation to get useNavigation.</h4><pre>npm install @react-navigation/stack</pre><h4>2. Create a function for the button that useNavigation will send information from page to page.</h4><pre>import React, {useState} from &#39;react&#39;<br>import { FormItem} from &#39;react-native-form-component&#39;;<br>import { useNavigation } from &#39;@react-navigation/native&#39;;</pre><pre>function LoadingUser () {</pre><pre>const [userValue,setUserValue] = useState(&#39;&#39;)</pre><pre>const navigation = useNavigation();</pre><pre><strong>function ItemSent() {</strong></pre><pre><strong>{navigation.navigate(&#39;Lixt&#39;,{</strong></pre><pre><strong>userValue})<br>}}</strong></pre><pre>return(</pre><pre>&lt;FormItem <br>isRequired<br>placeholder=&quot;Please Enter Your Name&quot;<br>value={<strong>userValue</strong>}<br>onChangeText={(text) =&gt; setUserValue(text)}<br>/&gt;<br> &lt;Button block onPress={() =&gt; <strong>ItemSent(userValue)</strong>}&gt;</pre><pre>&lt;Text&gt;Submit&lt;/Text&gt;</pre><pre>&lt;/Button&gt;</pre><pre>)</pre><h4>3. Put the route parameter on the page you’re going to be sending data with the API request.</h4><pre>import React,{useState} from &#39;react&#39;<br>import { FormItem} from &#39;react-native-form-component&#39;;<br>import { useRoute } from &#39;@react-navigation/native&#39;;</pre><pre>const Post = () =&gt; {<br>const route = useRoute();<br>const[groceryPost, setGroceryPost] = useState(&#39;&#39;);<br><strong>const { userValue } = route.params;</strong></pre><pre>const submit = async function() {<br>await fetch(&#39;http://0.0.0.0:5000/v1/groceries&#39;,{</pre><pre>method:&#39;POST&#39;,<br>body:JSON.stringify({<br>name:groceryPost<br>}),</pre><pre>headers: new Headers ({<br>Accept:&#39;application/json&#39;,<br>&#39;Content-Type&#39;:&#39;application/json&#39;,<br>&#39;userID&#39;: <strong>userValue</strong> })</pre><pre>})<br>.then(fetch(&#39;http://0.0.0.0:5000/v1/groceries&#39;,{<br>headers:{<br>Accept:&#39;application/json&#39;,<br>&#39;Content-Type&#39;:&#39;application/json&#39;<br>}</pre><pre>})).then(setGroceryPost(&#39;&#39;))</pre><pre>}</pre><h3>Conclusion:</h3><p>In my scenario, I wanted to send a user’s name from a login page to another page where the user <a href="https://github.com/ChristopherLandaverde/Lixt">would send the grocery list with the user’s name </a>attached to the POST request.</p><p>I’m always looking to meet more engineers in my field, <a href="https://www.linkedin.com/in/christopherlandaverde/">find me on Linkedin </a>and let’s connect!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c17839db54f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flask RestAPI without an ORM?]]></title>
            <link>https://christupher.medium.com/flask-without-an-orm-4f1c3f579160?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f1c3f579160</guid>
            <category><![CDATA[sqlalchemy]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[flask-sqlalchemy]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Mon, 03 May 2021 15:08:06 GMT</pubDate>
            <atom:updated>2022-02-09T02:47:28.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*ho10kOfbZvWO9lgWyy6HAQ.jpeg" /></figure><p>You’re working on your REST API with Flask, and you got to figure out where you are going to save this data. <a href="https://flask-sqlalchemy.palletsprojects.com/en/2.x/">Flask-SQLAlchemy </a>is a clear choice, and more than likely, it’s the best choice for most of your side projects. I can’t seem to <a href="https://stackoverflow.com/questions/448684/why-should-you-use-an-orm">find solid reasons for you not to use an OR</a>M,that being said, I wanted to get better at SQL. So this is how I was able to use flask-mysqldb to create the database for <a href="https://admiring-perlman-b68079.netlify.app/">my react-native app Lixt.</a></p><p>** To make this tutorial not too big, I will create a tutorial for creating a SQL database later; this will just be focused on the connection towards SQL database”.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FvISmwpBJUNYzukTnVx%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FvISmwpBJUNYzukTnVx%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FvISmwpBJUNYzukTnVx%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="227" frameborder="0" scrolling="no"><a href="https://medium.com/media/b311eb0d9c32255847900e47bd900dcb/href">https://medium.com/media/b311eb0d9c32255847900e47bd900dcb/href</a></iframe><h3>Step 1: Install Flask-MYSQLdb</h3><pre>pip install flask-mysqldb</pre><h3>Step 2: Create DB File</h3><p>In order to create a <a href="https://deviq.com/principles/separation-of-concerns">seperation of concerns for my app</a>, I want to create a module for connection and another for business logic.</p><h4><strong>Import both flask and flask_mysqldb</strong></h4><pre><strong>from</strong> <strong>flask</strong> <strong>import</strong> Flask<br><strong>from</strong> <strong>flask_mysqldb</strong> <strong>import</strong> MySQL</pre><h4>Initialize it.</h4><pre>app = Flask(__name__)</pre><pre># Configuring Environment Variables</pre><pre>config = configparser.ConfigParser()</pre><pre>config.read(&#39;.env&#39;)</pre><pre>mysql = MySQL()</pre><h4><strong>Local DB Configuration</strong></h4><pre>app.config[&#39;MYSQL_USER&#39;] = config[&#39;local&#39;][&#39;user&#39;]</pre><pre>app.config[&#39;MYSQL_PASSWORD&#39;] = config[&#39;local&#39;][&#39;password&#39;]</pre><pre>app.config[&#39;MYSQL_DB&#39;] = config[&#39;local&#39;][&#39;database&#39;]</pre><pre>app.config[&#39;MYSQL_CURSORCLASS&#39;] = config[&#39;local&#39;][&#39;cursor&#39;]</pre><pre>app.config[&#39;MYSQL_HOST&#39;] = &#39;localhost&#39;</pre><pre>app.config[&#39;MYSQL_PORT&#39;] = 3306</pre><pre>mysql.init_app(app)</pre><p><strong>Create a the cursor class.<br></strong>This allows you to execute the SQL code.</p><pre>def db_connection():</pre><pre> try:<br>     cursor = mysql.connection.cursor()<br>except Exception as error:<br>         raise error<br> return cursor</pre><h3>Step 3: Create a .env folder.</h3><p>Now this it not necessary if you’re going to run your app locally, but I make it a practice with every app as you will want to hide senstive information that is needed for your application to run.</p><pre>[local]<br>user= ****<br>password= ****<br>database=****<br>cursor = ****</pre><h3>Step 4: Create an Application Route.</h3><pre>from flask import Flask, jsonify,request</pre><pre><strong># Jsonify for the API request and request for the app routes.</strong></pre><pre>from db import mysql,db_connection,app</pre><pre><strong># db_connetion for cursor, app for intialization, and mysql for configuration.</strong></pre><pre><strong># function allows for SQL request and retrieval of API response.</strong></pre><pre>def fetchall_cursor(fetchall_query):</pre><pre>cursor = db_connection()</pre><pre>cursor.execute(fetchall_query)</pre><pre>row = cursor.fetchall()</pre><pre>resp = jsonify(row)</pre><pre>resp.status_code=200</pre><pre>return resp</pre><pre><strong># Retrieves all of Grocery Items</strong></pre><pre>@app.route(&quot;/v1/groceries&quot;,methods=[&quot;GET&quot;])</pre><pre>def get_gaitems():</pre><pre>if request.mimetype == &#39;application/json&#39;:</pre><pre>all_items =fetchall_cursor(&quot;&quot;&quot;SELECT * FROM Grocery_List&quot;&quot;&quot;)</pre><pre>return all_items</pre><pre>return (&quot;Method is not JSON, please submit JSON&quot;),500</pre><pre><strong>#server</strong></pre><pre>if __name__ == &quot;__main__&quot;:</pre><pre>app.run(debug=True, host=&#39;0.0.0.0&#39;)</pre><h3>Conclusion:</h3><p>After creating the API, I didn’t hate it. Still, the debugging experience could get confusing as if a request was not delivered to the API, I would sometimes not realize that it’s a SQL issue that I forgot to update when I made changes to the API. Still, I appreciated truly understanding how my API was sending data to my database.</p><p>I’m always looking to meet more engineers in my field, <a href="https://www.linkedin.com/in/christopherlandaverde/">find me on Linkedin </a>and let’s connect!</p><p>I’m always looking to meet more engineers in my field, <a href="https://www.linkedin.com/in/christopherlandaverde/">find me on Linkedin </a>and let’s connect!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f1c3f579160" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Year One: My Coding Experience]]></title>
            <link>https://christupher.medium.com/year-one-my-coding-experience-eb087274a8a1?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb087274a8a1</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[first100]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Fri, 16 Apr 2021 21:18:01 GMT</pubDate>
            <atom:updated>2022-02-09T02:53:44.025Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EslY4BZD-k4jadrXnF9WiQ.png" /><figcaption>My ode will be worth $1,000.</figcaption></figure><p>I love coding stories that are indie hackers-esque as they are always a great tale of human willpower. The formula for a great article would generally go</p><p><strong>Individuals want to solve a problem + figure out how to make it + builds it = Starts a business out of it.</strong></p><p>I got furloughed last year and decided here was my chance to stop flirting with this idea and take action. I wanted to have my own story that fell into that realm.</p><h3>What do I end up doing?</h3><p>Tutorial to build this CRUD app, or tutorial to build this app in 30 minutes, I signed up for a popular data science course and just kept moving. I’m feeling “<strong>good”</strong>, and I’m feeling like I’m achieving progress, but I’m aware that I can’t explain what I’m doing. I couldn’t answer one question in an interview(Although some may say that’s a completely different skill than coding in general). After 6–7 months, I have half-baked apps that “show” I can do various languages, but nothing is complete.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oeSB0ZtSaX5zbo8Y8%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Freactionseditor-dale-step-brothers-3oeSB0ZtSaX5zbo8Y8&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2F3oeSB0ZtSaX5zbo8Y8%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="184" frameborder="0" scrolling="no"><a href="https://medium.com/media/552883c3b2eca966dbbca805badfd744/href">https://medium.com/media/552883c3b2eca966dbbca805badfd744/href</a></iframe><h3>Welcome to Lixt:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eC13T-znQcVEI5QyLapf4A.png" /></figure><p>I decided to keep it simple by building an app to solve a problem whenever I chose to purchase groceries, I would always pick up the wrong food.If I got the right grocery item, it would be the wrong brand. I’m strong in python, so I started to develop the API and decide to build the front-end with minimal experience with React or React-Native:</p><h4>Blockers that came:</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o7TKqcx9KP4AlsSE8%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fnba-basketball-block-3o7TKqcx9KP4AlsSE8&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2F3o7TKqcx9KP4AlsSE8%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="239" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3f55abffbe6113b5435c3cfd8621c2e/href">https://medium.com/media/a3f55abffbe6113b5435c3cfd8621c2e/href</a></iframe><ol><li>I don’t know how databases work; I know SQL, but I have no clue how to develop a database that can store information.</li><li>I didn’t know how to send data through headers or how that process works.</li><li>I didn’t realize there were much more errors than a 200 OK or 500 OK.</li><li>UUIDs, SQL triggers, the list can go on.</li><li>Reacting is hard. State management made me rethink the life choices I have made in the future.</li><li>Setting up your computer for React can be tricky; make sure you have an extra 40 GBs for your mac to download Xcode.</li></ol><p>Debugging React can be tricky; by the time I’m writing this, I have found more accessible ways to debug problems.<strong> Stack overflow tends to get more challenging the more specific you tend to become, so learning to diagnose your problems is a skill.</strong></p><p>API requests for normal user behavior. I wasn’t aware of how often API requests are being made as I scroll Instagram. As soon as you POST, I chose to GET the request that gives me what I just posted. I don’t POST and then hit the refresh button. That is not a typical UI experience.</p><h3>Conclusion:</h3><p>Till I did this project, I have never spent more than 1–3 days on a project. Suppose I felt uncomfortable on a project. I would leave it and move to another youtube video. It took me around 2.5 months to complete this “simple” app. I felt that I made more robust connections to how an app works as a whole.<strong> I plan to continue my education in this format and use those quick 30-minute tutorial projects as handshake introductions towards the language.</strong></p><p>I’m always looking to meet more engineers in my field, <a href="https://www.linkedin.com/in/christopherlandaverde/">find me on Linkedin </a>and let’s connect!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb087274a8a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[List Comprehensions are my love language]]></title>
            <link>https://christupher.medium.com/list-comprehensions-are-my-love-language-3a8747131750?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a8747131750</guid>
            <category><![CDATA[goofy]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programmer-humor]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Fri, 19 Feb 2021 00:03:13 GMT</pubDate>
            <atom:updated>2021-03-05T19:24:30.298Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="python valentines day" src="https://cdn-images-1.medium.com/max/1024/1*UC1VNRj1nsPJ8Xmw7ZrhCA.jpeg" /></figure><p>I wish some words would specifically describe specific moments in coding that made you smile that this programming language can do all that with that little code. I can only describe the feeling as a mixture between an “Aha!” moment and Euphoria. List comprehensions are just fun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*EOBgYbM-SHGEwHB4YYUV1A.png" /><figcaption>And I didn’t forget your lambda expressions, but you will get your ode another time.</figcaption></figure><h4>For Loops</h4><ol><li>Create an empty list.</li><li>Loop over it</li><li>Append it towards the end of the loop.</li></ol><p>Example:</p><pre>string_it = [“processing”, “strings”, “with”, “map”]</pre><pre>for x in string_it:</pre><pre>    x = list(string_it)</pre><pre>print(x)</pre><pre>[‘processing’, ‘strings’, ‘with’, ‘map’]</pre><h4>Map:</h4><p>Returns a map object of the result after applying the function to each iterable.</p><p>Example:</p><pre>string_it = [&quot;processing&quot;, &quot;strings&quot;, &quot;with&quot;, &quot;map&quot;]</pre><pre>test_map = list(map(list, string_it)</pre><pre>[[&#39;p&#39;, &#39;r&#39;, &#39;o&#39;, &#39;c&#39;, &#39;e&#39;, &#39;s&#39;, &#39;s&#39;, &#39;i&#39;, &#39;n&#39;, &#39;g&#39;], [&#39;s&#39;, &#39;t&#39;, &#39;r&#39;, &#39;i&#39;, &#39;n&#39;, &#39;g&#39;, &#39;s&#39;], [&#39;w&#39;, &#39;i&#39;, &#39;t&#39;, &#39;h&#39;], [&#39;m&#39;, &#39;a&#39;, &#39;p&#39;]]</pre><h4>List Comprehensions:</h4><p><em>X = [ expression for_loop conditions. ]</em></p><ol><li>Expression: a call to the method or a valid expression that returns a value.</li><li>For_loop = the object or value</li><li>Condition = filter that accepts the item that valulate to True.</li></ol><p>Example:</p><pre>&gt;&gt; wow =[x for x in string_it if “processing” in string_it]</pre><pre>&gt;&gt;&gt; print(wow)</pre><pre>&gt;&gt;&gt; [‘processing’, ‘strings’, ‘with’, ‘map’]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a8747131750" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use environment variables in Python natively?]]></title>
            <link>https://christupher.medium.com/how-to-use-environment-variables-in-python-natively-397aa6fa8577?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/397aa6fa8577</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Wed, 17 Feb 2021 22:56:45 GMT</pubDate>
            <atom:updated>2022-02-09T02:53:56.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Python using .env variables." src="https://cdn-images-1.medium.com/max/1024/1*VYDH9vZY98py9fOFWD5ySQ.jpeg" /></figure><h3><strong>Why use a .env when working on a project?</strong></h3><p>You’re trying to work on your side project in python, and you have come to the point where you are trying to refactor your code, and you realize it’s not a great idea to have all your configuration variables out there in the open. <a href="https://12factor.net/config">According to the manifesto</a>, you store them an env variable as they can scale up as the app expands over time, and they are straightforward to change between deployments without changing the code.</p><h3><strong>Using python natively.</strong></h3><p>As a beginner, I try to limit my use of libraries and figure out native python ways to solve any issues. Let me introduce another great feature of python using a config parser.</p><h4><strong>In Layman’s Terms:</strong></h4><p>Config parser =&gt; Config Files.</p><p>This module lets you manage config files for your application.</p><h4><strong>In Python Terms:</strong></h4><blockquote>“This module provides the <a href="https://docs.python.org/3/library/configparser.html#configparser.ConfigParser">ConfigParser</a> class, which implements a basic configuration language that provides a structure similar to what’s found in Microsoft Windows INI files. You can use this to write Python programs which can be customized by end-users easily.”</blockquote><p><strong>Instructions:</strong></p><p><strong>Step 1. Create the .env file.</strong></p><p>The structure of the .env consists of sections that must be led with a [section] header as like this:</p><pre>[heroku]</pre><pre>user = ***</pre><pre>password=***</pre><pre>database=****</pre><pre>cursor = *****</pre><p><strong><em>And must be followed by either an = or </em>:</strong></p><h4><strong>Step 2: Import into your Database File and config the environment.</strong></h4><pre>Import configpaser</pre><pre>Config = configparser.con</pre><pre>config.read(‘env’)</pre><h4><strong>Step 3: Connect your App database to the .env file. In this example, I’m working on connecting a SQL database with my flask app, which is what the app variable is.</strong></h4><p>[‘local’] = section header</p><p>[‘user’] = key.</p><pre>app.config[‘MYSQLUSER’] = config[‘local’][‘user</pre><p>That’s all folks!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*sQgQzPYKFBNdTphgSo0PXg.png" /></figure><p>I’m always looking to meet more engineers in my field, <a href="https://www.linkedin.com/in/christopherlandaverde/">find me on Linkedin </a>and let’s connect!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=397aa6fa8577" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 3.9 Graph-lib Topological Sorter]]></title>
            <link>https://christupher.medium.com/python-3-9-graph-lib-topological-sorter-a185c712dc0d?source=rss-7e5a28075294------2</link>
            <guid isPermaLink="false">https://medium.com/p/a185c712dc0d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Christopher Landaverde]]></dc:creator>
            <pubDate>Mon, 04 Jan 2021 01:04:43 GMT</pubDate>
            <atom:updated>2022-02-09T02:54:11.406Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*WvppItyEYeEtjEzO5hEcrA.png" /></figure><p>Approximately three months ago, Python 3.9 came out of new library modules that led to the ability to run a topological graph with the graphlib module. It’s a useful tool that I think will come in handy when trying to scout through the dependencies in a program.</p><p>To Install Module:</p><pre>pip install graphlib.</pre><p>Topology (d):</p><p>Definition:</p><p>“ A topological order is a linear ordering of the vertices in a graph such that for every directed edge u -&gt; v from vertex u to vertex v, vertex u comes before vertex v in the ordering. <strong>For instance, the vertices of the graph may represent tasks to be performed, and the edges may represent constraints that one task must be performed before another; </strong>in this example, a topological ordering is just a valid sequence for the tasks. A complete topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph.”</p><p>Topological sorting in programming is common; an example of <a href="https://medium.com/swlh/how-django-uses-topological-sorting-for-resolving-migration-dependencies-1a93b544037f">this is Django</a>, which uses topological sorting to avoid cyclical dependency error. A great video that explains how this can be used in your <a href="https://www.youtube.com/watch?v=_O9q3H6mocg">python programming can be found here.</a></p><p>Example:</p><pre>if __name__ == &#39;__main__&#39;:</pre><pre>dependencies = {</pre><pre>&#39;scipy&#39;: {&#39;numpy&#39;,&#39;matplotlib&#39;,&#39;ipython&#39;,&#39;pandas&#39;&#39;symPy&#39;,&#39;nose&#39;},</pre><pre>&#39;pandas&#39;: {&#39;numpy&#39;,&#39;setuptools&#39;,&#39;dateutil&#39;,&#39;pytz&#39;},</pre><pre>&#39;matplotlib&#39;: {&#39;dateutil&#39;,&#39;pytz&#39;}</pre><pre>}</pre><pre>from graphlib import TopologicalSorter</pre><pre>ts=TopologicalSorter(dependencies)</pre><pre>print(list(ts.static_order()))</pre><p>Output:</p><pre>[&#39;numpy&#39;, &#39;ipython&#39;, &#39;nose&#39;, &#39;pandas&#39;,&#39;symPy&#39;, &#39;setuptools&#39;, &#39;dateutil&#39;, &#39;pytz&#39;, &#39;pandas&#39;, &#39;matplotlib&#39;, &#39;scipy&#39;]</pre><p>As you can see from the example, the installation of dependencies starts with those that require none, as in NumPy to sciPy that requires the most dependencies.</p><p>I’m always looking to meet more engineers in my field, <a href="https://www.linkedin.com/in/christopherlandaverde/">find me on Linkedin </a>and let’s connect!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a185c712dc0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>