teleren/devto huggingface dataset:
Currency to number transformation in JavaScript
Tags: webdev, javascript, tutorial, programming
Published: 2023-11-06 21:28:16

Dealing with monetary values of different currencies is undoubtedly a big challenge, especially when you don't know the type of currency you will need to deal with. This is why [**currency-to-float**](https://www.npmjs.com/package/currency-to-float) was created, a tiny JavaScript library.

With this, you can easily transform currency strings into numeric values regardless of the currency format. It is a versatile tool that simplifies your financial and web development projects.

## Example

Here's how straightforward it is to use `currency-to-float`:

```ts
import currencyToFloat from 'currency-to-float';

// Sample array of expenses in USD
const expenses = ['$12.50 USD', '$8.75 USD', '$20 USD', '$15.25 USD'];

// Sum the expenses
const totalExpense = expenses.reduce(
  (acc, expense) => acc + currencyToFloat(expense),
  0
);

console.log(totalExpense); // Output: 56.5
```

In this example, we have an array of expenses in US dollars. By leveraging `currencyToFloat` function, we convert each expense string to a numeric value and calculate the total using the `reduce` function.

## Supported Currencies

| Currency                    |    Locale    |    Example    |
| --------------------------- | :----------: | :-----------: |
| US Dollar ($, USD)          |    en-US     |  $12.50 USD   |
| Brazilian Real (R$, BRL)    |    pt-BR     |   R$ 12,50    |
| Canadian Dollar ($, CAD)    |    en-CA     |  $12.50 CAD   |
| Canadian Dollar ($, CAD)    |    fr-CA     |  12,50 $ CAD  |
| Australian Dollar ($, AUD)  |    en-AU     |  $12.50 AUD   |
| Euro (€, EUR)               | de-DE, fr-FR |  12,50 € EUR  |
| Euro (€, EUR)               |    en-IE     |  €12.50 EUR   |
| Euro (€, EUR)               |    nl-NL     |  €12,50 EUR   |
| British Pounds (£, GBP)     |    en-GB     |  £12.50 GBP   |
| Japanese Yen (¥, JPY)       |    ja-JP     |   ¥1250 JPY   |
| New Zealand Dollar ($, NZD) |    en-NZ     |  $12.50 NZD   |
| Hong Kong Dollar ($, HKD)   |    zh-HK     |  $12.50 HKD   |
| Singapore Dollar ($, SGD)   |    zh-SG     |  $12.50 SGD   |
| Danish Krone (Kr, DKK)      |    da-DK     | 12,50 kr. DKK |

## Installation

```sh
npm install currency-to-float
```

## Useful links

GitHub: https://github.com/mateus4k/currency-to-float
TIL 11/6
Published: 2023-11-06 21:21:35

Today I was working on HTML and CSS on Codeacademy. I have been learning HTML and CSS since August in a course through City Colleges of Chicago, but I still learned a lot today. I knew most of the information about HTML and CSS basics, but the course helped me to understand flex boxes and grid displays better. I will definitely be using what I learned in my assignments and career going forward!
IDs vs Classes in HTML
Tags: webdev, html, css, beginners
Published: 2023-11-06 21:12:39

**INTRODUCTION**

IDs and classes can be confusing especially to new developers and I have to admit when I first got into coding I didn't know which to use. I made this guide to help web developers struggling to grasp this.

**WHAT IS AN ID?
**
An ID is a unique identifier that can be used only once in a HTML file.

```
<div id="id-name">

Content

</div>
```

**WHAT IS A CLASS?**

A class can be used as many times as you want in a HTML file.

```
<div id="id">
    <div class="class-name">
    </div>

    <div class="class-name">
    </div>

    <div class="class-name">
    </div>
</div>

```
**DIFFERENCE BETWEEN AN ID AND A CLASS**

Let's say we have a project named portfolio, this project has three HTML files :

Index.html

Web.html

About.html

Each HTML file can only use a particular ID once but a class many times. If you want to use a particular style with the name "class-name" in a HTML file more than one time then a class is most suitable but if it's only going to be used once then an ID is for you.

I hope this article was able to help you understand the difference, comment if you have any question concerning this.
Setup Node with Typescript and eslint
Tags: node, webdev, react, typescript
Published: 2023-11-06 21:08:46

- Create an empty directory for your project and move in it.
```
mkdir project
cd project
```

- Initialize npm
```
npm init -y
```

- Install typescript as a dev dependency.
```
npm i -D typescript
```

