teleren/devto huggingface dataset:
Latest Newsletter: Money, Movies, Kindness, Elon and Barack (Issue #140)
Tags: javascript, tech, webdev, discuss
Published: 2023-11-11 05:56:43

---
title: Latest Newsletter: Money, Movies, Kindness, Elon and Barack (Issue #140)
published: true
description: Great mix this week. It’s the intersection of tech, AI and humanity and all the things good and bad that connect us. There’s a weird zen balance to it all.
tags: javascript, tech, webdev, discuss
---

Money, Movies, Kindness, Elon and Barack (Issue #140)

Great mix this week. It’s the intersection of tech, AI and humanity and all the things good and bad that connect us. There’s a weird zen balance to it all.

https://markjgsmith.substack.com/p/mark-smiths-newsletter-10-11-2023

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Starting of your programming life
Published: 2023-11-11 05:52:40

🚀 Share Your Coding Journey! 🌐

Hey amazing Dev community! 👋 I'm curious to hear about everyone's coding journey. Whether you're a seasoned developer or just started, your story can inspire others who are on their coding adventure. 🚀

How did you first get into coding? 🤔

Did a specific event or experience trigger your interest?
What was your first programming language? 💻

Share your initial coding language and why you chose it.
Any challenges you faced? How did you overcome them? 🛠️

Learning to code comes with its own set of challenges. Share your experiences and tips for overcoming hurdles.
Favorite resources or learning platforms? 📚

Whether it's online courses, books, or interactive platforms, what resources helped you the most?
Memorable projects or achievements? 🏆

Tell us about a project or achievement that you're proud of.
Advice for beginners? 🌱

What advice would you give to someone who is just starting their coding journey?
Feel free to share your story and tag anyone you think would love to join the conversation! Let's build a supportive and inspiring community. 💙
RAG vs SELF-RAG
Tags: rag, llm, hugginface, selfrag
Published: 2023-11-11 05:41:42

What RAG does is, btw RAG is rigid in how it considers retrieving the information in order to generate context using some sort of document similarity algorithm. So, 😊 RAG will retrieve information even if it doesn’t have to do it. It immediately assumes the LLM lacks learnt embeddings to make sense of a prompt by the user and that’s why it first generates features from a domain specific corpus and adds it as context to the LLM prompt without considering the LLM might have the most relevant context in the first place (Obviously, this is an implementation detail that as Self-RAG attempts to address). How do we ask the LLM this question before tuning its response with an external source? Inasmuch as RAG is a good way to add relevance to LLMs especially using enterprise data, augmenting RAG with the intelligence to know when to retrieve or not will reduce the impact of verbiage output. Unlike a widely adopted Retrieval-Augmented Generation approach, Self-RAG retrieves on demand and criticize its own generation.
⭐️✨IWIN68 luôn đề cao những giá trị cốt lõi mà hệ thống có thể đem lại cho người chơi và cộng đồng. 💯
Published: 2023-11-11 05:18:34


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m0gs8nfuksaxdnjlkoty.jpg)

🏆 IWIN68 là nền tảng cá cược trực tuyến đang vô cùng thịnh hành trên thị trường hiện nay. 
🎁 Cổng game luôn được đánh giá cao về sự chất lượng, tính chuyên nghiệp và minh bạch. 
🌐 Web: [https://taigameiwin68.com/ve-chung-toi/](https://taigameiwin68.com/ve-chung-toi/)
🌐 Fanpage: [https://www.facebook.com/taigameiwin68com](https://www.facebook.com/taigameiwin68com)

Link mạng xã hội:
✅ [https://www.facebook.com/taigameiwin68com1/](https://www.facebook.com/taigameiwin68com1/)
✅ [https://twitter.com/taigameiwin68co](https://twitter.com/taigameiwin68co)
✅ [https://www.pinterest.ph/taigameiwin68com/](https://www.pinterest.ph/taigameiwin68com/)
✅ [https://500px.com/p/taigameiwin68com?view=photos](https://500px.com/p/taigameiwin68com?view=photos)
✅ [https://www.flickr.com/people/199478588@N06/](https://www.flickr.com/people/199478588@N06/)
✅ [https://www.youtube.com/channel/UCoDbr4v0Ck9kU03l0KZibRQ](https://www.youtube.com/channel/UCoDbr4v0Ck9kU03l0KZibRQ)
✅ [https://www.reddit.com/user/taigameiwin68com/](https://www.reddit.com/user/taigameiwin68com/)
✅ [https://www.blogger.com/profile/15498035188056712010](https://www.blogger.com/profile/15498035188056712010)
✅ [https://taigameiwin68com.blogspot.com/2023/11/iwin68-taigameiwin68com.html](https://taigameiwin68com.blogspot.com/2023/11/iwin68-taigameiwin68com.html)
✅ [https://www.tumblr.com/taigameiwin68com](https://www.tumblr.com/taigameiwin68com)
✅ [https://bbs.now.qq.com/home.php?mod=space&uid=6029907](https://bbs.now.qq.com/home.php?mod=space&uid=6029907)
📌 Address: 35 Ngách 194/7 Phố Thanh Đàm, Thanh Trì, Hai Bà Trưng, Hà Nội 100000, Việt Nam
☎️ Phone numbe: +639064407863
💌 Email: taigameiwin68com@gmail.com
#taigameiwin68com #taiiwin68
Complete Introduction to WebSerial API
Tags: javascript, webserial, googlechrome, tutorial
Published: 2023-11-11 05:12:19

# Introduction

Web Serial API is a new paradigm for fetching data from a USB or Serial Interface directly into the Website/Web app via JavaScript!

# Compatibility

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0mzto6i771amnc1egzoo.png)

# Tutorial

1. Connect your serial device which transmits serial data (eg. ESP8266)

2. Request access from the user

```js
const port = await navigator.serial.requestPort()
```

This code will open up a pop-up where the user can give you the permission for the appropriate device.

Note that this only needs to be done once until the user manually removes the access to the port


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aj2ty4pz4mgt9nhusxw9.png)

3. Get list of all the available ports

```js
const ports =  await navigator.serial.getPorts()
// returns a list of ports
```

4. Read data from the port

```js
async function readSerial(port) {
  while (port.readable) {
    const reader = port.readable.getReader();
    try {
      for await (const { value, done } of reader) {
        if (done) {
          // |reader| has been canceled.
          break;
        }
        // Do something with |value|...
      }
    } catch (error) {
      // Handle |error|...
    } finally {
      reader.releaseLock();
    }
  }
}
```

5. BONUS Tip

You can also add a LineBreakTransformer since most devices emit line by line data, which can significantly streamline your workflow

```js
// LineBreakTransformer.js
class LineBreakTransformer {
  constructor() {
    // A container for holding stream data until a new line.
    this.container = "";
  }

  transform(chunk, controller) {
    // Handle incoming chunk
    this.container += chunk;
    const lines = this.container.split("\r\n");
    this.container = lines.pop();
    lines.forEach((line) => controller.enqueue(line));
  }

  flush(controller) {
    // Flush the stream.
    controller.enqueue(this.container);
  }
}

export default LineBreakTransformer;
```

And then use this in your code

```js
const decoder = new TextDecoderStream();
port.readable.pipeTo(decoder.writable);
const inputStream = decoder.readable.pipeThrough(
  new TransformStream(new LineBreakTransformer())
);
console.log(inputStream, "INPUT STREAM");
const reader = inputStream.getReader();

async function readSerial(port) {
  while (port.readable) {
    try {
      for await (const { value, done } of reader) {
        if (done) {
          // |reader| has been canceled.
          break;
        }
        // Do something with |value|...
      }
    } catch (error) {
      // Handle |error|...
    } finally {
      reader.releaseLock();
    }
  }
}
```
PyInstaller + FastAPI
Tags: pyinstaller, fastapi, uvicorn, reload
Published: 2023-11-11 05:01:42

I have created a simple FastAPI Project.

`from fastapi import FastAPI

app = FastAPI()


@app.get("/")
async def home():
    return {"success": True}`

After that I am compile it using PyInstaller inside binary folder called app.

How can I run this binary using uvicorn ASGI server ?

Previously i was using uvicorn to run server inside binary file, it was running fine but the issue was it was not running in Reload Mode, I need to set reload = False to run.

Anyway I just want to create a fastapi binary that can be run with reload = True.
PyTest unit testing now underway
Tags: python, opensource, pytest, todayilearned
Published: 2023-11-11 04:56:25

I have now added some testing to my [ez-txt2html converter](https://github.com/bryce-seefieldt/ez-txt2html).

I decided to use [pytest](https://pypi.org/project/pytest/) as framework for running tests on this project.  It seems like a popular choice for many Python developers. As I built tests I also took advantage of some of the tools available in the built-in Python module unittest.  It’s `mock()` function provides some helpful ways of providing mock data in order to run tests on certain functions independently, hard coding variables from calling functions.

Pytest was an easy install, simple as `pip install pytest` and running it had a reasonable learning curve. I wrote test (.py) files in my src directory alongside my main module files, running them simply with CLI prompt `pytest test_file.py` and responding to any errors or warnings at runtime. I have some work to do to further refine my directory structure, but for now for simplicity on a small program, this was my cleanest approach.

The real work came from thinking through the types of tests needed for various processes and functions. There are a huge amount of variables and outcomes to think through. I found that searching testing examples that involve similar input/output types, common intention or have similar file and code structure is a good way to think of what some of the priority types of tests are. Ultimately it really does take a great deal of prioritization before jumping too heavily into the code.
In writing tests, I learned a lot about how isolate individual functions, and some of the more in-depth python theory around modularity.  Thinking about a function being called and receiving explicit parameters when isolated from the main program, causes one to look at how certain functions can be designed differently.  Also thinking about how you can assert outcomes that fulfill a tests purpose can be very difficult, especially when a function may interact with global variables or doesn’t return an objector variable? 

While creating tests for functions involved in reading from file and converting text content to html, I was able to take a much more detailed look at the related algorithms and identify some output formatting inconsistencies. That would have been difficult to identify were I not going through the individual functions and trying to define what the expected output format should be.  the biggest realization about writing tests was how important it is to understand and be able to exactly define the expected outcome/output of a program or function is, was probably the biggest realization about writing test.

Working with test suites, as with many additions relating to accommodating future development and contributions, really causes you to reassess and tidy things like file structure, naming conventions, modularity and so on. I've struggled to a degree with various environment configuration and path related challenges while trying to integrate more new tools, techniques, and workflows. It's a challenge but it's rewarding when you work through it.
I see this MEME and i do that
Tags: javascript, html, animation, webdev
Published: 2023-11-11 04:40:54

I see this MEME and i do that

MEME: https://www.reddit.com/r/funny/comments/14uk5wa/graphic_designers_vs_programmers/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8qdvx4ae2jcx8deo6y83.gif)

Github: https://github.com/songtuyen97/MEME-Dark-mode-switch
Steps for Creating a Simple Amazon MQ Instance in AWS Console and Publishing Messages to it.
Tags: aws, amazonmq, messagebroker, managedservice
Published: 2023-11-11 04:30:49

In this article I am going to describe how you can get started with **AmazonMQ in AWS**. AmazonMQ offers two favors of Message Brokers, **ActiveMQ and RabbitMQ** flavors for you to choose from depending on your use case. 

In this article we will be focusing mainly on RabbitMQ as a message broker.

_Lets begin..._

1. Navigate to **AmazonMQ** section in your AWS console.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sddtb0xivwo6xnwdqmhi.PNG)

2. Choose the **RabbitMQ **option

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vv6u2vmp0i0ckdxgfdcz.PNG)

3. Select **Non-Cluster mode** since this is for the article. _For production use case you might want to use cluster mode or non-cluster mode depending on the business problem you are trying to solve._

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k8mpr7k6s936npih5kem.PNG)

4. Specify the **Broker name**, select the broker **instance size** and the **username and password** that you will use to log into the RabbitMQ instance later.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e62fcxsnt3xy199efduc.PNG)

5. Click Next, Next and Complete the process and that will create the Broker for you. _Broker creation process could take upto 10 - 15 minutes._

6. Once the Broker is created and up and running. go to Broker details page's **Connection** section and **copy the RabbitMQ web console URL.**

Navigate to the RabbitMQ web console URL in a browser window and login using the credentials you gave during the Broker creation.
Once successfully logged into to RabbitMQ console. Navigate to **Queues section** and create a new queue names **demo-queue**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljcs1ft3qlan0ia6gx07.PNG) 

7. Go into the details of the newly created queue named **demo-queue** and now you can **publish message** to the queue. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0lyulqrtgu29uvzsdf8g.PNG)

When you create and integrate the subscribers to the message queue then they will receive and process messages as and when you publish messages.

**_In the next article I will cover how you can integrate the AmazonMQ's RabbitMQ blocker with Serverless Lambda functions and how you can manage credentials in a secure manner._**
CodePenChallenge-Sticky Navigation
Tags: codepen
Published: 2023-11-11 04:13:57

<p>This pen work relates to #codepenchallenge which features a “sticky” navigation. It basically shows a sticky navigation bar that allows users to click on each nav's menu with their following page and also has some cool animation while scrolling on page.</p>

{% codepen https://codepen.io/nilimadas/pen/mdapRmY %}
CodePenChallenge-Navigations Bars
Tags: codepen
Published: 2023-11-11 04:12:44

<p>This pen work relates to #codepenchallenge which features a Navigational sidebar.  It basically shows a sidebar navigational menu that allows users to click and hover on each tabs menu with their following page.</p>

{% codepen https://codepen.io/nilimadas/pen/vYvmZde %}
CodePenChallenge-Responsive Sidebar Navigation
Tags: codepen
Published: 2023-11-11 04:11:45

<p>This pen work relates to #codepenchallenge which features a Navigational sidebar.  It basically shows a sidebar navigational menu that allows users to click on each tab's menu with their following page and also has hamburger icon that allows maximize / minimize sidebar menu.</p>

{% codepen https://codepen.io/nilimadas/pen/eYbRNVK %}
CodePenChallenge-Responsive Complex Navigation
Tags: codepen
Published: 2023-11-11 04:11:17

<p>This pen work relates to #codepenchallenge which features a  Responsive complex navigation. It basically allows user to view menu option as horizontally or vertically. The design is made by css framework (Bootstrap), so it handle the navigation across different screen sizes and devices.</p>

{% codepen https://codepen.io/nilimadas/pen/BavrMKZ %}
CodePenChallenge- Parallax Trick or Treat
Tags: codepen
Published: 2023-11-11 04:10:46

<p>This pen work relates to #codepenchallenge which features a parallax Trick or Treat animated design. Also,  try a random chance of getting either a trick or treat when the trick or treat button is clicked. </p>

{% codepen https://codepen.io/nilimadas/pen/dywxgZw %}
CodePenChallenge: Bento Style
Tags: codepen
Published: 2023-11-11 04:10:00

<p>This pen work relates to #codepenchallenge which features a responsive bento turning this raw HTML into a tasty bento is creating the containers! In bento design, rectangles with rounded corners are the usual recipe for the compartments, but mix them up with different shapes. </p>

{% codepen https://codepen.io/nilimadas/pen/gOqgGwB %}
Testing Journey with Text2page: A Developer's Perspective
Tags: testing, development, opensource, python
Published: 2023-11-11 04:01:40

The incorporation of test-driven development (TDD) into Text2page development has added a new level of maturity to the project. The purpose of this blog article is to explain the newly added functionality, the unittest framework selection, the testing procedure, and the insightful lessons discovered throughout this testing journey.

**Features Implemented**

1. Sturdy HTML Creation
Text2page's primary role is to transform Markdown and plain text files into beautiful HTML pages with ease. The latest improvements guarantee stable HTML creation that supports several input types.

2. Examining the output in HTML
A full set of tests has been implemented to ensure the accuracy of the HTML output. Carefully examining every step of the HTML creation process helps to detect regressions and guarantee Text2page reliability.


**Choice of Testing Framework**

Accepting Unit Testing
Because of its strong set of testing features and natural connection with Python, the unittest framework was selected in the search for an efficient testing approach. The choice is consistent with the project's dedication to compatibility and simplicity.

**Procedure for Testing Test Suite Extension**

- The testing suite now includes more tests for important Text2page functionalities. This comprises:
- Ensuring precise Markdown to HTML translation is known as HTML Content Parsing.
- File Type Recognition: Checking if the programmer can process different kinds of input files

**Uncovered Bugs and Edge Cases**

The testing procedure revealed flaws and edge cases, proving the value of a methodical testing strategy in identifying possible dangers.

**In summary**

An important step has been accomplished with the incorporation of test-driven development into Text2page. The dedication to testing guarantees the project's resilience and flexibility to upcoming difficulties as it develops further.

We appreciate you participating in this examination of the Text2page testing environment. I hope your code is resilient and your tests are green!
Using ArgoCD Image Updater with ECR
Published: 2023-11-11 03:26:11

We may want the updater to trigger a deployment when an image is pushed to ECR. 

We install the updater in our cluster using terraform. 

```
resource "helm_release" "image_updater" {
  name       = "argocd-image-updater"
  repository = "https://argoproj.github.io/argo-helm"
  chart      = "argocd-image-updater"
  namespace  = "argocd"

  values = [
    <<EOF
config:
  registries:
    - name: ECR
      api_url: https://XXX.dkr.ecr.eu-west-1.amazonaws.com
      prefix: XXX.dkr.ecr.eu-west-1.amazonaws.com
      ping: yes
      insecure: no
      credentials: ext:/scripts/ecr-login.sh
      credsexpire: 9h
authScripts:
  enabled: true
  scripts:
    ecr-login.sh: |
      #!/bin/sh
      aws ecr --region eu-west-1 get-authorization-token --output text --query 'authorizationData[].authorizationToken' | base64 -d
EOF
  ]
}
```

We authenticate to ECR using ecr-login.sh. The EKS nodes need to have ECR permissions.

We add these annotations to our ArgoCD application.

```
  annotations:
    argocd-image-updater.argoproj.io/image-list: repo=XXX.dkr.ecr.eu-west-1.amazonaws.com/prod-references
    argocd-image-updater.argoproj.io/repo.update-strategy: latest
```

To troubleshooot, we can log in to the argocd container.

`kubectl exec -n argocd -it argocd-image-updater-7fc87697d5-qtnhn -- ash`

Test the connection to ECR.

`argocd-image-updater test XXX.dkr.ecr.eu-west-1.amazonaws.com/prod-references --credentials ext:/scripts/ecr-login.sh --update-strategy latest`

Trigger a deploymemnt.

`argocd-image-updater run --once --loglevel trace --argocd-namespace argocd  --metrics-port 0`
From e-banking 2 secure hardware
Published: 2023-11-11 02:42:39

We moved into hardware a few years ago, to have a serious shot at affecting security. The all in one edge to cloud device that allows us to work securely.
Only we decided that we’d make it difficult and make it high performance to deliver cloud better.
3.5years later, it takes longer than you think. We have our MVP, testing soon with Scotland 5G as we have an integrated private 5G capability.
Not just all in one, plug and play also.
Believe we have cracked definitive person and place entry.
This could be the No1 Home-working or Hybrid solution, idiot proof system that doesn’t require engineering install or staff security training.
Would like to find a friendly company or two to get some case studies and iterations done before launch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d49jpdbw0ntkoo3x94ll.jpeg)
Hosting index.html with HTTPS using Docker and Nginx
Tags: docker, nginx, web
Published: 2023-11-11 02:26:45

1) Pull nginx image
`docker image pull nginx`

2) Create nginx container
`docker container run -d -p 443:443 --name mynginx nginx`

3) Enter the container
`docker container exec -it mynginx bash`

4) Create the private key and certificate
`mkdir /etc/nginx/ssl`

private key
`openssl genrsa -out /etc/nginx/ssl/server.key 2048`

Certificate Signing Request (CSR)
you can skip through by pressing the Enter key for each prompt
`openssl req -new -key /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.csr`

SSL server certificate (CRT)
`openssl x509 -days 3650 -req -signkey /etc/nginx/ssl/server.key -in /etc/nginx/ssl/server.csr -out /etc/nginx/ssl/server.crt
`

5) Edit the Nginx configuration file
`vi /etc/nginx/conf.d/ssl.conf`

```
server {
    listen 443 default ssl;
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    ssl_certificate     /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
}
```

6) Reload the Nginx configuration
`service nginx reload`

7) Access the following URL
<u>https://container-IP/</u>
How to Create Tools on WordPress and Blogger
Tags: webdev, javascript, programming, beginners
Published: 2023-11-11 02:26:01


![Create Tools on WordPress and Blogger](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4xsn708r1jnsvp8sav5.jpg)

## 🛠 Unlock the Power of Tools for Your Website! 🚀

Hey there, tech enthusiasts! 👋 I'm excited to share a treasure trove of tools that I've created to supercharge your websites. 🌐💡 Whether you're a blogger, entrepreneur, or just someone who loves tech, these tools are designed to make your online journey smoother and more interactive.

Discover the heart and soul behind these creations on our [YouTube channel](https://youtube.com/@TechInfact), where we guide you through seamlessly integrating these tools into your website.

Ready to transform your website into an emotional and functional masterpiece? Explore [Tools ](https://techinfact.com/tools/)and let the magic begin!

The best part? Anyone, yes, even those without a tech background, can follow along and implement these tools after watching the videos. Let's turn your website into a powerhouse of innovation! 💪💻

We value your input! Have suggestions to make these tools even more enchanting? Drop us your thoughts in comment. Your feedback fuels the magic!

Feel free to personalize the message further if needed!