<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://bridgetownrb.com/" version="2.2.2">Bridgetown</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-11-04T20:45:56+00:00</updated><id>/feed.xml</id><title type="html">Peter Boling</title><subtitle>Yet Another Paradigm by Peter Boling, featuring technical blog posts about Ruby, JavaScript, TypeScript, Go, Python, DevOps, and various open source projects. Ramblings, mumblings, cv/resume, technical blog, and documentation for many popular, and unpopular, RubyGems and other FLOSS projects, including oauth2, omniauth-identity, sanitize_email, debug_logging, flag_shih_tzu, gem_bench, etc. Semi-lifely state-of-the-petris updates.</subtitle><entry><title type="html">DevOps Best Practices for 2024</title><link href="/posts/devops/devops-best-practices-for-2024/" rel="alternate" type="text/html" title="DevOps Best Practices for 2024" /><published>2024-10-09T11:45:00+00:00</published><updated>2024-10-09T11:45:00+00:00</updated><id>repo://posts.collection/_posts/2024-10-09-devops-best-practices-for-2024.md</id><content type="html" xml:base="/posts/devops/devops-best-practices-for-2024/">&lt;p&gt;DevOps continues to evolve, and staying up-to-date with best practices is crucial for successful software delivery.&lt;/p&gt;

&lt;h2 id=&quot;key-devops-principles&quot;&gt;Key DevOps Principles&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Automation First&lt;/strong&gt;: Automate everything that can be automated&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Continuous Integration/Continuous Deployment (CI/CD)&lt;/strong&gt;: Ship code faster and more reliably&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Infrastructure as Code (IaC)&lt;/strong&gt;: Manage infrastructure through code&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Monitoring and Observability&lt;/strong&gt;: Know what’s happening in your systems&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;essential-tools&quot;&gt;Essential Tools&lt;/h2&gt;

&lt;h3 id=&quot;version-control&quot;&gt;Version Control&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Git for source code management&lt;/li&gt;
  &lt;li&gt;GitHub/GitLab for collaboration&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;cicd&quot;&gt;CI/CD&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;GitHub Actions&lt;/li&gt;
  &lt;li&gt;Jenkins&lt;/li&gt;
  &lt;li&gt;GitLab CI&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;infrastructure-as-code&quot;&gt;Infrastructure as Code&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Terraform&lt;/li&gt;
  &lt;li&gt;Ansible&lt;/li&gt;
  &lt;li&gt;Pulumi&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;containerization&quot;&gt;Containerization&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Docker example&lt;/span&gt;
docker build &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; myapp:latest &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
docker run &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 8080:8080 myapp:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;orchestration&quot;&gt;Orchestration&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Kubernetes for container orchestration&lt;/li&gt;
  &lt;li&gt;Docker Swarm as a simpler alternative&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;monitoring-stack&quot;&gt;Monitoring Stack&lt;/h2&gt;

&lt;p&gt;Implement comprehensive monitoring:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Prometheus for metrics&lt;/li&gt;
  &lt;li&gt;Grafana for visualization&lt;/li&gt;
  &lt;li&gt;ELK Stack for logs&lt;/li&gt;
  &lt;li&gt;Jaeger for distributed tracing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;security-in-devops-devsecops&quot;&gt;Security in DevOps (DevSecOps)&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Scan containers for vulnerabilities&lt;/li&gt;
  &lt;li&gt;Implement least privilege access&lt;/li&gt;
  &lt;li&gt;Use secrets management tools&lt;/li&gt;
  &lt;li&gt;Regular security audits&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;cultural-aspects&quot;&gt;Cultural Aspects&lt;/h2&gt;

&lt;p&gt;DevOps is not just tools—it’s a culture:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Foster collaboration between Dev and Ops&lt;/li&gt;
  &lt;li&gt;Encourage shared responsibility&lt;/li&gt;
  &lt;li&gt;Embrace failure as learning opportunities&lt;/li&gt;
  &lt;li&gt;Continuous improvement mindset&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay current with DevOps practices to deliver better software faster!&lt;/p&gt;</content><author><name></name></author></entry><entry><title type="html">Building RESTful APIs with Python Flask</title><link href="/posts/python/building-restful-apis-with-python-flask/" rel="alternate" type="text/html" title="Building RESTful APIs with Python Flask" /><published>2024-10-08T09:15:00+00:00</published><updated>2024-10-08T09:15:00+00:00</updated><id>repo://posts.collection/_posts/2024-10-08-building-restful-apis-with-python-flask.md</id><content type="html" xml:base="/posts/python/building-restful-apis-with-python-flask/">&lt;p&gt;Flask is a lightweight Python web framework perfect for building RESTful APIs. In this tutorial, we’ll create a simple API.&lt;/p&gt;

&lt;h2 id=&quot;why-flask&quot;&gt;Why Flask?&lt;/h2&gt;

