teleren/devto huggingface dataset:
JS Challenge: Convert snake_case to camelCase
Tags: javascript, snakecase, camelcase, oneliner
Published: 2023-07-28 03:43:41

---
title: JS Challenge: Convert snake_case to camelCase
published: true
description: My take on the popular programming challenge
tags: JavaScript, snakecase, camelcase, oneliner
# cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bemdrkjhw5sftqguo54s.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-07-28 00:45 +0000
---

I have seen many ***JavaScript*** snippets to convert strings in snake case to camel case. For example the following string:

`SNAKE_casE`

will look like this after conversion:

`snakeCase`

One snippet I have seen recently in a forum goes like this:

```js
let str = 'SNAKE_casE';
const [firstPart, lastPart] = str.toLowerCase().trim().split("_");
const outputCamelCase = `${firstPart}${lastPart.replace(
  lastPart[0],
  lastPart[0].toUpperCase()
)}`;
console.log(outputCamelCase);
```

which will produce an output:

`snakeCase`

But what if the snake case string has multiple segments as below:

`SNAKE_casE___WITH_muLtiPLE_SEGments`

The code above can deal with only two segments.

Here is my take on the problem. This one-liner should work for any snake case string even those with multiple segments:

```js
let str = 'SNAKE_casE___WITH_muLtiPLE_SEGments';
str.toLowerCase().replace(/_+(.)/g, (m, g) => 
  {return g.toUpperCase()}
);
```

First it converts the entire string to lower case. Then scans the string for occurrences of underscore(s) followed by a single character `(.)` and globally replaces those occurrences with the upper case of the character that follows the underscore(s). Notice the second argument in the call to [replace()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) is a function - in this case it returns the character converted to upper case. If the second argument to `replace()` is a function it can take the *match* and the *capture groups* as arguments and return a value to replace the *match*. See the [reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) for a complete description.
A use case for :is
Tags: css
Published: 2023-06-25 11:32:03

---
title: A use case for :is
published: true
date: 2023-06-25 11:31:07 UTC
tags: css
canonical_url: https://blog.nicm42.co.uk/a-use-case-for-is
---

I've known that `:is` and `:where` have existed for a while. But I hadn't seen a reason to change my autopilot of comma separation. Until recently.

I had a situation where I really wanted to use `:has`. But it's not quite ready for production code yet (it's not in Firefox at all, which is my favourite browser). The easy solution was to use JavaScript to add a class, which I could use instead of `:has`. But I thought I'd do some future-proofing and use `:has` anyway, so if someone has no JavaScript in their browser, but with a new enough browser where `:has` works, the styling I needed to do would work for them.

So that was fine and I ended up with this bit of CSS:

```css
div:has(img),
div.has-image {
  /* styling goes here */
}
```

This worked fine in Chrome, but Firefox ignored all of that styling. That's because it didn't understand the first line, so it ignored the whole thing.

But `:is` works because if it doesn't understand something, it only ignores the bit it doesn't understand. So changing the code to this made it work in Firefox:

```css
div:is(:has(img),has-image) {
  /* styling goes here */
}
```
Perl In Real Life
Tags: perl, programming
Published: 2023-07-28 03:34:44


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8egu8z90buj2hw08eab.jpg)Introduction:
An intro to Perl IRL, with live coding examples

Reasons I recommend this Perl course:
1. It's free 
2. Good for budding Perl developers looking for more real learning experience
3. Explore a little more about Perl options on both Linux and Windows

Link & sources : 
https://www.udemy.com/share/107hqO3@VVbzh-KQxoDXrhZlYylEu_fIy_2vcox2SgmfC-EEylY4cuuB-1fEUKE8b8aEYsXZ4w==/

 #perl  #learning
Next Project Idea Generator: Unleash Your Creativity
Tags: webdev, beginners, programming, tutorial
Published: 2023-07-28 03:30:00