- Create a typescript config file
```
npx tsc --init
```
> the D flag installs it as a dev dependency


- Install express (dependency) and it's types (dev dependency)

```
npm i express
npm i -D @types/express
```

- Create a src folder and create a new file 'index.ts' and copy the following code.

```
import express from "express";

const app = express();

app.get("/", (req, res) => {
    res.send("Hello World");
});

app.listen(5000, () => {
    console.log("server started");
});
```

- Open tsconfig.json and find "outDir", uncomment it, and update its value to dist

```
"outDir": "./dist"
```

- Install nodemon (dev dependency)

```
npm i -D nodemon
```

- Install ts-node (dev dependency)
```
npm i -D ts-node
```

- Open package.json
update main to be
```
"main": "dist/index.js"
```
and add the following under scripts
```
"start": "nodemon src/index.ts"
```

- Install eslint (dev dependency)
```
npm i -D eslint
```

- Create a eslint config file
```
npx eslint --init
```
> Choose all the config from the prompt

- Add lint to script in package.json
```
"lint": "eslint . --ext .ts"
```
Open-Source-Gaming-Tournament
Tags: opensource, gaming, beginners
Published: 2023-11-06 21:00:16

### 🎮 Open Source Gaming Tournament! 🎮
Play and support Open-Source Games!


#### 🚀 Highlights:

- Open to gamers of all levels.
- Play SuperTuxKart's high-speed racing and 0 A.D.'s strategic warfare.
- Open prize pool in Bitcoin
- Prizes split between winners and game developers.


#### 🏆 How to Participate:

