teleren/devto huggingface dataset:
Modern Perl Catalyst: Docker Setup - Update
Published: 2023-08-03 17:20:59

Based on feedback from one of my [previous blogs](https://dev.to/jjn1056/modern-perl-catalyst-docker-setup-2246) and updates to community project I made a few changes.

First [Sqitch](https://sqitch.org) released an update that supported Perl 5.38 so I updated the application container to use that.  I also had a discussion with the author and he suggested using default environment variables rather than building the sqitch configuration file over and over.   So I updated that config file to look like:

    [core]
        engine = pg
        top_dir = sql
        target = main
    [target "main"]
        uri = db:pg:

and changed the `Makefile` to map the incoming environment variables that define how to access the database to use the sqitch defaults for Postgresql:

    update_db:
            @echo "Running database migrations"
            @env PGHOST=$(DB_HOST) PGPORT=$(DB_PORT) PGPASSWORD=$(POSTGRES_PASSWORD) \
             PGUSER=$(POSTGRES_USER) PGDATABASE=$(POSTGRES_DB) sqitch deploy

Why not use the defaults in the docker compose file?  Because I'm trying to think ahead and make sure my setup is future proof should I need to add more database models.

I was very pleased with this change since I always found the task of rebuilding the configuration file every time to have the properly environment variables to be an ugly hack.

I also cleaned up the `Dockerfile` for the application service:

    FROM perl:5.38.0
    WORKDIR /app

    # Core OS setup
    RUN apt-get update
    RUN apt-get install -y postgresql-client git vim

    # Clean up
    RUN apt-get clean
    RUN rm -rf /var/lib/apt/lists/*

    # Copy only the files needed for installing dependencies
    COPY cpanfile* .
    RUN cpanm --notest --installdeps .

    # Copy the rest of the application source code
    COPY . .

    # Run the Catalyst application
    CMD make server 

I made similar changes to the Postgresql dockerfile.  And I fixes a few minor bugs that popped up in testing.   One was due to over enthusiastic copy pasta and I actually found a bug in the [Valiant](https://metacpan.org/dist/Valiant) validations system which required a patch; that found it way to CPAN last night.

Thanks for the feedback everyone!
AWS Pricing Calculator needs hardening
Tags: aws
Published: 2023-08-03 17:09:08

**Background**

AWS Pricing calculator allows you to Configure a cost estimate that fits your unique business or personal needs with AWS products and services. We have had the [Simple Monthly Calculator (SMC) ](http://calculator.s3.amazonaws.com/calc5.html) (Retired as of 3/31/23) that provided estimates in the past which was then replaced with the [AWS Pricing Calculator](https://calculator.aws/#/)

**Why should you use AWS Pricing Calculator?**

The AWS Pricing Calculator has a simplified web interface, which now supports cost estimates of more than 150 AWS services. It also enables cost estimates at scale, like bulk import for EC2 instances. AWS Pricing Calculator is accessible to all users, prospects, or AWS customers, without an AWS account. It provides cost estimates for your workloads, using the public AWS prices. Also the best source to get the most updated and comprehensive pricing estimates in one place.

**Areas on AWS Pricing Calculator that needs Hardening**


**User Experience Related**

This one has been out there for a while but its easy to configure your estimate and do all the hard work to get to the point where you have an estimate only to click outside of the primary form and find out you have just lost all your great work. 


![AWS Pricing Calculator form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0k4jin1a46vzt4ff5pyv.png)


_Make sure to not click anywhere outside of the primary overlay or form for the calculator without saving your work._


**Pricing Related**

This one in particular has been even more frustrating in many ways. Noticed that the form fields reset automatically when you change around a few options under your service configuration which could lead to a price that is not accurate. 

Here is an example where i would try to compare my price for the two Aurora PostgreSQL offerings (Aurora Standard vs Aurora I/O-Optimized). I start out by selecting Aurora Standard and gather the monthly price ($894.98 USD/m for a db.r7g.2xlarge)


![Aurora Standard Configuration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/373pbermgysghl89o5bx.png)

All good until this point. Next I update from Aurora Standard to I/O-Optimized to compare and the cost bump really caught me  (and a few others) by surprise.


![Aurora I/O-Optimized](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88ewivtd7yc8ot9sbv8h.png)


The pricing calculator resets the instance type and picks an alternate type which is not what you expect. Easily goes unnoticed when your focus was a cost comparison and you are looking at the delta. Certainly caught a bunch of us by surprise. Will drop in some support cases with AWS next to see if we can resolve these discrepancies and improve the user experience!

Hope this saves some of you some time!
deploy Gatsby site in Hostinger in a subfolder directory
Tags: gatsby, react, hosting, help
Published: 2023-08-03 16:51:18

When I host my site in the root directory the links work fine. But having problem in a subfolder like this **"https://main-domain.com/projects"**. Every time I click any link it redirects me to **"https://main-domain.com"**. 

But I want my root directory to be **"https://main-domain.com/projects"**.

in gatsby-config.js used 

```
module.exports = {
  pathPrefix: `/projects`,
assetPrefix: `https://main-domain.com`,
}
```

also built the site with the command

```
gatsby build --prefix-paths
```

but it always sends me back to the "https://main-domain.com" path. 
How to solve that?
Machine monitoring
Tags: programming, productivity, machinelearning, softwaredevelopment
Published: 2023-08-03 16:48:27


Manufacturing industry is dynamic with materials, vendors, line capacity, and quality processes varying for each order.

Witness the remarkable transformation of #Radiaant as they implemented Rawcubes' iDataOps, revolutionizing processes, teams, and systems across their factories and warehouses.

Know more about Radiaant's journey to transformation here [
https://www.rawcubes.com/industrial-dataops/machine-monitoring.html](https://lnkd.in/dd238a4F)
How Do I Obscure API Keys On The Client?
Tags: react, webdev, tips
Published: 2023-08-03 16:41:27

---
title: How Do I Obscure API Keys On The Client?
published: true
date: 2023-08-03 16:39:31 UTC
tags: react,webdevelopment,reactjs,tips
canonical_url: 
---

 **Question** : How do I obscure API keys on the client?

**Answer** : So you have a super powerful key to a 3rd party API that allows you to read/write any data you want from any customer, and you don’t want that falling into anyone else’s hands. What do you do? Gotcha. First off, you never send that to the client, not in any way, not obscured, not encrypted, not anything. Because try as you might to hide it, the key will end up showing clear as day in the Network tab of the Inspector as soon as you make a call on the client.

![](https://cdn-images-1.medium.com/max/1024/1*w03XojOiHkHkZ0o3e9dISw.jpeg)
_React + NextJS Questions And Answers Banner_

What you should do instead is create a _proxy_ API endpoint on your NextJS server. NextJS has always had great support for making API routes. You can use a [route handler](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) to create a proxy endpoint that will take the request from the client, and then make the request to the 3rd party API on the server. This way, the client never sees the API key, and you can do whatever you want with the response before sending it back to the client.

This _proxy_ API also doesn’t need to be a 1-to-1 proxy, you can create an abstraction layer that allows you to do things like caching, or rate limiting, or even just to make the API easier to use. For example, if you have a 3rd party API that requires you to make 3 separate calls to get the data you need, you can create a single endpoint that makes those 3 calls and returns the data in a single response. In addition this new API ensures that if you want to change out that 3rd party API layer later that you only have to change it in one place.

To be honest, learning how to make the calls from a NextJS route handler will teach you how to make the calls to the API during Server Side Rendering, which is probably what you want to do anyway. So learning this technique of building proxy APIs is a two-fer!

Before you do any of this, make sure that the API key is indeed dangerous to be on client. Not all API keys are meant to be kept secret. Some keys, like Firebase keys, are meant to be used on the client. If you’re not sure, check the documentation for the API you’re using.

> _Jack Herrington is currently working on a_ [_course on NextJS_](https://pronextjs.dev/)_, subscribe to the newsletter to get updates as well as React and NextJS tips, tricks and tutorials._
To earn 300 BNB from 1 BNB with Matrix Pro smart contract.
Tags: webdev, news
Published: 2023-08-03 16:26:42


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

To earn 300 BNB from 1 BNB with Matrix Pro smart contract.

Step 1: Copy the link: https://matrixpro.vip/signup?referralid=1
with 0.1 BNB to Metamask/Trust wallet browser,…
Step 2: Wait for blockchain to transfer you to Home-Dashboard to buy AutoPool 1 with 0.2 BNB.
Step 3: Share your link and help others do the same.
Step 4: Add your wallet to Bot: https://t.me/tracktxbot to track BNB automatically to your wallet.
Step 5: Buy AutoPool 2 - AutoPool 10.
Simple but not easy !
TYPESCRIPT
Tags: webdev, javascript, typescript, beginners
Published: 2023-08-03 16:16:47

TypeScript is a syntactics superset of JavaScript which adds statics types.
TypeScript being "syntactics superset" means that it shares the same base syntax as JavaScript, but add something to it.

Why should I use TypeScript?
* Compilation: it a compiler of code and code error, it has error detector.
* It support OOP: it support the Object Oriented Programming Language
* It supports type definition from existing JavaScript:it shows the data type while your JavaScript don't when typing or programming.

TypeScript Type system
1) any Type: is a super type of all type in TypeScript. it disable type checking and effectively allows all types to be used.
2) built in type: your string:"", number:1, null, undefined
3) user defined type: the user is the one to determine the types of data to be use in the application.

Type Assignment
when creating a variable in TypeScript, there are two main ways TypeScript assigns a type:
1) Explicit:writing out the type
e.g let firstname: string = "James";
Explicit type assignment are easier to read and more intentional
2) Implicit:TypeScript will "guess" the type,based on the assigned value
let firstname = "John";
Note:Having TypeScript "guess" the type of a value is called: infer.

Implicit assignment force TypeScript to infer the value.

Implicit type assignment are shorter, faster to type,and often used when developing and testing.

Error in Type Assignment
TypeScript will throw error if data types do not match.

TypeScript syntax for variable declaration
var identifier : Type = value;

Example of Type:any
let k: any = true;
k = "string";
Example of TypeScript Arrays
TypeScript has a specific syntax for typing arrays variable.
e.g: let fruit: (string| number|null|boolean)[] = ["mango", 80, 90,null,true,false,"Edwin","Gideon"];
Example of TypeScript Tuples
Tuples is a typed array with a pre-defined length and types for each index.
Tuples help or allow each element in the array to be a known type of value.
To defined a tuple,specify the type of each element in the array
e.g:let studentscore: [string,number,string,boolean,string] = ["John", 30,"jude",true,"I love coding"];
Example of TypeScript syntax of an object
e.g: let car:{
name: string;
color: string;
wheel: number;
year: number;
}={
name: "Benz";
color: "White";
wheel: 4;
year: 2022;
};
72 berufliches Vorwärtskommen: Umgang mit Karriere-Weg-Uneigentlich-Helfern.
Tags: deutsch, career, motivation, discuss
Published: 2023-08-03 16:06:00

Moin Moin,

ich denke, dass es sich mit den Uneigentlich-Helfern ähnlich verhält wie mit den [Nicht-Helfern→](https://dev.to/amustafa16421/67-berufliches-vorwartskommen-karriere-weg-nicht-helfer-3ced), es kann immer sein, dass es einige von ihnen geben wird.

Das bringt mich zu einem möglicherweise kontroversen Standpunkt den ich vertrete.
Es geht um _Verantwortung_ und _Scham_. Sofern mir etwas widerfährt, was mir nicht gefällt, Betrug beispielsweise, überlege ich wie ich darauf reingefallen bin und wie ich mich künftig davor schützen kann. Ich schäme mich jedoch nicht, dass mir dies widerfahren ist. Schämen sollte sich, meiner Ansicht nach, der Täter für diese verwerfliche Tat. Ein „gesundes“ Leben in einer Gesellschaft Bedarf stets eines gewissen Maßes an Vertrauen, so meine Auffassung.

Das Frei sein von falscher Scham, ist wichtig, um Betrüger öffentlich anzuprangern oder auch strafrechtlich zu verfolgen, denke ich.

1) Wie stehst du zu Verantwortung und Scham, wie hier beschrieben


Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Oder auch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
Make your videos Twitter (X) compatible
Tags: linux, opensource, ffmpeg
Published: 2023-08-03 16:00:28

If you are getting stuck at 99% while updating videos to Twitter, try this solution. It just requires having `ffmpeg` installed on the system and adding this function to your`.bashrc`:

```
twitterfix() { ffmpeg -i "$1" -c:v libx264 -crf 20 -preset slow -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2, format=yuv420p" -c:a aac -movflags +faststart out.mp4 }
```

Usage example:

```
$ twitterfix my_video.mp4
$ ls
my_video.mp4 out.mp4
```
Curso | Solidity| require
Tags: solidity, require, spanish
Published: 2023-08-03 15:47:30

##Hola a todos##

Hoy les traigo un minitutorial del curso de solidity que estoy tomando, al finalidad de esto es que aprendamos juntos ya que no soy experto en solidity si no que estoy apenas aprendiendo y la idea es explicar lo que he entendido con el objetivo de aprender-enseñando

// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

contract Variables{

    function PruebaRequire(uint valor) public pure returns(bool)
    {
        require(valor==5, "EL VALOR NO ES IGUAL A 5");
        return true;
    }

}

Este contrato contiene una función llamada "PruebaRequire" que toma un valor como parámetro y verifica si ese valor es igual a 5 utilizando la función require. Si la condición se cumple, la función devuelve true. Si el valor no es igual a 5, la función se detiene y muestra un mensaje de error.

Al momento de deployar el contrato podremos observar que al enviar un 5 en el valor este no retorna ningún error;


!["Imagen del código en SOLIDITY"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l5734u1t0lr0hmu6q0ml.png)

Y podremos ver más información dando clic donde dice CALL para ver que retorna un valor bool que dice true.


!["La imagen muestra la consola de solidity"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyzvoq541xsu97q9dbol.png)


Pero en caso de enviar un numero diferente se notificara de esta manera.


!["La imagen muestra la consola de solidity"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hj3fs9uk26217l1gpb7f.png)

Eso es todo por el dia de hoy

!["La imagen dice BYEBYE"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1nphn2n3qualy2zm8nw.png)
Ghh
Published: 2023-08-03 15:44:05

<p style="text-align: center;">शक्ति साधक।</p><div class="separator" style="clear: both; text-align: center;"><object class="BLOG_video_class" contentid="e35919c21374774f" height="266" id="BLOG_video-e35919c21374774f" width="320"></object></div><br /><p style="text-align: center;"><br /></p>
<div><div style="height: 0px; left: 0px; padding-bottom: 56.25%; position: relative; text-align: center; width: 100%;"><iframe allow="encrypted-media *;" allowfullscreen="" src="//iframely.net/pmdV1UV" style="border: 0; height: 100%; left: 0; position: absolute; top: 0; width: 100%;"></iframe></div></div><script async="" src="//iframely.net/embed.js"></script>
Mocker gives you proxy power to streamline gRPC development
Tags: vscode, javascript, kubernetes, testing
Published: 2023-08-03 15:43:29

Over the past few weeks we’ve been walking you through some of the great use cases for [Mocker](https://marketplace.visualstudio.com/items?itemName=skyramp.mocker-vscode), the first of our Kubernetes testing tools in our VS Code extension, Kubernetes Test Toolkit.


Today I want to share a video with you that walks you through its powerful gRPC proxying capability. You can easily mock a subset of the methods in an endpoint, while directing others to the live service in your cluster, enabling more realistic, more meaningful tests.

Watch it [here](https://www.skyramp.dev/blog/mocker-gives-you-proxy-power-to-streamline-grpc-development/).
💻 10 essential Java Development tools you should learn
Tags: java, softwareengineering, springboot
Published: 2023-08-03 15:41:00

Java is well-known for its extensive use for web, enterprise, and mobile applications. The field of web development moves fast and staying ahead of the curve is a necessity. Here are 10 essential web development tools that a Java developer shouldn't miss. These tools are meant to help you streamline your workflow, debug with ease, speed up productivity, and keep up with the pace of web development. 



1) IntelliJ IDEA - IntelliJ IDEA is a popular Java IDE that is widely used by Java developers. It provides rich features like code completion, debugging, and testing. It also supports web development workflows and enables plugin integration with other software tools. 



2) Spring Framework - Spring Framework is a widely used and mature open-source Java framework for building web applications. It provides a vast array of features such as data access, messaging, and security. It is flexible, well-supported, and has an active community. 



3) Postman - Postman is a tool for testing REST APIs. It is easy to use and can save a considerable amount of time when testing and debugging APIs. It provides a collection of features such as saving requests, responses, and environments.



4) Git - Git is a free, open-source distributed version control system. It provides a way to track changes made to the source code. It facilitates collaboration among developers and allows for easy branching, merging, and reverting changes.



5) Docker - Docker is a containerization platform that is used to create, deploy, and run applications. It provides a simple way to package the application with all its dependencies into a container. Docker containers are lightweight and can run anywhere, providing a seamless deployment process.



6) Sonar - Sonar is a continuous code quality tool used to analyze source code for bugs, vulnerabilities, and other technical debt. It provides static analysis, code coverage, and duplication detection. Sonar integrates well with Eclipse and other IDEs.



7) Apache Maven - Apache Maven is a build automation tool used primarily for Java projects. It is used to compile, test, and package Java code into JAR or WAR files. It can manage dependencies, integrate with other build systems, and automate the build process.



8) JIRA - JIRA is a project management tool used by many development teams to manage bugs, issues, and tasks. It integrates well with other tools like Git and Jenkins.



9) Apache Tomcat - Apache Tomcat is a widely used Java servlet container. It is used to run Java web applications. It provides a simple way to deploy, test and run web applications, and supports multiple operating systems.



10) Selenium - Selenium is a tool for web browser automation, which means you can test your web pages like both JSP and static pages written using HTML and JavaScript using Selenium.



Let me know in the comments section what other tools Java developers should know in 2023
JS Challenge: Check if a string is a palindrome
Tags: javascript, javascripttips, oneliners, strings
Published: 2023-08-03 15:37:09

---
title: JS Challenge: Check if a string is a palindrome
published: true
description: 
tags: javascript, javascripttips, oneliners, strings
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-08-03 00:38 +0000
---
Any string, after removing whitespaces and punctuations, that reads the same when the order of letters is reversed - regardless of the case of letters - is considered a palindrome. For example:

`'Was it a car or a cat I saw?'`

So the steps involved are:

1. Convert the string to uniform case
2. Remove all non-alphabet characters from the string
3. Reverse the order of letters and check if it reads the same as the original string

```js
const str = "Was it a car or a cat I saw?";
[...str.toLowerCase().replace(/[^a-z]/g, '')].join('') ===
 [...str.toLowerCase().replace(/[^a-z]/g, '')].reverse().join('')
```
Pokémouille - A modern Pokédex (part 4)
Tags: webdev, javascript, opensource, beginners
Published: 2023-08-03 15:06:40

Hello there everyone! And welcome to part 4 of the devlog for Pokémouille, an open-source Pokédex website I've been working on since April, using SvelteKit, a lot of stuff has been done since last time so let's get into it right away. 
As usual you can find the repo right here: https://github.com/Vaalley/pokemouille

#UI Total makeover & Dark Mode
We're now using SkeletonUI with the Crimson theme for the UI and I have to say the website looks much better, and SkeletonUI comes with a very easy to setup dark/light mode switcher which we're now using.

#More Informations and sorting :o
I added more infos here and there, like the generation a Pokémon was introduced in, its EV yields when defeated and also added sorting buttons for moves (finally lol).

#What's Left To Do?
A ton:
-UI/UX Improvements everywhere
-Add berries (and potentially even more game specific stuff, like routes)
-I also got the idea of having a much nicer looking Pokémon Showdown clone, I think it could be really fun to work on, but also a crazy amount of work
-A probably a lot more I forgot!

#Join the Pokémouille Development!
Pokémouille is looking for contributors of any kind at any skill level, so if you're interested feel free to take a look at the Github repo (link at the top of the post), the project is open-source and under licensed under MIT which means it's all about collaboration! If you know anyone who'd be interested in working on the project I'd appreciate it if you were to share this project with them!

Thanks for reading and have a good day :)