<?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 Wesley Grant on Medium]]></title>
        <description><![CDATA[Stories by Wesley Grant on Medium]]></description>
        <link>https://medium.com/@wesley.grant?source=rss-6a7d22fc39f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kv6nws34HuxVxbwryk45Lg.png</url>
            <title>Stories by Wesley Grant on Medium</title>
            <link>https://medium.com/@wesley.grant?source=rss-6a7d22fc39f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 02:01:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wesley.grant/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[Flask Application & Request Context]]></title>
            <link>https://medium.com/@wesley.grant/flask-application-request-context-1b6461d9556c?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b6461d9556c</guid>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[context]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Fri, 26 May 2023 19:52:48 GMT</pubDate>
            <atom:updated>2023-05-26T19:52:48.938Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P5hMMrBESJ6TR11H" /><figcaption>Photo by <a href="https://unsplash.com/@chancema?utm_source=medium&amp;utm_medium=referral">C MA</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Flask employs the concept of contexts to temporarily bind specific objects to the current thread for convenient access. This is a core feature of Flask, and understanding it is critical for developing Flask applications.</p><p>Before we dive into contexts, let’s discuss one of the most fundamental objects in Flask: current_app.</p><h3>The Current App and Application Factories</h3><p>Why do we need current_app instead of a globally accessible app object? The reason is tied to the concept of &quot;application factories.&quot; In Flask, these factories allow multiple instances of a Flask application to run in the same process. This design provides a high degree of flexibility. For instance, imagine running tests with different configurations or serving multiple sites with the same Flask process. With current_app, your code isn&#39;t tied to a single, specific Flask app instance.</p><p>Let’s illustrate this:</p><pre>from flask import Flask, current_app<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def index():<br>    print(current_app.name)<br>    return &quot;Hello, World!&quot;<br></pre><p>In this snippet, current_app.name points to the app object that&#39;s handling the request. current_app is automatically managed by Flask during a request context.</p><p>To learn more about the concept of Application Factories, check out the Flask documentation <a href="https://flask.palletsprojects.com/en/2.3.x/patterns/appfactories/">here</a>.</p><h3>Application Context</h3><p>Now that we understand the current_app object, let&#39;s look at the Application context. This context is created and removed by Flask automatically when a request comes in, but you can also manually manage the application context when needed. This can be useful for tasks such as sending emails outside of a request context.</p><pre>with app.app_context():<br>    # we can now use current_app<br>    print(current_app.name)</pre><p>In the above code, the with app.app_context(): statement pushes an application context to the stack, effectively making the current_app proxy point to our app.</p><p>The Application context also includes a g object (global), a simple namespace object that has the same lifetime as an application context and can be used to store data during a single application context. This might be used to store data that is useful across several functions during a request.</p><h3>Request Context</h3><p>Next, let’s examine the Request context. This context is more specific than the Application context. It keeps track of the request-level data: the clients, the request they made, the response to send back, etc. The Request context is automatically pushed by Flask when a request is received and it includes request and session objects.</p><pre>from flask import request, session<br><br>@app.route(&#39;/set_user/&lt;user&gt;&#39;)<br>def set_user(user: str):<br>    session[&#39;user&#39;] = user<br>    return f&#39;User set to: {user}&#39;<br><br>@app.route(&#39;/get_user&#39;)<br>def get_user():<br>    user = session.get(&#39;user&#39;, &#39;Not set&#39;)<br>    return f&#39;User is currently set to: {user}&#39;</pre><p>Above we handle two endpoints: set_user and get_user. The set_user endpoint sets a username in the user session (session[&#39;user&#39;] = user), while the get_user endpoint retrieves the username from the session. Note that the request and session objects are only available while a request context is active.</p><p>Flask’s Request context can be used to manage request-level data. Specifically, data associated with the client making the request, the request they’ve made, and the response to send back.</p><h3>Context in Action</h3><p>We’ve seen how Flask uses the current_app object and the concept of Application Factories to handle multiple instances of a Flask application in the same process. We also saw how the Application context and Request context help manage and organize data related to the application instance and a specific request. Now, let&#39;s dig deeper and flush out how the Request context works in a real-world scenario.</p><p>Reference our example where we set a username in the session in the set_user endpoint, and retrieved it in the get_user endpoint. In this scenario, the session behaves somewhat like a dictionary that persists data across requests. When we set a value in the session (session[&#39;user&#39;] = user), that data is stored and remains available for subsequent requests made by the same client.</p><p>This persistence of session data is an important feature provided by the Request context. Flask manages session data using a combination of cookies and cryptographic signing on the server-side. For each client request, Flask checks the incoming cookies, verifies their integrity, and populates the session object with the data stored in the cookies. When preparing the response, Flask serializes the session data, signs it, and sends it back as a cookie.</p><p>This automatic management of session data explains why we can retrieve the username set in the set_user endpoint in a subsequent get_user request: even though the set_user request context has ended, the session data persists.</p><p>However, suppose we attempt to access the session object outside a request context like this:</p><pre>def outside_context():<br>    print(session.get(&#39;user&#39;))</pre><p>If you try to run this function, Flask will throw a RuntimeError with a message: Working outside of request context. This happens because there&#39;s no incoming request for Flask to extract and verify session data from. Without a request, the session object is not available.</p><h3>Final Note: The ‘g’ object</h3><p>Before we wrap things up, let’s delve into another element that plays a key role in Flask’s Application context — the “g” object.</p><p>Remember, we briefly mentioned a special object called “g”. This is a simple namespace object that has the same lifetime as an application context. It can be used to store data during a single application context.</p><p>Here’s a typical use-case of the “g” object:</p><pre>from flask import g<br><br>@app.before_request<br>def load_user():<br>    user_id = session.get(&#39;user_id&#39;)<br>    if user_id is not None:<br>        g.user = get_user_from_db(user_id)<br>    else:<br>        g.user = None</pre><p>In the load_user function, we use the before_request decorator, which makes this function run before each request. We use the &quot;g&quot; object to store the currently logged in user for the duration of the request.</p><p>This means that during a request, we can access g.user in other views or functions to get the current user, without having to make another database query. For instance:</p><pre>@app.route(&#39;/profile&#39;)<br>def profile():<br>    if g.user is None:<br>        return redirect(url_for(&#39;login&#39;))<br>    else:<br>        return render_template(&#39;profile.html&#39;, user=g.user)</pre><p>Here, g.user can be accessed directly, saving us a database call to fetch user details.</p><p>But be careful: the “g” object only lasts for one request. When the request ends, the “g” object is reset. If you try to access g.user outside of a request context (similar to our earlier session example), Flask will throw an error because the &quot;g&quot; object isn&#39;t initialized.</p><h3>Quick Recap</h3><ol><li>Application Factories and current_app: These aspects of Flask allow for multiple instances of a Flask application in the same process, providing flexibility and scalability.</li><li>Application Context and ‘g’ Object: The application context is tied to an instance of your application and is where you can access the ‘g’ object, a temporary, request-specific storage space.</li><li>Request Context and Session Data: The request context is created for each client request, providing access to request-specific data, including session data, which persists across requests from the same client.</li></ol><p>Until next time thanks for sticking around, I hope you’re loving Flask as much as I am! Feel free to reach out to me on here or check out my personal site: <a href="https://wesleygrant.netlify.app/">https://wesleygrant.netlify.app/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b6461d9556c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Climate Tech Handbook: A Collaborative Open Source Initiative]]></title>
            <link>https://medium.com/@wesley.grant/the-climate-tech-handbook-a-collaborative-open-source-initiative-69acd1de1672?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/69acd1de1672</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[climate]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Wed, 10 May 2023 18:21:33 GMT</pubDate>
            <atom:updated>2023-05-10T18:22:32.708Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQ15qxK_dh_5sSnr8tG6ug.png" /><figcaption><a href="https://www.climatetechhandbook.com/">https://www.climatetechhandbook.com/</a></figcaption></figure><p>Hello, I’m Wesley and for those of you that know me, you know I tend to focus on creating technical posts, but today I wanted to shift gears and share my experience with an open source project that has recently captured my interest — the Climate Tech Handbook.</p><h3>Encountering the Climate Tech Handbook</h3><p>I discovered the Climate Tech Handbook on DemocracyLab (<a href="https://www.democracylab.org/">https://www.democracylab.org/</a>), an online platform that connects skilled volunteers with open source projects. The initiative instantly resonated with me due to my eagerness to participate in open source endeavors and my ambition to work in the field of climate technology.</p><p>I had the pleasure of meeting Jacob Caggiano, the motivating force behind organizing the Climate Tech Handbook (<a href="https://www.linkedin.com/in/jacobcaggiano/">https://www.linkedin.com/in/jacobcaggiano/</a>). His enthusiasm and vision for the project inspired me to contribute my skills and expertise to this meaningful cause.</p><h3>Our Ongoing Plans and Progress</h3><p>As the Climate Tech Handbook project continues to evolve, we’re working on constructing a solid backend system that employs OpenAI’s GPT models for content generation. This allows us to efficiently create markdown files, laying the groundwork for community-driven editing and expansion.</p><p>Additionally, we’re considering ideas for incorporating more OpenAI services, developing a unique RSS bridge and database to refine a custom “Climate Bot” capable of providing users with valuable insights and information on climate technologies and trends.</p><p>Our immediate focus is on finalizing the MVP and deploying it using MKDocs and Netlify. If you’re intrigued by the technical aspects and would like to examine the code in detail, check out the Climate Tech Handbook community on GitHub: <a href="https://github.com/climate-tech-handbook">https://github.com/climate-tech-handbook</a>.</p><h3>How You Can Make a Difference</h3><p>The Climate Tech Handbook is a work in progress, and we need the support of dedicated individuals like you. Here’s how you can contribute:</p><ol><li>Offer your expertise: We’re seeking content writers, data analysts, developers, financial contributors, business advisors, and anyone who enjoys creating innovative data-driven solutions.</li><li>Raise awareness: Share information about the project with your network and encourage others to join the Climate Tech Handbook community.</li><li>Suggest improvements: We’re always open to new ideas for enhancing the project. Feel free to submit issues, feature requests, or pull requests on our GitHub page.</li></ol><p>Together, we can create a powerful, community-driven resource that accelerates climate tech solutions and brings us closer to tackling the global climate crisis. Join us today and become part of the change!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69acd1de1672" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stencil: The “not a framework” web component tool.]]></title>
            <link>https://medium.com/@wesley.grant/stencil-the-not-a-framework-web-component-tool-f1f7778923e5?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1f7778923e5</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[stenciljs]]></category>
            <category><![CDATA[handlebars]]></category>
            <category><![CDATA[bigcommerce]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Fri, 28 Apr 2023 20:29:07 GMT</pubDate>
            <atom:updated>2023-04-29T07:49:48.670Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*rQfzzFB0LfG1x0DKNidUsQ.png" /></figure><p>Yo, what’s up, Medium peeps? 🙌 Today, we’re gonna talk about Stencil, the magical tool that lets you create web components like a boss. Grab your coffee or whatever beverage floats your boat, and let’s dive right into this Stencil party. 🎉</p><h3>What the heck is Stencil?</h3><p>In a nutshell, Stencil is a compiler for building reusable, framework-agnostic web components. You heard that right! No more being tied down to a specific framework like a needy ex. Stencil components work like a charm with React, Angular, Vue, or just plain ol’ HTML and JS.</p><h3>Setting up the CLI</h3><p>Before you can ride the Stencil wave, you gotta install its CLI. Make sure you’ve got Node.js installed (v10 or later, folks), and then hit up your terminal with this one-liner:</p><pre>npm install -g stencil</pre><p>Boom! 💥 That’s it, you’ve got the Stencil CLI installed.</p><h3>Creating your first project</h3><p>Type this bad boy into your terminal:</p><pre>npm init stencil</pre><p>And if you just believe, you may see something like this below!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*ODGcJqpo8Ut5Bmkj3_e7Cg.png" /></figure><p>Go ahead pick component, follow the “kebab-case” convention making sure to name it something like “my-rad-component”. Ending with “component” being a very important rule to follow!</p><pre>✔ Select a starter project.<br><br>Starters marked as [community] are developed by the Stencil Community,<br>rather than Ionic. For more information on the Stencil Community, please see<br>https://github.com/stencil-community › component                Collection of web components that can be used anywhere<br>✔ Project name … my-rad-component<br>✔ Confirm? … yes<br>✔ All setup  in 22 ms<br><br>  We suggest that you begin by typing:<br><br>  $ cd my-rad-component<br>  $ npm install<br>  $ npm start<br><br>  You may find the following commands will be helpful:<br><br>  $ npm start<br>    Starts the development server.<br><br>  $ npm run build<br>    Builds your project in production mode.<br><br>  $ npm test<br>    Starts the test runner.<br><br><br>  Further reading:<br><br>   - https://github.com/ionic-team/stencil-component-starter<br>   - https://stenciljs.com/docs<br><br>  Happy coding! 🎈</pre><p>And if you rode that gnarly wave 🏄 all the way here, you should see something like this above! (Take note of those suggested commands)</p><h3>Npm commands</h3><p>Alright your in your component’s directory, you’ve npm installed and started! Let’s check out the package.json real quick.</p><pre>  &quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;stencil build --docs&quot;,<br>    &quot;start&quot;: &quot;stencil build --dev --watch --serve&quot;,<br>    &quot;test&quot;: &quot;stencil test --spec --e2e&quot;,<br>    &quot;test.watch&quot;: &quot;stencil test --spec --e2e --watchAll&quot;,<br>    &quot;generate&quot;: &quot;stencil generate&quot;<br>  },</pre><p>This should help you better understand what the npm commands are actually doing dude! Also, don’t forget to read your docs if you’re lost bro:<br><a href="https://stenciljs.com/docs/introduction">https://stenciljs.com/docs/introduction</a></p><h3>IT LIVES!</h3><p>Open your browser and check out your very first Stencil!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_IlB9_tx0xe5YzYo21T-pg.png" /></figure><p>“Wait? I have to write all of that every time I want a new component?”, you ask! 😬</p><p>No broseph, you can just use the generate command, didn’t you check out the package.json? 😎</p><h3>Generate a new component</h3><p>npm run generate</p><pre>TOTALLY@RAD:$ npm run generate<br><br>&gt; my-rad-component@0.0.1 generate<br>&gt; stencil generate<br><br>[01:56.5]  @stencil/core<br>[01:57.0]  v3.2.1 🎙<br>✔ Component tag name (dash-case): … sick-component<br>✔ Which additional files do you want to generate? › <br>Stylesheet (.css), <br>Spec Test  (.spec.tsx), <br>E2E Test (.e2e.ts)<br><br>$ stencil generate sick-component<br><br>The following files have been generated:<br>  - ./src/components/sick-component/sick-component.tsx<br>  - ./src/components/sick-component/sick-component.css<br>  - ./src/components/sick-component/test/sick-component.spec.tsx<br>  - ./src/components/sick-component/test/sick-component.e2e.ts</pre><p>I didn’t even have to say anything! Go into your src/components directory and check out your sick new component!</p><pre>import { Component, Host, h } from &#39;@stencil/core&#39;;<br><br>@Component({<br>  tag: &#39;sick-component&#39;,<br>  styleUrl: &#39;sick-component.css&#39;,<br>  shadow: true,<br>})<br>export class SickComponent {<br><br>  render() {<br>    return (<br>      &lt;Host&gt;<br>        &lt;slot&gt;&lt;/slot&gt;<br>      &lt;/Host&gt;<br>    );<br>  }<br><br>}</pre><h3>Using your new component</h3><p>Alright, so go ahead and get rid of that my-component that comes in our index.html, we got a sick new component to replace it.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot; /&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0&quot; /&gt;<br>    &lt;title&gt;Stencil Component Starter&lt;/title&gt;<br><br>    &lt;script type=&quot;module&quot; src=&quot;/build/my-rad-component.esm.js&quot;&gt;&lt;/script&gt;<br>    &lt;script nomodule src=&quot;/build/my-rad-component.js&quot;&gt;&lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>              &lt;!-- LIKE HELLA DELETE ME YO --&gt;<br>    &lt;my-component first=&quot;Stencil&quot; last=&quot;&#39;Don&#39;t call me a framework&#39; JS&quot;&gt;&lt;/my-component&gt;<br><br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Go ahead and take out our host and slot elements from our sick-component too, I’ll teach you those sick moves later.</p><pre>import { Component, Prop, h } from &#39;@stencil/core&#39;;<br><br>@Component({<br>  tag: &#39;sick-component&#39;,<br>  styleUrl: &#39;sick-component.css&#39;,<br>  shadow: true,<br>})<br>export class SickComponent {<br>  @Prop() radNoun: string = &quot;rad&quot;<br><br>  render() {<br>    return (<br>      &lt;span&gt;Making web components with Stencil is this {this.radNoun}?!&lt;/span&gt;<br>    );<br>  }<br>}</pre><p>Make sure to import Prop at the top and set it up so we can like, express our individuality, you know what I mean?</p><h3>Back to the index again yo</h3><p>Now you can finally use your rad component and play some mad libs!</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html dir=&quot;ltr&quot; lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot; /&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0&quot; /&gt;<br>    &lt;title&gt;Stencil is cool&lt;/title&gt;<br><br>    &lt;script type=&quot;module&quot; src=&quot;/build/my-rad-component.esm.js&quot;&gt;&lt;/script&gt;<br>    &lt;script nomodule src=&quot;/build/my-rad-component.js&quot;&gt;&lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>            &lt;!-- Don&#39;t forget about using kebab-case --&gt;<br>    &lt;sick-component rad-noun=&quot;totally insane&quot;&gt;&lt;/sick-component&gt;<br><br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*itf18RIMBgMbYodYqJG0bg.png" /></figure><p>Thanks for sticking with my Stencil tutorial. I’m totally stoked to continue on this adventure with you, let’s start stenciling. ✏️</p><h3>Conclusion</h3><p>Hey thanks for making it to the end, I had a lot of fun with this one and was feeling real silly with it. Stencil is seriously awesome and I’m quickly falling in love. I plan to make video content covering Stencil in more depth. Stay tuned if you’re interested in more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1f7778923e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Scraping with Nokogiri]]></title>
            <link>https://medium.com/@wesley.grant/web-scraping-with-nokogiri-ef29312e4fb3?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef29312e4fb3</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Sat, 15 Apr 2023 18:36:45 GMT</pubDate>
            <atom:updated>2023-04-19T06:12:33.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0xMmNCa9gVD9J56j" /><figcaption>Photo by <a href="https://unsplash.com/ko/@fumirin?utm_source=medium&amp;utm_medium=referral">Fumiaki Hayashi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So, you wanna grab some data from a website but don’t wanna do it manually?</p><p>You’re in luck! Today, I’m gonna show you how to use Nokogiri, a fantastic Ruby gem, to make web scraping a breeze.</p><p>What is Nokogiri, you ask?</p><p>Nokogiri is a Ruby gem that helps you parse, search, and manipulate HTML and XML documents. (No more manual data hunting!)</p><p>First things first: let’s install the gem.</p><pre>gem install nokogiri</pre><p>Got it installed? Great! Now, let’s get our hands dirty with some code.</p><pre>require &#39;nokogiri&#39;<br>require &#39;open-uri&#39;<br><br>url = &quot;https://example.com&quot; # Replace this with the website you want to scrape<br>doc = Nokogiri::HTML(URI.open(url))</pre><p>In the snippet above, we’re requiring Nokogiri and open-uri. Then we define the website we want to scrape and use Nokogiri::HTML to parse the HTML document. Easy-peasy, right?</p><p>Now that we have the HTML, let’s extract some data.</p><pre>doc.css(&#39;css_selector_here&#39;).each do |element|<br>  puts element.content<br>end</pre><p>All you need to do is replace ‘css_selector_here’ with the appropriate CSS selector. If you’re not familiar with CSS selectors, check out this handy guide: <a href="https://www.w3schools.com/cssref/css_selectors.asp">CSS Selector Reference</a></p><p>So there you have it! With just a few lines of Ruby code and the power of Nokogiri, you can automate web scraping like a pro.</p><p>Remember, though: web scraping can be a double-edged sword. Be respectful of websites’ terms of service and avoid hammering their servers with requests. Happy scraping!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef29312e4fb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Chrome DevTools to Debug Your JavaScript Code]]></title>
            <link>https://medium.com/@wesley.grant/using-chrome-devtools-to-debug-your-javascript-code-aeeffb24f446?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/aeeffb24f446</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[devtools]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[chrome]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Wed, 05 Apr 2023 18:51:20 GMT</pubDate>
            <atom:updated>2023-04-05T18:51:20.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7ffFNyZwG4iw00IW" /><figcaption>Photo by <a href="https://unsplash.com/@cbpsc1?utm_source=medium&amp;utm_medium=referral">Clint Patterson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Chrome DevTools is an essential tool for web developers, and it can be incredibly useful for debugging JavaScript code. In this article, we will discuss some tips and tricks that will help you use Chrome DevTools to debug your JavaScript code efficiently.</p><p>1. Accessing Chrome DevTools</p><p>To access Chrome DevTools, simply open up Google Chrome and navigate to the web page you want to debug. Once you’re on the page, right-click anywhere on the page and select “Inspect” from the context menu. Alternatively, you can press “Ctrl + Shift + I” (Windows) or “Cmd + Opt + I” (Mac) to open the DevTools window.</p><p>2. Using the console</p><p>The console is one of the most powerful features of Chrome DevTools. It allows you to log messages, run JavaScript commands, and debug your code. To open the console, simply click on the “Console” tab in the DevTools window.</p><p>Once you’re in the console, you can log messages using the console.log() function, run JavaScript commands, and even debug your code using breakpoints.</p><p>3. Setting breakpoints</p><p>Setting breakpoints is an essential part of debugging JavaScript code. Breakpoints allow you to pause your code at a specific point in time, giving you the ability to inspect the state of your code and variables.</p><p>To set a breakpoint, simply click on the line number in the “Sources” tab of the DevTools window. When your code reaches that line, it will pause, and you can inspect the state of your code.</p><p>4. Debugging with the debugger keyword</p><p>Another useful feature of Chrome DevTools is the debugger keyword. Placing the debugger keyword in your code will automatically trigger a breakpoint when your code reaches that point.</p><p>For example, if you want to pause your code at a specific point in a function, you can add the debugger keyword like this:</p><pre>function myFunction() {<br>  // some code<br>  debugger;<br>  // more code<br>}<br></pre><p>When your code reaches the debugger keyword, it will pause, and you can inspect the state of your code.</p><p>5. Using the “Sources” tab</p><p>The “Sources” tab in the DevTools window is where you can view and debug your JavaScript code. In this tab, you can set breakpoints, step through your code, and inspect variables.</p><p>One useful feature of the “Sources” tab is the ability to use the “Watch” feature. The “Watch” feature allows you to add an expression that you want to monitor, and Chrome DevTools will display the value of that expression as you step through your code.</p><p>6. Using the “Network” tab</p><p>The “Network” tab in the DevTools window can be useful for debugging AJAX requests and network-related issues. In this tab, you can view the status of your requests, the headers, and the response data.</p><p>To view the “Network” tab, simply click on the “Network” tab in the DevTools window. Then, make a request on the web page, and the “Network” tab will display the request details.</p><p>In conclusion, Chrome DevTools is an incredibly powerful tool for debugging JavaScript code. By using the console, setting breakpoints, and utilizing the “Sources” and “Network” tabs, you can debug your code more efficiently and effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aeeffb24f446" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Express: The Lightweight and Beginner-Friendly Node.js Framework]]></title>
            <link>https://medium.com/@wesley.grant/express-the-lightweight-and-beginner-friendly-node-js-framework-52ad639e3b22?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/52ad639e3b22</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Fri, 31 Mar 2023 15:34:49 GMT</pubDate>
            <atom:updated>2023-03-31T15:34:49.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CbGkbZ4GigdCqYpS" /><figcaption>Photo by <a href="https://unsplash.com/@bernardhermant?utm_source=medium&amp;utm_medium=referral">Bernard Hermant</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a web developer, one of my favorite frameworks to use is Express. Express is a minimalist and flexible framework that allows developers to build web applications quickly and easily. In this article, I’ll explain what Express is, why it’s a great choice for beginners using Node.js, and walk you through the basics of setting up an app using Express.</p><p>What is Express?</p><p>Express is a popular web framework for Node.js that provides a set of tools and features for building web applications. It’s minimalist and flexible, meaning you can use it to build small or large applications with ease. Express is built on top of Node.js’ core HTTP module, which means it’s lightweight and fast.</p><p>Why is Express a great choice for beginners?</p><p>Express is a great choice for beginners because of its simplicity and ease of use. It has a small bundle size and a straightforward API, which makes it easy to learn and use. Express also has a large and active community, which means there are plenty of resources available for learning and troubleshooting.</p><p>How to Set Up an Express App</p><p>To set up an Express app, you’ll need to follow a few basic steps. First, you’ll need to install Express using npm. Open your terminal and navigate to the directory where you want to create your app, then run the following command:</p><pre>npm install express</pre><p>This will install the latest version of Express in your project directory.</p><p>Next, create a new file called app.js in your project directory. This file will contain the code for your Express app. Here&#39;s some example code to get you started:</p><pre>const express = require(&#39;express&#39;);<br>const app = express();<br>const port = 3000;<br><br>app.get(&#39;/&#39;, (req, res) =&gt; {<br>  res.send(&#39;Hello World!&#39;);<br>});<br><br>app.listen(port, () =&gt; {<br>  console.log(`Example app listening at http://localhost:${port}`);<br>});</pre><p>In this example, we’re requiring the Express module, creating a new Express app, and setting the port to 3000. We’re also defining a single route for the root path (‘/’) that responds with the text ‘Hello World!’. Finally, we’re starting the server and logging a message to the console to let us know that the server is running.</p><p>To start your app, navigate to your project directory in the terminal and run the following command:</p><pre>node app.js</pre><p>This will start the server and your app will be available at http://localhost:3000/. If you navigate to this URL in your web browser, you should see the text &#39;Hello World!&#39; displayed on the page.</p><p>Conclusion</p><p>Express is a great web framework for Node.js that provides a simple and flexible way to build web applications. It’s lightweight, fast, and has a small bundle size, making it a great choice for beginners who want to learn more about Node.js. By following the steps outlined above, you can quickly and easily set up an Express app and start building your own web applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52ad639e3b22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.js: An introduction]]></title>
            <link>https://medium.com/@wesley.grant/node-js-an-introduction-19db6769e77c?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/19db6769e77c</guid>
            <category><![CDATA[environment]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 21:01:31 GMT</pubDate>
            <atom:updated>2023-03-26T21:01:31.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JNwdNyoSg8hpyA98" /><figcaption>Photo by <a href="https://unsplash.com/@sigmund?utm_source=medium&amp;utm_medium=referral">Sigmund</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are a web developer, chances are you have heard of Node.js. It is a popular runtime environment that allows developers to build server-side applications using JavaScript. In this article, we will explore what Node.js is, its features, and why it has become so popular among developers.</p><p>What is Node.js?</p><p>Node.js is a JavaScript runtime built on the V8 JavaScript engine, which is used in Google Chrome. It allows developers to write server-side applications using JavaScript. This means that developers can use the same language for both the client and server side of web development.</p><p>Node.js was created in 2009 by Ryan Dahl and has since become one of the most popular technologies in web development. It has an active community and a vast ecosystem of libraries and tools.</p><p>Features of Node.js</p><p>Node.js has several features that make it attractive to developers. Here are some of the most notable ones:</p><ul><li>Asynchronous programming</li></ul><p>One of the most significant features of Node.js is its ability to handle asynchronous programming. It uses an event-driven, non-blocking I/O model, which makes it efficient in handling multiple connections simultaneously.</p><ul><li>Scalability</li></ul><p>Node.js is highly scalable, making it suitable for applications that require high performance and can handle a large number of concurrent connections. It uses a single-threaded event loop, which allows it to handle multiple connections without creating new threads.</p><ul><li>Fast development</li></ul><p>Node.js is fast and easy to develop with, thanks to its vast ecosystem of modules and tools. It has a large and active community that contributes to its development and offers support to developers.</p><ul><li>Cross-platform compatibility</li></ul><p>Node.js is compatible with different operating systems, including Windows, macOS, and Linux. This makes it easy for developers to develop and deploy applications across different platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R_ONlXTQtREgh-eI" /><figcaption>Photo by <a href="https://unsplash.com/@yortrosal?utm_source=medium&amp;utm_medium=referral">Jorge Rosal</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Why Node.js has become so popular</p><p>Node.js has become popular among developers for several reasons. Here are some of the most notable ones:</p><ul><li>The rise of JavaScript</li></ul><p>JavaScript has become one of the most popular programming languages in the world, thanks to its versatility and ease of use. Node.js has made it possible for developers to use JavaScript for server-side development, which has made it even more popular.</p><ul><li>High performance</li></ul><p>Node.js is highly performant, making it suitable for applications that require high performance and scalability. It can handle a large number of concurrent connections, making it an ideal choice for real-time applications.</p><ul><li>Large and active community</li></ul><p>Node.js has a large and active community that contributes to its development and offers support to developers. The community has created a vast ecosystem of modules and tools that make it easy to develop with Node.js.</p><ul><li>Flexibility</li></ul><p>Node.js is flexible and can be used for a wide range of applications, including web applications, mobile applications, and desktop applications. This makes it a versatile technology that can be used for different purposes.</p><p>Conclusion</p><p>Node.js is an excellent choice for web developers looking for a fast and efficient way to build server-side applications using JavaScript. Its features, such as asynchronous programming, scalability, and cross-platform compatibility, make it an attractive technology for developers. Its popularity continues to grow, thanks to its large and active community and its vast ecosystem of modules and tools. If you haven’t tried Node.js yet, you should definitely give it a try.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19db6769e77c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of Natural Language Processing: How it’s Changing the Way We Interact with Technology]]></title>
            <link>https://medium.com/@wesley.grant/the-power-of-natural-language-processing-how-its-changing-the-way-we-interact-with-technology-bb7bdfc98a8?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb7bdfc98a8</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Thu, 23 Mar 2023 19:31:31 GMT</pubDate>
            <atom:updated>2023-03-23T19:31:31.709Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dY9fM_nb2aghob9u" /><figcaption>Photo by <a href="https://unsplash.com/@emilianovittoriosi?utm_source=medium&amp;utm_medium=referral">Emiliano Vittoriosi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Natural Language Processing (NLP) is an exciting field of artificial intelligence that is revolutionizing the way we interact with technology. It enables computers to understand, interpret and generate human language, allowing developers to create smarter, more intuitive applications that can communicate with people in a natural way.</p><p>From virtual assistants and chatbots to machine translation and sentiment analysis, NLP is powering some of the most exciting innovations in the tech industry today. In this article, we’ll explore some of the popular applications of NLP and how they are being used to create intelligent systems.</p><p>Virtual Assistants</p><p>Virtual assistants like Siri, Alexa, and Google Assistant are probably the most popular examples of NLP in action. These assistants use NLP to understand and respond to voice commands in natural language, making it easier for users to interact with their devices.</p><p>NLP models used in virtual assistants are trained on vast amounts of data to accurately interpret and respond to user queries. They use techniques such as speech recognition, natural language understanding (NLU), and natural language generation (NLG) to provide users with relevant information and perform tasks on their behalf.</p><p>Chatbots</p><p>Chatbots are another example of NLP in action. They are computer programs that simulate conversations with users, providing them with customer support, recommendations, and even entertainment.</p><p>NLP allows chatbots to understand user intent and respond in a natural and engaging way. Chatbots use techniques such as sentiment analysis, topic modeling, and named entity recognition to personalize their responses and provide users with a more personalized experience.</p><p>Machine Translation</p><p>NLP has made significant progress in machine translation, which refers to the process of translating text from one language to another using computer algorithms.</p><p>NLP techniques such as neural machine translation (NMT) have significantly improved the accuracy of machine translation systems. NMT models use deep learning algorithms to analyze the context and meaning of text, resulting in translations that are more accurate and natural-sounding.</p><p>Sentiment Analysis</p><p>Sentiment analysis is a technique used to determine the emotional tone of a piece of text. It is widely used in social media monitoring, customer feedback analysis, and market research.</p><p>NLP enables developers to analyze large volumes of text data and extract insights into customer sentiment and opinion. Sentiment analysis algorithms can identify positive, negative, and neutral sentiment in text, providing businesses with valuable insights into their customers’ opinions and preferences.</p><p>Challenges and Opportunities</p><p>Despite the potential benefits of NLP, there are also some challenges that come with it. One of the major challenges is the need for vast amounts of training data to create accurate models. Another challenge is the potential for bias in NLP models, as they are often trained on data that reflects existing biases in society.</p><p>However, as NLP technology continues to evolve, we can expect to see even more exciting applications in the future. Developers are already exploring new ways to use NLP, such as in language learning, speech recognition for people with disabilities, and sentiment analysis for political campaigning.</p><p>Conclusion</p><p>NLP has become an essential tool for modern developers, enabling them to create intelligent applications that can understand and respond to human language. From virtual assistants to chatbots and machine translation, NLP is powering some of the most exciting innovations in the tech industry today.</p><p>As NLP technology continues to advance, we can look forward to a future where computers can truly understand and communicate with us in a natural and intuitive way. However, we must also be aware of the challenges and potential biases that come with this technology and work to address them. Overall, NLP is a promising field that holds enormous potential for improving the way we interact with technology and each other.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb7bdfc98a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Large Web Applications with Monorepos and Workspaces]]></title>
            <link>https://medium.com/bitsrc/managing-large-web-applications-with-monorepos-and-workspaces-b12dc11e720b?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b12dc11e720b</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[monorepo]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Tue, 21 Mar 2023 18:01:50 GMT</pubDate>
            <atom:updated>2023-03-28T03:43:03.189Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LLqbds-Wfn8ZHQrH" /><figcaption>Photo by <a href="https://unsplash.com/@dmey503?utm_source=medium&amp;utm_medium=referral">Dan Meyers</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When building large web applications, managing code across multiple projects can be a challenge. Each project may have its own dependencies build system and deployment process. This can lead to a lot of duplication, inconsistency, and overhead. To address this, developers have turned to monorepos and workspaces to simplify the management of code.</p><h3>What is a Monorepo?</h3><p>A monorepo is a single repository that contains multiple projects. These projects can be related or unrelated, and can use different technologies, languages, or frameworks. By having all of the code in a single repository, it becomes easier to manage dependencies, share code, and enforce consistency across projects.</p><h3>What are Workspaces?</h3><p>Workspaces are a way to manage code within a monorepo. Workspaces allow developers to group related projects together and manage them as a single entity. This can be particularly useful when you have shared dependencies or code that is used across multiple projects.</p><h3>Vite and Flask in a Monorepo</h3><p>Let’s consider an example where we have a web application that consists of a front-end built using Vite and a back-end API built using Flask. We want to manage these two projects in a single monorepo.</p><p>Our file structure might look something like this:</p><pre>monorepo/<br>  packages/<br>    frontend/<br>      vite.config.js<br>      package.json<br>      index.html<br>      src/<br>        main.js<br>        App.vue<br>    backend/<br>      app.py<br>      requirements.txt<br>      package.json</pre><p>Here, we have two packages within our monorepo: frontend and backend. The frontend package contains all the files needed to build and run our front-end app using Vite, while the backend package contains all the files needed to build and run our back-end API using Flask.</p><p>We can use workspaces to manage these two packages as a single entity within our monorepo. To do this, we need to define our workspaces in our package.json file at the root of our monorepo:</p><pre>{<br>  &quot;name&quot;: &quot;my-monorepo&quot;,<br>  &quot;version&quot;: &quot;0.1.0&quot;,<br>  &quot;private&quot;: true,<br>  &quot;workspaces&quot;: [<br>    &quot;packages/*&quot;<br>  ]<br>}</pre><p>Here, we’re telling our monorepo that all the directories under the packages directory are part of our workspace.</p><p>We can now use the npm or yarn command to install all the dependencies for our workspace:</p><pre>$ npm install</pre><p>Or:</p><pre>$ yarn install</pre><p>This will install all the dependencies for our front-end and back-end projects.</p><p>To start our front-end app, we can use the following command from within the frontend package:</p><pre>$ npm run dev</pre><p>Or:</p><pre>$ yarn dev</pre><p>This will start the development server and open our front-end app in a web browser.</p><p>To start our back-end API, we can use the following command from within the backend package:</p><pre>$ flask run</pre><p>This will start the Flask development server and allow us to make requests to our API.</p><h3>Pros and Cons of Monorepos and Workspaces</h3><p>There are several benefits and drawbacks to using a monorepo and workspaces.</p><h3>Pros</h3><ul><li>Simplicity: With a monorepo, there’s only one repository to manage, which makes it easier to track changes, enforce consistency, and ensure that everyone is using the same version of dependencies.</li><li>Code sharing: By having all code in a single repository, it’s easier to share code across projects. This can lead to fewer bugs, less duplicated code, and a more consistent user experience.</li><li>Faster builds and tests: With a monorepo, you only need to run builds and tests once, rather than for each project. This can lead to faster build times and faster feedback loops.</li><li>Easier maintenance: With a monorepo, it’s easier to manage dependencies and enforce consistency across projects. This can lead to fewer bugs, less duplicated code, and a more maintainable codebase.</li></ul><h3>Cons</h3><ul><li>Increased complexity: Managing a monorepo can be more complex than managing separate repositories. There can be more dependencies, more files, and more overhead.</li><li>Slower initial setup: Setting up a monorepo can take longer than setting up separate repositories. There may be more configuration and tooling involved.</li><li>Potential for conflicts: With a monorepo, there’s a greater potential for conflicts between projects. This can lead to longer merge times and more difficult conflict resolution.</li></ul><blockquote>💡 If you use an open source toolchain such as <a href="https://bit.cloud/"><strong>Bit</strong></a> though, monorepos become infinitely more streamlined. Within a <a href="https://bit.dev/docs/workspace/creating-workspaces/"><strong>Bit Workspace</strong></a>, all internal dependencies are automatically managed by Bit, with independent testing, documentation, and semver for each. There’s no need to tell npm, pnpm, or yarn which component dependencies need to be installed to, nor if its a dev or prod dependency. Bit dynamically generates package.json files for each, and you can control access for shared code. <a href="https://bit.dev/blog/painless-monorepo-dependency-management-with-bit-l4f9fzyw/"><strong>This guide</strong></a> will show you how.</blockquote><blockquote>Bit also enables two-way sharing and collaboration between monorepos, making it easy to reuse code across projects and teams.</blockquote><h4>Learn more about simplifying a monorepo architecture using Bit:</h4><p><a href="https://blog.bitsrc.io/monorepo-architecture-simplified-with-bit-and-npm-b1354be62870">Monorepos Made Simpler with Bit</a></p><h3>Conclusion</h3><p>Monorepos and workspaces are powerful tools for managing large web applications. They can simplify code management, improve consistency, and reduce duplication. However, they can also introduce complexity and potential conflicts. When considering whether to use a monorepo and workspaces, it’s important to weigh the benefits and drawbacks and consider the specific needs of your project.</p><h4>Develop components and manage packages in any repo architecture easily with Bit</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*rJrZCjv4yIp9MsVW.png" /></figure><p><a href="https://bit.cloud/"><strong>Bit</strong></a><strong>’s open-source tool </strong>help 250,000+ devs to build apps with components.</p><p>Turn any UI, feature, or page into a <strong>reusable component</strong> — and share it across your applications. It’s easier to collaborate and build faster.</p><p><strong>→ </strong><a href="https://bit.dev/"><strong>Learn more</strong></a></p><p>Split apps into components to make app development easier, and enjoy the best experience for the workflows you want:</p><h4>→ <a href="https://blog.bitsrc.io/how-we-build-micro-front-ends-d3eeeac0acfc">Micro-Frontends</a></h4><h4>→ <a href="https://blog.bitsrc.io/how-we-build-our-design-system-15713a1f1833">Design System</a></h4><h4>→ <a href="https://bit.cloud/blog/how-to-reuse-react-components-across-your-projects-l4pz83f4">Code-Sharing and reuse</a></h4><h4>→ <a href="https://www.youtube.com/watch?v=5wxyDLXRho4&amp;t=2041s">Monorepo</a></h4><h4>Learn more:</h4><ul><li><a href="https://blog.bitsrc.io/how-we-build-micro-front-ends-d3eeeac0acfc">How We Build Micro Frontends</a></li><li><a href="https://blog.bitsrc.io/how-we-build-our-design-system-15713a1f1833">How we Build a Component Design System</a></li><li><a href="https://bit.dev/blog/how-to-reuse-react-components-across-your-projects-l4pz83f4/">How to reuse React components across your projects</a></li><li><a href="https://blog.bitsrc.io/5-ways-to-build-a-react-monorepo-a294b6c5b0ac">5 Ways to Build a React Monorepo</a></li><li><a href="https://bit.dev/blog/how-to-create-a-composable-react-app-with-bit-l7ejpfhc/">How to Create a Composable React App with Bit</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b12dc11e720b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bitsrc/managing-large-web-applications-with-monorepos-and-workspaces-b12dc11e720b">Managing Large Web Applications with Monorepos and Workspaces</a> was originally published in <a href="https://medium.com/bitsrc">Bits and Pieces</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The .bashrc File: What it is, What it Does, and Some Common Configuration Examples]]></title>
            <link>https://medium.com/@wesley.grant/the-bashrc-file-what-it-is-what-it-does-and-some-common-configuration-examples-c0e7eb4e330e?source=rss-6a7d22fc39f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0e7eb4e330e</guid>
            <category><![CDATA[pc]]></category>
            <category><![CDATA[environment]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Wesley Grant]]></dc:creator>
            <pubDate>Sun, 19 Mar 2023 18:48:31 GMT</pubDate>
            <atom:updated>2023-03-19T18:48:31.853Z</atom:updated>
            <content:encoded><![CDATA[<h3>The .bashrc File: What it is, What it Does, and Some Common Configuration Examples</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A9keL_8aJeL94OpP" /><figcaption>Photo by <a href="https://unsplash.com/@6heinz3r?utm_source=medium&amp;utm_medium=referral">Gabriel Heinzer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve spent any time working in a Linux or Unix environment, you’ve likely heard of the .bashrc file. But what exactly is this file, and what does it do? In this article, we’ll explore the .bashrc file in depth, discussing its purpose, structure, and some common configuration examples.</p><p>What is the .bashrc file?</p><p>The .bashrc file is a configuration file used by the Bash shell, which is the default command-line interface for many Unix-based operating systems, including Linux and macOS. When you start a new Bash shell session, the .bashrc file is executed automatically, and any commands contained within it are run.</p><p>What does the .bashrc file do?</p><p>The .bashrc file is used to configure various settings and options for the Bash shell. Some of the most common uses of the .bashrc file include:</p><ol><li>Defining environment variables: You can use the .bashrc file to define environment variables, which are values that are used by the shell and other programs to determine certain behavior or settings.</li><li>Creating aliases: Aliases are shortcuts for commonly used commands or command sequences. By defining aliases in your .bashrc file, you can save yourself time and typing by using these shortcuts instead of typing out the full commands.</li><li>Setting command options: You can use the .bashrc file to set various command options, such as default file permissions or shell behavior.</li><li>Defining shell functions: Shell functions are reusable pieces of code that you can define in your .bashrc file and then use throughout your shell sessions.</li></ol><p>Now that we understand what the .bashrc file is and what it does, let’s take a look at some common configuration examples.</p><p>Defining Environment Variables</p><p>One of the most common uses of the .bashrc file is to define environment variables. For example, you might define a variable called “EDITOR” that specifies the text editor you prefer to use:</p><pre>export EDITOR=vim</pre><p>This line sets the “EDITOR” environment variable to “vim”, which means that any program that uses this variable will open files in the Vim text editor by default.</p><p>Creating Aliases</p><p>Another common use of the .bashrc file is to create aliases. For example, you might create an alias called “ll” that is equivalent to typing “ls -l”:</p><pre>alias ll=&#39;ls -l&#39;</pre><p>This line defines an alias called “ll” that runs the “ls -l” command whenever it is called.</p><p>Setting Command Options</p><p>You can also use the .bashrc file to set various command options. For example, you might want to set the default file permissions for new files that you create in your shell:</p><pre>umask 022</pre><p>This line sets the default file permissions to “022”, which means that new files will be created with read and write permissions for the owner, and read-only permissions for everyone else.</p><p>Defining Shell Functions</p><p>Finally, you can define shell functions in your .bashrc file. For example, you might define a function called “backup” that creates a backup copy of a file:</p><pre>function backup() {<br>  cp $1 ${1}.bak<br>}</pre><p>This code defines a function called “backup” that takes one argument (the filename of the file to be backed up) and creates a backup copy of it by appending “.bak” to the filename.</p><p>Conclusion</p><p>The .bashrc file is an essential configuration file for the Bash shell, used to define environment variables, create aliases, set command options, and define shell functions. By understanding the purpose and structure of the .bashrc file, you can customize your shell environment to suit your specific needs and preferences. Whether you’re a seasoned Linux user or just starting to explore the world of Unix-based operating systems, the .bashrc file is a powerful tool that can help you get the most out of your command-line interface.</p><p>So, take some time to explore the various configuration options available in your .bashrc file and start customizing your shell environment today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0e7eb4e330e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>