&lt;p&gt;Flask is minimalist and flexible, making it ideal for:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Small to medium-sized applications&lt;/li&gt;
  &lt;li&gt;RESTful API development&lt;/li&gt;
  &lt;li&gt;Prototyping&lt;/li&gt;
  &lt;li&gt;Learning web development&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;setting-up&quot;&gt;Setting Up&lt;/h2&gt;

&lt;p&gt;First, install Flask:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;flask
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;creating-a-simple-api&quot;&gt;Creating a Simple API&lt;/h2&gt;

&lt;p&gt;Here’s a basic Flask API:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flask&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Flask&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;jsonify&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Flask&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__name__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@app.route&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/api/users&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;methods&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;GET&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;get_users&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;users&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Alice&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Bob&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;jsonify&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@app.route&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/api/users/&amp;lt;int:user_id&amp;gt;&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;methods&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;GET&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;get_user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Fetch user from database
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;User &lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;jsonify&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;__name__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;__main__&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;running-the-api&quot;&gt;Running the API&lt;/h2&gt;

&lt;p&gt;Run your Flask application:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Your API is now available at &lt;code class=&quot;highlighter-rouge&quot;&gt;http://localhost:5000/api/users&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;best-practices&quot;&gt;Best Practices&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Use blueprints for larger applications&lt;/li&gt;
  &lt;li&gt;Implement proper error handling&lt;/li&gt;
  &lt;li&gt;Add authentication and authorization&lt;/li&gt;
  &lt;li&gt;Document your API with Swagger/OpenAPI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Flask makes API development simple and enjoyable!&lt;/p&gt;</content><author><name></name></author></entry><entry><title type="html">Understanding JavaScript Promises</title><link href="/posts/javascript/understanding-javascript-promises/" rel="alternate" type="text/html" title="Understanding JavaScript Promises" /><published>2024-10-05T14:30:00+00:00</published><updated>2024-10-05T14:30:00+00:00</updated><id>repo://posts.collection/_posts/2024-10-05-understanding-javascript-promises.md</id><content type="html" xml:base="/posts/javascript/understanding-javascript-promises/">&lt;p&gt;JavaScript Promises are a powerful feature for handling asynchronous operations. Let’s dive into how they work and when to use them.&lt;/p&gt;

&lt;h2 id=&quot;what-is-a-promise&quot;&gt;What is a Promise?&lt;/h2&gt;

&lt;p&gt;A Promise is an object representing the eventual completion or failure of an asynchronous operation.&lt;/p&gt;

&lt;h2 id=&quot;basic-promise-syntax&quot;&gt;Basic Promise Syntax&lt;/h2&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;myPromise&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;// Asynchronous operation&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm&quot;&gt;/* success */&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;using-promises&quot;&gt;Using Promises&lt;/h2&gt;

&lt;p&gt;You can use the &lt;code class=&quot;highlighter-rouge&quot;&gt;then()&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;catch()&lt;/code&gt; methods to handle promise results:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;myPromise&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Success:&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Error:&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;asyncawait&quot;&gt;Async/Await&lt;/h2&gt;

&lt;p&gt;Modern JavaScript provides &lt;code class=&quot;highlighter-rouge&quot;&gt;async/await&lt;/code&gt; syntax for working with promises:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;https://api.example.com/data&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;catch &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Error fetching data:&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Promises make asynchronous code cleaner and easier to reason about!&lt;/p&gt;</content><author><name></name></author></entry><entry><title type="html">Getting Started with Ruby on Rails</title><link href="/posts/ruby/getting-started-with-ruby-on-rails/" rel="alternate" type="text/html" title="Getting Started with Ruby on Rails" /><published>2024-10-01T10:00:00+00:00</published><updated>2024-10-01T10:00:00+00:00</updated><id>repo://posts.collection/_posts/2024-10-01-getting-started-with-ruby-on-rails.md</id><content type="html" xml:base="/posts/ruby/getting-started-with-ruby-on-rails/">&lt;p&gt;Ruby on Rails is a powerful web application framework that makes it easy to build modern web applications. In this post, we’ll explore the basics of getting started with Rails.&lt;/p&gt;

&lt;h2 id=&quot;why-rails&quot;&gt;Why Rails?&lt;/h2&gt;

&lt;p&gt;Rails follows the “convention over configuration” principle, which means you can get started quickly without spending hours configuring your application.&lt;/p&gt;

&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;

&lt;p&gt;To install Rails, you’ll need Ruby installed on your system. Then, simply run:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;rails
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;creating-your-first-app&quot;&gt;Creating Your First App&lt;/h2&gt;

&lt;p&gt;Create a new Rails application with:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rails new my_app
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;my_app
rails server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And that’s it! Your Rails application is now running on &lt;code class=&quot;highlighter-rouge&quot;&gt;http://localhost:3000&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;next-steps&quot;&gt;Next Steps&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Learn about MVC architecture&lt;/li&gt;
  &lt;li&gt;Explore Rails routing&lt;/li&gt;
  &lt;li&gt;Build your first model&lt;/li&gt;
  &lt;li&gt;Create views and controllers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rails makes web development enjoyable and productive. Happy coding!&lt;/p&gt;</content><author><name></name></author></entry></feed>