**Register now: [[open-source-gaming-tournament.com](https://open-source-gaming-tournament.com/)]**

Choose your game, show your skills, and compete.
Win awesome prizes and help fund the future of open source gaming.

Join us and let’s game together! 🎉💰🕹️

 #OpenSourceGamingTournament #SuperTuxKart #0AD #Linux #Open-Source
Can't override default mat-step-header tabindex behavior
Tags: stepper, discuss, help, codenewbie
Published: 2023-11-06 20:54:53

I'm trying to make all mat-step-header elements keyboard focusable in a stepper component I'm working on. By default, the first item in the tabbing order is set to tabindex="0," whereas the remaining items are always set to -1 by default. Setting all tabindexes to 0 would allow the descriptive text for these elements to be announced to screen readers (which is the desired behavior I'm trying to establish).

I've tried creating a function that iterates through the headers and resets the index, as well as changing the attribute's value in the html, with no success. I've also tried modifying the selectedIndex and editable properties in the html. Changing the selectedIndex property only seems to affect the first mat-step-header element in the tablist. The editable property also seems to be unrelated to the tabindex.

How can I programmatically set all tabindexes to 0?

Source code (first example):
https://v5.material.angular.io/components/stepper/overview
Algorithm question: reversing string with special characters
Published: 2023-11-06 20:50:34

Given a string, that contains special character together with alphabets (‘a’ to ‘z’ and ‘A’ to ‘Z’), reverse the string such a way that special characters are not affected.

Example
input "abc-defg" return "gfe-dcba"

```java
String reverse(String input) {
    Stack<Character> result = new Stack<>();
    StringBuilder result2 = new StringBuilder();
    char[] in = input.toCharArray();
    for (char c : in) {
        if (Character.isLetter(c)) {
            result.push(c);
        }
    }
    for (char c : in) {
        if (Character.isLetter(c)) {
            result2.append(result.pop());
        } else {
            result2.append(c);
        }
    }

    return result2.toString();
}
```
My first post
Published: 2023-11-06 20:34:54

I think I’m starting this course later than everyone else. Today I completed some of the set up tasks and watched the intro video. I learned about Ruby and cloud based coding. I’ve also learned about some of the things we will be using in class, such as GitHub and dev. I’m feeling very inexperienced and overwhelmed, but I’m determined to keep going because I think this is something I’ll enjoy and be good at.
Raku Blog Posts 2023.45
Tags: programming, rakulang, summary
Published: 2023-11-06 19:29:21

- [Publishing Raku Modules](https://dev.to/tbrowder/publishing-raku-modules-1onk/)

*Tom Browder* has written an introduction on how you can add modules to the Raku ecosystem.

- [2023 Raku Conference Videos](https://www.youtube.com/playlist?list=PL_OYHwbArcGiEhE2kIuoUK35N7gQQwMIj)

Although not strictly blog posts, these presentations are most likely of interest to you as well!

- [Rakudo Weekly News 2023.45](https://rakudoweekly.blog/2023/11/06/2023-45-confvids/)

*Elizabeth Mattijsen* reports on all recent developments around Rakudo, an implementation of the [Raku Programming Language](https://raku.org).
TIL: exclude_also with coverage.py
Tags: python, todayilearned, coverage, coveragepy
Published: 2023-11-06 20:05:55

Sometimes you have code you want to exclude from the test coverage report, because it doesn't really make sense to test it.

For example, maybe you want to exclude:

```python
if __name__ == "__main__":
    main()
```

The _old_ advice was to add something like this to `.coveragerc`:

```ini
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
    # Have to re-enable the standard pragma:
    pragma: no cover

    # Don't complain if non-runnable code isn't run:
    if __name__ == .__main__.:
```

But since [coverage.py 7.2.0 (2023-02-22)](https://coverage.readthedocs.io/en/7.3.2/changes.html#version-7-2-0-2023-02-22) you can use `exclude_also` instead and skip that pragma:


```ini
[report]
# Regexes for lines to exclude from consideration
exclude_also =
    # Don't complain if non-runnable code isn't run:
    if __name__ == .__main__.:
```

Which is:

```diff
 [report]
 # Regexes for lines to exclude from consideration
-exclude_lines =
-    # Have to re-enable the standard pragma:
-    pragma: no cover
-
+exclude_also =
     # Don't complain if non-runnable code isn't run:
     if __name__ == .__main__.:
```

## Thanks

To [Brian Okken](https://mastodon.social/@brianokken@fosstodon.org/111360201593749157) for the tip.

To [Ned Batchelder](https://nedbatchelder.com/) for maintaining [Coverage.py](https://coverage.readthedocs.io).

To the Library of Congress and Flickr Commons for the photo of a [covered wagon](https://www.flickr.com/photos/library_of_congress/52303625278/).
OpenAI Whisper new model Large V3 just released and amazing
Tags: ai, whisper, openai, news
Published: 2023-11-06 20:01:49

Whisper made huge impact on the open source AI world

I am using everyday to transcribe my videos with that

I was waiting new Large model

Whisper is much better than paid alternatives and it is 100% free

Here my full tutorial about it

[How to do Free Speech-to-Text Transcription Better Than Google Premium API with OpenAI Whisper Model](https://youtu.be/msj3wuYf3d8?si=c5M6mFzQIj6fJRou)

{% embed https://youtu.be/msj3wuYf3d8?si=c5M6mFzQIj6fJRou %}


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jow5heds308isodr93yt.png)
How to Build a CI/CD Pipeline for Your Database
Tags: digitalocean, github, kubernetes, terraform
Published: 2023-12-26 15:16:09

---
title: How to Build a CI/CD Pipeline for Your Database
published: true
date: 2023-11-06 19:49:27 UTC
tags: DigitalOcean,github,kubernetes,Terraform
canonical_url: https://blog.shellnetsecurity.com/2023/11/660/terraform/how-to-build-a-ci-cd-pipeline-for-your-database/
---

I thought that it would be a good idea to do a quick blog post on how to build a ci/cd database pipeline. If you’ve been following my blog, you know that I’ve done quite a bit of tinkering with various automation tools. One thing that I’ve found is that automation helps to relieve me ... [Read more](https://blog.shellnetsecurity.com/2023/11/660/terraform/how-to-build-a-ci-cd-pipeline-for-your-database/ "How to Build a CI/CD Pipeline for Your Database")

The post [How to Build a CI/CD Pipeline for Your Database](https://blog.shellnetsecurity.com/2023/11/660/terraform/how-to-build-a-ci-cd-pipeline-for-your-database/) appeared first on [My Battles With Technology](https://blog.shellnetsecurity.com).
3 amazing websites to learn Python Programming for free
Tags: webdev, python, programming
Published: 2023-11-06 18:52:22

So, many of us (including me) wanted or want to learn python. But don't know where to get started from. Whether to become a Data Scientist or an Ethical Hacker, python is a very popular language for such career line. And to learn it is not necessary to take or buy online courses until and unless you also want proper guidance and an experienced mentor. We can learn many things for free online just like python. So 3 amazing websites to learn python for free are:-

1. **YouTube** :- A very open and one of the most used platform around the world. This is the first and the very best platform to start learning anything from. Be it designing, programming, gaming, development, learning, educating etc. Everyone knows about YouTube and uses it, but not everyone knows how to use it properly or just don't use it in an efficient way. YouTube channels such as  Coders Camp and many such other YouTube channel provide free python courses, with projects and tutorials. So to start with basics it is the best platform to learn from.

2. **Programiz** :- Programiz is a website where you can literally learn almost every programming languages for free. It provides free tutorials and teachings for free but only for a limited time, after that you get to pay for subscription. But you also get a space to practice to learn to code and many more.

3. **GeekforGeeks** :-  A platform to learn literally any technology trends and terms. From Python to C++, Ethical Hacking to Machine Learning, Data Science to Artificial Intelligence, everything is available to learn for free, also you can get the premium version for even  better experience in learning and can get a space for hosting websites.


Thank-you so much for reading(if you did so).

Written by: Kanika S
Appwrite dev setup in windows(using WSL)
Tags: wsl, appwrite, windows, webdev
Published: 2023-11-06 18:52:10

1. Enable WSL in Windows
2. Install Ubuntu from Microsoft store.
3. Install PHP 8.
4. Install docker with docker compose.
5. Clone the appwrite repo.
6. Initialize sub git modules.
7. Download composer.
8. Install Unzip for ubuntu and PHP unzip extension.
9. Run `compose install --ignore-platform-reqs --optimize-autoloader --no-plugins --no-scripts` command.
10. `docker compose up -d`


Don't hesitate to contact me for any queries regarding the setup https://www.linkedin.com/in/akash-kola
New Android Version!!
Published: 2023-11-06 18:50:22

Hi Guys, 
By the title, I told you there is a new Android version, Android 14! Now I know you are excited and I have the links, here they are!

For Pixel: https://www.android.com/

iOS Emulator Android:  https://download.imyfone.com/mirrorto-lite_setup.exe

Thank You! 

Gmail
Guia de Eletrônicos da Amazon para 2024: Alto-Falantes, Câmeras, Kindle, Echo e Mais
Tags: notícias, amazon, kindle
Published: 2023-11-06 20:10:23

---
title: Guia de Eletrônicos da Amazon para 2024: Alto-Falantes, Câmeras, Kindle, Echo e Mais
published: true
date: 2023-11-06 18:50:07 UTC
tags: Notícias,AMAZON,Kindle
canonical_url: https://astronautsdevelopers.com/guia-de-eletronicos-da-amazon-alto-falantes-cameras-kindle-echo-e-mais/
---

A Amazon é um gigante do varejo online, oferecendo uma ampla variedade de produtos eletrônicos, desde alto-falantes e câmeras até leitores de e-books e dispositivos inteligentes. Com tantas opções disponíveis, pode ser difícil saber por onde começar. Neste guia, vamos apresentar alguns dos melhores eletrônicos da Amazon para 2024, ajudando você a encontrar os produtos...

https://astronautsdevelopers.com/guia-de-eletronicos-da-amazon-alto-falantes-cameras-kindle-echo-e-mais/
Data ethics in AI 🤖
Tags: discuss, community
Published: 2023-11-06 18:44:31

I'm currently reading about data ethics in AI and I'm coming to the conclusion that black men and black women are at a disadvantage. Data bias is significant and has been prevalent for various reasons, likely to persist for a long time.
What are your thoughts on this? Should we use biased systems that essentially dictate our lives, knowing about this issue? Do you think we can control or mitigate this? 
I'm curious to hear your opinion. 🤔
Open source file sharing!
Tags: webrtc, react, webdev, productivity
Published: 2023-11-06 18:42:13

If you want to share files fast, without any size limit - welcome!

I wanted to share with you a cool project I was working on:

## My-folder-online

> Limitless peer-to-peer file sharing

Some of it's cool features:
- Peer-to-peer sharing (for privacy) 🫣
- High speed (using WebRTC) ⚡️
- Directory sharing (share a whole directory) 📁
- PWA (installable webapp) 📱
- FileSystem API (no zip files needed for directory download) 🗂️

https://my-folder-online.vercel.app/

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


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

Leveraging WebRTC technology, MyFolderOnline facilitates lightning-fast file transfers, enabling hassle-free sharing of large files and directories. Say goodbye to tedious upload/download processes and enjoy a seamless sharing experience.

<be />
If you think this project is cool, please star it on GitHub :)

https://github.com/ido-pluto/my-folder-online

### What next?
- Improve leading page
- Preview of files
- Support for mobile file sharing

<br/><br/>

What do you think you can do with this?
Do you have any ideas for improvement?
My Hacktoberfest 2023 Journey: Contributing to Open Source and Planting Trees
Tags: hack23contributor, python, cryptography
Published: 2023-11-06 18:38:04

Hacktoberfest 2023 has come to a close, and I am thrilled to share my experience of participating in this fantastic event. This year, I not only made meaningful contributions to open-source projects but also had the privilege of planting a tree in my name as a result of my efforts. In this post, I want to take you through my journey, the projects I contributed to, and the environmental impact I made by planting a tree.

My Hacktoberfest 2023 journey was an exciting adventure in the realm of cryptography and secure communication. I took the opportunity to contribute to projects that focused on cryptographic algorithms, including the Rabin-Miller primality test and other ciphers. Here's a summary of the projects I contributed to:

**Project A (Rabin-Miller Algorithm)**: My journey began with a deep dive into the Rabin-Miller primality test, a fundamental algorithm used to determine the primality of numbers. I made significant improvements to the existing implementation, optimizing it for better performance and accuracy. Ensuring the reliability of this algorithm is critical for cryptography and secure data transmission.

**Project B (Cipher Algorithms)**: This was centered around various cipher algorithms. I contributed to the development of advanced encryption algorithms, strengthening the project's security features. These cipher algorithms are essential for safeguarding sensitive information in the digital age, making my contribution all the more meaningful.

**Project C (Cryptography Library)**: This project was a comprehensive cryptography library that served as a resource for developers and security enthusiasts. I added support for new cryptographic ciphers, enhancing the library's capabilities and making it a more versatile tool for encrypting and decrypting data.

**Project D (Security Documentation)**: In my final contribution, I dedicated myself to improving the documentation of Project D, a repository focused on educating developers about cryptography and secure coding practices. Clear and comprehensive documentation is essential for promoting the responsible use of cryptographic algorithms, and I was proud to play a part in enhancing it.

## **Planting Trees in My Name**

In addition to the satisfaction of strengthening cryptographic algorithms and contributing to the security of digital communication, I had the privilege of planting a tree in my name as part of Hacktoberfest 2023's commitment to environmental sustainability. This initiative is a reminder that our contributions to open source not only benefit the digital world but also contribute to the well-being of our planet.
Changeup: The Dev Tool for Bridging Code and Community
Published: 2023-11-06 18:35:57

Every line of code tells a story — a story of problem-solving, innovation, and progression. For those of us with an entrepreneurial mindset, our code is more than just a product; it's a conversation with a growing community of users and advocates. 

Enter [Changeup](https://getchangeup.com): more than just a changelog automation tool, it's the bridge between your codebase and your audience. By automating the tedious task of changelog generation, Changeup empowers you to keep your community informed and involved with every update, feature, and fix.

But changelogs are just the beginning, the foundation of a rich content program. Changeup is a versatile platform that crafts content tailored to all the different ways you connect with your various audiences. Whether it's a no-nonsense, dev-focused changelog that cuts straight to the chase, a user-facing blog post that celebrates new features and fixes, or engaging Twitter threads that peek into your development process, Changeup is your #buildinpublic content partner creating a multifaceted narrative from a single source of truth — your repository.

Imagine the power of automating your release notes in a way that connects, not just informs. Imagine saving hours translating technical updates into compelling stories. With Changeup, this isn't a lofty ideal; it's your new reality.

For the entrepreneurial developer, Changeup offers more than efficiency — it offers a way to amplify your voice and scale your community engagement without sacrificing the time needed for innovation. With Changeup, you're not just shipping code; you're nurturing a dialogue with your users, inviting them on your development journey, and building a base of loyal advocates.

As we shape the future with each deployment, let [Changeup](https://getchangeup.com) handle the narrative. Join us in revolutionizing the way we communicate progress, one commit at a time.
Placeholder Contributor
Tags: hack23contributor
Published: 2023-11-06 18:14:37

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->

### Intro
<!-- Share a bit about yourself as a contributor. Is this your first Hacktoberfest, or have you contributed to others? Feel free to embed your GitHub account by using {% embed LINK %} -->

### Highs and Lows
<!-- What were some of your biggest accomplishments or light-bulb moments this month? Did any problems come up that seemed impossible to fix? How did you adapt in those cases?  -->

### Growth
<!-- What was your skillset before Hacktoberfest 2023 and how did it improve? Have your learning or career goals changed since working on these new projects? -->