**Welcome to the ultimate resource for developers seeking inspiration for their next project. Our [project idea generator](https://www.aiforme.wiki/ai/tools/what%20should%20i%20build%20next%3F) offers thousands of unique combinations to ignite your creativity and spark new development endeavours.** 

Whether you're a seasoned developer or just starting your coding journey, we have the perfect project idea waiting for you.

## How It Works:

**Choose Your Interests:** 
Select your preferred programming language, technology stack, and project category to tailor the generated ideas to your expertise and interests.

**Get Inspired:** 
Our idea generator will provide you with a diverse array of project concepts that combine your chosen elements, ensuring you find something that truly excites you.

**Endless Possibilities:**
With thousands of unique combinations, you'll never run out of fresh ideas to explore. From web applications to mobile apps, games, AI projects, and more, the possibilities are endless.

## Why Use the Idea Generator:

**Ignite Creativity:**
Break free from coder's block and let our idea generator inspire you with new and innovative project concepts.

**Expand Skills:**
Experiment with different technologies and project categories to broaden your skillset and expertise.

**Personal Satisfaction:**
Find a project idea that aligns with your passions and interests, making the development journey a fulfilling and enjoyable experience.

**Conclusion:**
Explore the [next project idea generator](https://www.aiforme.wiki/ai/tools/what%20should%20i%20build%20next%3F) and unlock a world of possibilities for your next coding adventure. Whether you're looking to enhance your skills, build something innovative, or simply have fun with coding, our idea generator has something special in store for you. 

Embrace the power of inspiration and take your development journey to exciting new heights. Get started now and let your creativity soar with endless project possibilities. Happy coding!
5 Tech Sites That Programmers Frequently Visit
Tags: webscraping, ai, data
Published: 2023-07-28 03:27:44

Each industry has its own circles, and programmers also have community sites and blog sites that they visit frequently. Here are five technical websites frequently visited by programmers.

1.Stackoverflow
StackOverflow is part of the StackExchangeNetwork, a knowledge community about computers and information technology, especially programming technology. It is unique in that it covers a wide range of computer programming topics. The website encourages active user participation, with the ability to ask and answer questions, rate them, and edit documents similar to wikis and diggs.

https://stackoverflow.com/


2.DZone
With over one million developer members, DZone is the premier programming news hub for programming professionals and developers. The site covers everything from agile development to cloud development, big data, integration, performance and more. Tutorials and tools for beginners to experts.

https://dzone.com


3.Leet Code

LeetCode is a learning site where you can solve problems similar to or used in GAFA coding interviews. To be honest, it’s gray because the questions that were actually used in company interviews have been leaked. The perfect platform to help you improve your skills, expand your knowledge, and prepare for technical interviews.

https://leetcode.com/


4.Slash Dot
SlashDot is a huge interactive resource for all the latest blog posts and news articles related to technology and coding. With a genuine community feel, SlashDot provides developers with expert technical articles from a small group of editors and programmers.

https://slashdot.org/


5.The Hacker News
Much like Reddit, but for developers only. HackerNews is your portal for all the developer news you could care about at any given time. Big news in the IT world is hotly discussed here. If you don’t want to miss out on big programming news, you should visit often.

https://thehackernews.com/
Demystifying HTML: The Backbone of Web Development
Tags: webdev, beginners, programming, tutorial
Published: 2023-07-28 01:18:39

Welcome to the world of HTML (`Hypertext Markup Language`), the cornerstone of web development! Whether you're a newbie, a frontend developer, or a curious backend enthusiast, understanding HTML is essential for creating web content. In this comprehensive guide, we'll explore the architecture and skeleton of HTML, providing you with a solid foundation to kickstart your journey into the web development realm.


## 1. The Basic Structure:
HTML is all about structuring content using tags. These tags, represented by angle brackets `(< >)`, come in pairs: an opening tag and a closing tag. Elements, such as headers, paragraphs, images, and links, are placed between these tags to create meaningful content.

```
<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <h1>Heading Level 1</h1>
    <p>This is a paragraph of text.</p>
    <img src="image.jpg" alt="Image Description">
    <a href="https://www.example.com">Visit Example Website</a>
  </body>
</html>

```

## 2. Essential Tags:
Let's dive into some of the essential `HTML tags`:

**`<head>`**: This section contains meta-information about the page, like the title and references to CSS and JavaScript files.

**`<title>`**: Defines the title of the page, displayed in the browser's title bar or tab.

**`<body>`**: This section contains the visible content of the web page.

**`<h1> to <h6>`**: Header tags, where `<h1>` is the highest level and `<h6>` the lowest.

**`<p>`**: Represents paragraphs of text.

**`<img>`**: Embeds images into the page.

**`<a>`**: Creates hyperlinks to other pages or resources.


## 3. Structuring Content:
HTML provides structural elements to organize content effectively. Use lists, divs, and sections to structure your page logically.

```
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>

<div>
  <p>This is a paragraph inside a div.</p>
  <img src="another-image.jpg" alt="Another Image">
</div>
```

## 4. Embracing Semantic HTML:

Semantic HTML goes beyond just appearance; it adds meaning to your content. Use tags like `<header>`, `<nav>`, `<main>`, `<footer>`, and more to convey the purpose of different sections in your document.

```
<header>
  <h1>My Website</h1>
  <nav>
    <ul>
      <li><a href="/">Home</a></li>
      <li><a href="/about">About</a></li>
      <li><a href="/contact">Contact</a></li>
    </ul>
  </nav>
</header>
<main>
  <h2>Welcome to My Website!</h2>
  <p>...</p>
</main>
<footer>
  <p>Contact us at contact@example.com</p>
</footer>
```

## 5. Styling with CSS:
While HTML provides the structure, CSS (Cascading Style Sheets) takes care of presentation. By applying styles to HTML elements, you can create visually appealing websites.

Now that you've been introduced to HTML's architecture and skeleton, it's time to explore more tags, attributes, and CSS which will be discussed in the next write up to enhance your web development skills. Embrace your curiosity, experiment, and dive deeper into the world of frontend and backend development. Happy coding! 🚀📝

#html #tech
If Statements: The Quick Guide For Beginners
Tags: javascript, beginners, tutorial
Published: 2023-07-28 01:07:55

_(See The Header Image For How An If Statement Is Basically Written In A Function)_

## JavaScript likes to "solve" If Statements like a simple true or false scenario:
 
If the condition we give to a function is true (it matches **exactly** with the thing we've defined to the right of the ===), the function will return something.

If the condition we give to a function is false (it DOESN'T match **exactly** with the thing we've defined to the right of the ===), the function does NOT return anything.

## You can remember when to use If Statements like this:
**If TRUE, do something. If FALSE, do nothing. That's it.**
What exactly is Uptrace?
Published: 2023-07-28 01:02:20

Uptrace is a free and open source APM tool that provides distributed tracing, metrics, and logs. It may be used to monitor apps and set up automated alerts to get notifications by email, Slack, Telegram, and other channels.

Uptrace collects data via OpenTelelemetry and stores it in the ClickHouse database. Uptrace additionally necessitates the use of a PostgreSQL database in order to maintain metadata such as metric names and warnings.

To execute the backend with a single command, install the Uptrace binary or use the Docker example.

After initiating Uptrace, you will be given a data source name (DSN) that provides Uptrace connection information.

The data may then be exported from Collector to Uptrace using the OTLP exporter and the DSN in headers:

```
exporters:
  otlp/uptrace:
    endpoint: localhost:14317
    tls: { insecure: true }
    headers: { 'uptrace-dsn': 'http://project1_secret_token@localhost:14317/1' }
```
Metrics for the host
Published: 2023-07-28 01:00:20

The hostmetricsreceiver plugin for OpenTelemetry Collector collects numerous metrics about the host machine, such as CPU, RAM, disc data, and other system-level metrics.

However, OpenTelemetry lacks built-in storage and processing tools for the acquired data. Instead, you may export the data to your preferred OpenTelemetry backend, such as Prometheus or Uptrace.

To begin collecting host metrics, install Otel Collector on each machine to be monitored and add the following lines to the Collector configuration:

```
receivers:
  hostmetrics:
    collection_interval: 10s
    scrapers:
      # CPU utilization metrics
      cpu:
      # Disk I/O metrics
      disk:
      # File System utilization metrics
      filesystem:
      # CPU load metrics
      load:
      # Memory utilization metrics
      memory:
      # Network interface I/O metrics & TCP connection metrics
      network:
      # Paging/Swap space utilization and I/O metrics
      paging:
```
For further information, see the OpenTelemetry Collector host metrics documentation.
Collector of OpenTelemetry
Published: 2023-07-28 00:57:55

The OpenTelemetry Collector bridges the gap between instrumented apps and multiple backends or observability platforms.

OpenTelemetry Collector may also function as an agent, collecting telemetry data from systems to be monitored and sending it to tracing tools using the OpenTelemetry protocol.

Collector, for example, may monitor Redis by running the INFO command on a regular basis to gather telemetry data and deliver it to your observability pipeline for analysis and monitoring.
What exactly is OpenTelemetry?
Published: 2023-07-28 00:56:13

Cloud Native Computing Foundation hosts OpenTelemetry, an open-source observability framework. It is the result of the amalgamation of the OpenCensus and OpenTracing initiatives.

OpenTelemetry standardizes the collection and transmission of metrics, traces, and logs from diverse software components in a distributed system.

Because OpenTelemetry is vendor-independent and supports many programming languages, it is suited for a wide range of applications and settings.
OpenTelemetry and Uptrace are used to monitor CPU/RAM/disk metrics.
Published: 2023-07-28 00:54:35

OpenTeleletry Collector is a free and open source data gathering pipeline that lets you monitor CPU, RAM, disc, network, and other metrics.

Collector does not have built-in storage or analysis capabilities, but you can export data to Uptrace and ClickHouse, which may be used in place of Grafana and Prometheus.

When analyzing millions of timeseries, ClickHouse outperforms Prometheus in terms of on-disk data size and query speed.
What is EtherLink?
Tags: tezos, blockchain, ethereum, etherlink
Published: 2023-07-28 00:37:27


**Etherlink** is a technology built on the Tezos blockchain that aims to provide a fully decentralized solution for Ethereum's Layer 2 (L2) scaling. Let's break down what that means:

**Ethereum L2 Solution:** Ethereum is a popular blockchain platform that supports smart contracts and decentralized applications (dApps). However, as the network becomes more popular, it faces challenges with scalability, causing high fees and slower transaction times. Layer 2 solutions are created to address these issues and improve the performance of Ethereum-based applications.

**Built on Tezos:** Instead of creating a separate blockchain from scratch, Etherlink leverages the Tezos blockchain, which is known for its self-amending capability and efficient proof-of-stake consensus mechanism. Tezos provides a strong foundation for Etherlink's operation.

**Decentralization:** Etherlink takes decentralization seriously. It aims to empower users and avoid central control by utilizing smart rollups on Tezos, which are more cost-efficient and resilient.

**Governance:** Etherlink's governance model is inspired by Tezos Layer 1 governance. This means that decisions regarding the operation and upgrades of Etherlink are not made by a select few but follow a decentralized decision-making process, allowing the community to participate and influence the platform's evolution.

**Scalability and Speed:** Tezos has a track record of continuously improving its performance, and this commitment extends to Etherlink. As a result, Etherlink is expected to offer better scalability and faster transaction speeds compared to the main Ethereum network.

Overall, Etherlink aims to provide businesses and developers with a platform that combines the benefits of Ethereum's ecosystem with the advantages of Tezos' decentralized governance and scaling capabilities. By using Etherlink, users can be part of a blockchain revolution that promises to be more open, secure, scalable, and cost-effective. If you're interested in experiencing Etherlink, you can sign up to be notified when it launches.

Register Here: [EtherLink](https://etherlink.vercel.app/)
TIL Blog Day 8 - Ruby Gym & Codewars
Tags: beginners, programming, webdev, ruby
Published: 2023-07-28 00:12:57

Over the last few days I got caught up in going through the different Tech Prep modules and I haven’t posted a blog lately. 

I recently went through the Ruby Gym module. Overall  it was a great experience. It gave me the chance to put into practice all the reading from the Intro to Ruby module.  The best way to cement new ideas in your brain is through practice. 

After I finished the Ruby Gym module I was still excited to practice my new found Ruby skills. I ended up going to site that I visit daily. 

### Codewars 
[Codewars](https://www.codewars.com) is a great platform to practice your coding skills regardless of the language.  They offer 25+ languages that you can train on. Everyone starts with a ranking of 8 kyu. Kyu is a Japanese term used in martial arts to designate proficiency or experience, in Codewars you start at 8 kyu and work your way down to 1 kyu. You get points for solving coding challenges in your language of choice and you also get points for voting on challenges and even creating them.  It’s a fun way to track your progress!

I started learning JavaScript last year and I found the challenges on Codewars to be rewarding. You can sort through the challenges and choose specific tags you want to focus on such as fundamentals,  arrays, data structures, etc.  Some challenges early on are simple and can be done in a few minutes. Other challenges can be complex and have taken me over 40 minutes to complete. I do at least one challenge a day and I’m currently a 3 kyu in JavaScript with over 600 challenges completed.

I recently started doing Ruby challenges and it is a great way to get your spaced repetition after learning new  Ruby methods and concepts. If you feel like you could benefit from this platform please check it out!
Content & Tooling Team Status Update
Tags: puppet, community
Published: 2023-07-28 16:49:16

---
title: Content & Tooling Team Status Update
published: true
date: 2023-07-28 00:00:00 UTC
tags: puppet, community
canonical_url: https://puppetlabs.github.io/content-and-tooling-team/blog/updates/2023-07-28-status-update/
---

# Happy Friday!

## Converting ERB files to EPP

This week, the modules team in Pune have done some great work on converting ERB files to EPP on our modules. EPP is the new method of templating and the team, have been identifying modules which need converting and converting them.

## Module and Tools Onboarding

Over in Belfast, we’ve been contiuing to onboard with our tools. We’ve been taking each tool and doing a general health check and doing deep dives into how they work. You may have seen some action with some PRs being merged and some bugfixes going in here and there.

Likewise, over in Pune the team have been onboarding with their modules doing the same thing. It’s an exciting time in the CAT team as we have a larger team to further support our modules and tools and are putting the hard work in now to provide our best support to them.

## Modules and Tools Office Hours

Going forward, we will be splitting our Tuesday office hours sessions into Modules and Tools office hours, alternating between each. Details on the timings of each session will be communicated in the near future.

## Community Contributions

We’d like to thank the following people in the Puppet Community for their contributions over this past week:

- [`puppetlabs-lvm#279`](https://github.com/puppetlabs/puppetlabs-lvm/pull/279): “Add yes argument when creating/extending a LV”, thanks to [bmlit](https://github.com/bmlit) and the following people who helped get it over the line ([SHWETHABHAT1](https://github.com/SHWETHABHAT1))
- [`puppetlabs-postgresql#1460`](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1460): “Add Debian 12 compatibility”, thanks to [bastelfreak](https://github.com/bastelfreak) and the following people who helped get it over the line ([ekohl](https://github.com/ekohl))
- [`puppetlabs-stdlib#1386`](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1386): “Add stdlib::has\_function”, thanks to [seanmil](https://github.com/seanmil)
- [`puppetlabs-stdlib#1385`](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1385): “Re-add block support to deprecated top-level merge”, thanks to [seanmil](https://github.com/seanmil)

## New Module / Gem Releases

The following modules were released this week:

- [`puppetlabs-java`](https://github.com/puppetlabs/puppetlabs-java) (`10.1.2`)

- [`puppetlabs-firewall`](http://github.com/puppetlabs/puppetlabs-firewall) (`6.0.0`)

- [`puppetlabs-haproxy`](https://github.com/puppetlabs/puppetlabs-haproxy) (`7.1.0`)

- [`puppet_litmus`](https://github.com/puppetlabs/puppet_litmus)(`1.1.1`)