teleren/devto huggingface dataset:
How to add a MySQL Planetscale database as a grafana cloud datasource
Tags: grafana, mysql
Published: 2023-11-08 21:40:26

---
title: How to add a MySQL Planetscale database as a grafana cloud datasource
published: true
date: 2023-05-19 00:00:00 UTC
tags: ['grafana', 'mysql']
canonical_url: https://blog.lepape.me/adding-mysql-planetscale-as-grafana-cloud-datasource
---

The grafana cloud free plan is amazing for most of personal projects! I use it a lot on https://fixtheops.dev, and recently I wanted to display some data from my platnetscale mysql database to visualise the user growth. Platnetscale free plan being amazing as well, I highly advise the platform (https://planetscale.com/).

First you need to add a new datasource, in our case: mysql.

Then head over to Planetscale, and create a new password with __read-only rights__.

> This part is important, as from grafana you can run DROP commands.

Then in the datasource add the host, user, password. As Planetscale is using SSL, make sure to toggle "With CA cert" option.

In authentication details, you need to provide the TLS/SSL root certificate. Here is how to obtain it:

```sh
# if you have pbcopy on mac:
curl https://letsencrypt.org/certs/isrgrootx1.pem | pbcopy

# otherwise, copy paste what you get from the curl command
curl https://letsencrypt.org/certs/isrgrootx1.pem
```

How it should look like:

![grafana-datasource](https://lepape.me/assets/static/grafana-datasource-screenshot.1fc590d.aaeac00a3ebeeff6dd8331c0f3311812.png)

And here you are! All good to build beautiful dashboards for free ✨
Content & Tooling Team Status Update
Tags: puppet, community
Published: 2023-05-22 17:16:56

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

## Welcoming new team members

I’d like to give a warm welcome to Malik Parvez who is the the newest member of our team!

He will be focusing on our Modules so many of you will start to see him pop up on PRs and issues that you are working on.

A quick intro from Parvez..

> I am Parvez, I have experience in designing, developing data platforms like Elasticsearch and running in production for enterprise search and logging, and cloud infrastructure automation with always automation first approach using tools like Rundeck and Jenkins. Apart from this I love to travel and explore new cultures.

## In other news

The rest of the team have been working hard ensuring that our supported modules are Puppet 8 compatible.

It’s been a long journey but I’m pleased to say that the end is in sight.

I think it’s also worth shouting out to our amazing community contributors who have been helping along the way.

## Wrapping up

So that’s all for this week. I’d like to wish you all a lovely weekend and hope the sun shines where ever you are!

## Community Contributions

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

- [`puppetlabs-apt#1104`](https://github.com/puppetlabs/puppetlabs-apt/pull/1104): “(MODULES-10831) key is expired if all subkeys are expired”, thanks to [kenyon](https://github.com/kenyon)
- [`puppetlabs-kubernetes#625`](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/625): “General fixes”, thanks to [r-tierney](https://github.com/r-tierney)
- [`puppetlabs-stdlib#1353`](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1353): “Deprecate the `validate_legacy()` function”, thanks to [smortex](https://github.com/smortex)

## New Module / Gem Releases

The following modules were released this week:
A Fascinante Jornada pela Inteligência Artificial: Uma Conversa com a CBN
Tags: bendevjunior, tecnologia, chatgpt, programming
Published: 2023-05-18 23:57:16

Olá a todos! Sou Bendev Junior, entusiasta da tecnologia, autor e profissional dedicado a explorar as fronteiras da inovação. Recentemente, tive a honra de discutir um tema que me fascina profundamente: a Inteligência Artificial (IA), em uma conversa com a CBN.

{% embed https://youtu.be/eIh_ETDGqYE %}

Durante a entrevista, navegamos pelos mares do universo da IA, desde o entendimento dos fundamentos até a discussão das inovações mais recentes que estão transformando nosso mundo. É incrível perceber como a IA está expandindo os limites do que consideramos possível, impactando não apenas a tecnologia, mas a forma como vivemos e interagimos.

A IA não está apenas nos celulares ou nos assistentes de voz — ela está cada vez mais integrada em nossas vidas, moldando a maneira como trabalhamos, aprendemos e até mesmo como nos relacionamos uns com os outros. Seja na medicina, com diagnósticos mais precisos, no comércio, com experiências personalizadas de compra, ou na educação, com aprendizado adaptativo — a IA está aqui para revolucionar.

Em nossa conversa, também abordamos as implicações éticas da IA. Com o poder de transformar tantos aspectos de nossas vidas, é crucial que estejamos cientes dos dilemas éticos que surgem.

Como podemos garantir que a IA seja usada para o bem, respeitando a privacidade e os direitos de todos? Como podemos evitar o uso indevido desta poderosa ferramenta? Estas são questões importantes que precisamos abordar à medida que avançamos para um futuro cada vez mais dominado pela IA.

Para mim, um dos aspectos mais empolgantes da IA é o seu potencial ainda inexplorado.
 
Estamos apenas no início de nossa jornada para entender o que a IA pode fazer. Há um vasto universo de possibilidades à nossa frente — e eu estou incrivelmente animado para explorá-lo com todos vocês.

Espero que vocês se juntem a mim nesta emocionante viagem de descoberta e inovação. Juntos, podemos explorar a fronteira da tecnologia e moldar o futuro da IA.

Se você gostou deste artigo e está interessado em mais discussões sobre IA e outras tendências tecnológicas, não deixe de me seguir aqui no Medium e em outras redes sociais. Estou ansioso para compartilhar mais sobre essa jornada emocionante com todos vocês!
Até a próxima, Bendev Junior
SAS Function setDateByNumberBDays
Tags: sas, sql, proc
Published: 2023-05-18 23:56:54

This function defines a new date by calculating it, starting from the informed one plus the number of working days provided as parameters. When using negative days, it returns previous dates.

```

proc fcmp outlib=work.sas_functions.dateFunctions;

    /*
    =================== 
     * FUNCTION:setDateByNumberBDays
     * AUTHOR: Dutra - dutra@relevants.org
     * DESCRIPTION: Defines a new date by calculating the 
     number of working days provided as a parameter. 
     When using negative days it returns previous dates.
    ===================
    */
	function setDateByNumberBDays(date, numberDays);

		numberBDays = 0;

		do while (numberBDays < abs(numberDays));
			if numberDays > 0 then
				date = date + 1;
			else
				date = date - 1;

			if isBusinessDay(date) then
				numberBDays = numberBDays + 1;
		end;

		return(date);
	endsub;


	
quit;
```
Remove background from Image using CSS only
Tags: webdev, css, beginners, tutorial
Published: 2023-05-18 23:41:20

In this beginner-friendly blog post, we will learn how to remove the background from an image using only CSS, specifically the mix-blend-mode property. This technique is useful for creating interesting visual effects and improving the performance of your website by reducing the need for edited images.

## Why this trick is important?
When you download a .png file, you might expect it to have a transparent background. However, this is not always the case. Sometimes, a .png file might have a solid background color, such as white or black.

In such cases, you can use the mix-blend-mode property to remove the solid background color and create the appearance of a transparent background. 

## What is mix-blend-mode?
mix-blend-mode is a CSS property that defines how the content of an element should blend with the content of the element's parent and its background. With this, you can create nice blends and colors for parts of an element's content depending on its direct background [Checkout this article](https://blog.logrocket.com/creative-text-styling-with-the-css-mix-blend-mode-property/)


To remove the background from an image, we will use the mix-blend-mode property with the value multiply. This value will remove the whiter parts of the image. Here's an example:

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

Image inside div with mix-blend-multiply:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjg8ch8uard5n08q40gh.png)

Similarly out can write this with TailwindCSS 

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

In this tutorial, we learned how to remove the background from an image using only CSS and the mix-blend-mode property. This technique allows for greater design flexibility, improved performance, and better SEO benefits compared to using edited images. With this knowledge, you can create interesting visual effects on your website and improve the overall user experience.
"Single Digit" Spotlight v2
Tags: spotlight
Published: 2023-05-18 23:34:42

Welcome to "Single Digit" Spotlight, a selection of articles published **_within the last week_** that have **_fewer than 10 total reactions_** (at the time of the post's publishing).

The goal is to highlight posts published on DEV that haven't yet received the attention they may deserve 🌱

Hope you enjoy!

{% embed https://dev.to/codepo8/i-just-did-a-test-to-apply-as-a-front-end-developer-and-things-arent-going-well-1mkn %}

{% embed https://dev.to/devland/clean-code-principles-for-javascript-and-typescript-developers-3kdn  %}

{% embed https://dev.to/jmfayard/weeks-of-debugging-your-build-can-save-hours-of-learning-gradle-4iek  %}

{% embed https://dev.to/cfedev/what-developers-need-to-know-about-jwts-1c9e  %}

{% embed https://dev.to/frosnerd/hashed-wheel-timers-5bo9 %}

{% embed https://dev.to/integerman/visualizing-data-in-dotnet-with-polyglot-notebooks-and-sanddance-55k9  %}


Shout out to @codepo8, @devland, @jmfayard, @remotesynth, @frosnerd, and @integerman.

---
<a href="https://www.freepik.com/free-photo/golden-number-one-with-gold-crown-top-floor-champion-winner-yellow-background-by-3d-render_25829004.htm#query=spotlight%20on%20a%201&position=38&from_view=search&track=ais">Image by DilokaStudio</a> on Freepik
SAS Function isBrHolidayworkingDaysBetweenDates
Tags: sas, sql, proc
Published: 2023-05-18 23:31:02

The function returns the number of working days between two given dates.

```
proc fcmp outlib=work.sas_functions.dateFunctions;

    /*
    =================== 
     * FUNCTION:workingDaysBetweenDates
     * AUTHOR: Dutra - dutra@relevants.org
     * DESCRIPTION: Returns the number of working days 
     between two given dates
    ===================
    */
	function workingDaysBetweenDates(startDate, endDate);
		numberDays = 0;
		addData = startDate;

		if startDate <= endDate then;
		do while (addData <= endDate);
			if isBusinessDay(addData) <> 0 then
				numberDays = numberDays + 1;
			addData = intnx('day',addData,1);
		end;

		return(numberDays);
	endsub;
	
quit;
```
SAS Functions extras for previous or next dates
Published: 2023-05-18 23:20:41

As auxiliary functions of **isBusinessDay**, **previousBusinessDay**and **nextBusinessDay**, the functions **ifNonBDayPreviousBDay** and **ifNonBDayNextBDay** test whether the informed date is a business day, if not, it returns the previous or subsequent business day date, respectively to each function.

```
proc fcmp outlib=work.sas_functions.dateFunctions;

    /*
    =================== 
     * FUNCTION:ifNonBDayPreviousBDay
     * AUTHOR: Dutra - dutra@relevants.org
     * DESCRIPTION: Checks if the given date is a working day, 
     otherwise returns the previous working day date
    ===================
    */
	function ifNonBDayPreviousBDay(date);
		if isBusinessDay(date) = 0 then
			return(previousBusinessDay(date));
		else return(date);
	endsub;
	
	/*
    =================== 
     * FUNCTION:ifNonBDayNextBDay
     * AUTHOR: Dutra - dutra@relevants.org
     * DESCRIPTION: Checks if the given date is a working day, 
     otherwise returns the next working day date
    ===================
    */

	function ifNonBDayNextBDay(date);
		if isBusinessDay(date) = 0 then
			return(nextBusinessDay(date));
		else return(date);
	endsub;
	
quit;
```
osdc-2023-assigment8-gitbash
Tags: osdc, github, git
Published: 2023-05-18 22:58:32

At lesson 8 we learned how to configure [git-scm](https://git-scm.com/) on Windows, including setting the default editor and configuring global and local repository settings**(one thing that help me that is to choice notepad instead vim)** 
We also learned about the process of cloning, forking, and pulling repositories, as well as creating and pushing repositories to GitHub.
 Additionally, we were introduced to basic git workflows, including branching, adding, committing, and pushing changes to a repository. Finally, we learned about advanced git commands, such as rebasing and force pushing, to manage changes to a repository.

**I'm Highly recommend if you want to know git from basic to listen 2 videos:**
[Here learn how to upload new project from cmd git to github](https://www.youtube.com/watch?v=aheLynn8QI8)
[and here learn how to fork exist reposotory and push with changes](https://www.youtube.com/watch?v=Opa8_QL3GV0)

**something that help me from this lesson:
Take link from ssh when you want to send changes to project in github via git-bash and not from https.**

This week's assigment was to take one project, set up the local development environment, and send a PR.
I chose the [OSDC - Open Source Development Course](https://github.com/OSDC-Code-Maven/OSDC-Code-Maven.github.io/tree/main)

I found course in india that very same to this course and add him to [courses.md](https://github.com/OSDC-Code-Maven/OSDC-Code-Maven.github.io/blob/main/docs/courses.md)

The very most thing when you work on project that is not your, change the main branch to other branch by:

```
git checkout -b zoharasulin/add
```
To work on project that is not yourself,you need add new fork in github,after copy ssh(not http!)
and write:

```
git remote add fork git@github.com:zoharasulin/OSDC-Code-Maven.github.io.git

```
now you can see you have 2 remotes when you write: 

```
git remote -v
```

I hope I help you,if you need help feel free to contact me here.

Zohar
SAS Functions previous and next BusinessDay
Tags: sas, sql, datefunctions, proc
Published: 2023-05-18 22:52:57

The functions with the aid of the previous functions of **isBusinessDay** and **isBrHoliday** return the previous or next useful date of an initial date informed in the parameter.

```
proc fcmp outlib=work.sas_functions.dateFunctions;

    /*
    =================== 
     * FUNCTION:previousBusinessDay
     * AUTHOR: Dutra - dutra@relevants.org
     * DESCRIPTION: Returns the previous working day of a 
       given date
    ===================
    */
	function previousBusinessDay(date);
		previousDay = intnx('day',date,-1);

		do while (isBusinessDay(previousDay) = 0);
			previousDay = intnx('day', previousDay, -1);
		end;

		return(previousDay);
	endsub;
	
	/*
    =================== 
     * FUNCTION:nextBusinessDay
     * AUTHOR: Dutra - dutra@relevants.org
     * DESCRIPTION: Returns the next working day of a given date
    ===================
    */

	function nextBusinessDay(date);
		nextDay = intnx('day',date,1);

		do while (isBusinessDay(nextDay) = 0);
			nextDay = intnx('day', nextDay, 1);
		end;

		return(nextDay);
	endsub;


quit;

options cmplib=work.sas_functions;
```
How to clone tables in BigQuery
Tags: bigquery, bigdata, dataengineering
Published: 2023-05-18 22:36:51

The long awaited table clones function became GA in BigQuery, why is it such a powerful feature?

> A table clone is a lightweight, writeable copy of another table (called the base table). You are only charged for storage of data in the table clone that differs from the base table, so initially there is no storage cost for a table clone. Other than the billing model for storage, and some additional metadata for the base table, a table clone is similar to a standard table — you can query it, make a copy of it, delete it, and so on. — [docs](https://cloud.google.com/bigquery/docs/table-clones-intro)

![bigquery clones](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9xpuubs1t96rnu4a5lz.png)

To create a clone:

```
CREATE TABLE
myproject.myDataset_backup.myTableClone
CLONE myproject.myDataset.myTable;
```

The cool thing is that your original export stays totally untouched. No need to worry about messing it up. When you simply copy a table, you don't have to pay for all that "unchanged" storage.

Simply put, whenever you require data isolation, whether it's for testing or any form of analysis, make sure to include table clones in your arsenal for reducing expenses!

Other strategies that may be useful in your costs reduction toolbox:
- [how-to-reuse-bigquery-cached-results](https://dev.to/mesmacosta/how-to-reuse-bigquery-cached-results-1ikl)
How to Set Up Sanctum in Laravel
Tags: laravel, php, api, security
Published: 2023-05-18 22:19:53

Sanctum is a Laravel package that provides a simple and lightweight authentication system for Single Page Applications (SPAs), mobile applications, and token-based APIs. It allows you to easily authenticate and manage user access to your application’s APIs. In this tutorial, we will explore how to set up Sanctum in Laravel and implement token-based authentication.

**Installing Sanctum**
To get started, we need to install Sanctum using Composer. Open your terminal and run the following command:

```
composer require laravel/sanctum
```

**Configuration**
Once Sanctum is installed, we need to publish its configuration file and migration files. Run the following commands:

```
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
php artisan migrate
```

**Authenticating Users**
To authenticate users with Sanctum, we need to configure our User model and update the authentication guard settings. First, add the `HasApiTokens` trait to your User model:

```
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
    use HasApiTokens;
    // ...
}
```

Next, in your `config/auth.php` file, update the guards array to use the Sanctum guard for API authentication:

```
'guards' => [
    // ...
    'api' => [
        'driver' => 'sanctum',
        'provider' => 'users',
    ],
],
```

**Protecting Routes and APIs**
Sanctum provides middleware that can be used to protect routes and APIs. To protect a route, simply add the `auth:sanctum` middleware to the route definition:

```
Route::middleware('auth:sanctum')->get('/dashboard', function () {
    // Route logic here
});
```

**Token Management**
Sanctum provides methods to issue and manage API tokens for users. To issue a token for a user, you can use the `createToken` method:

```
$user = User::find(1);
$token = $user->createToken('token-name')->plainTextToken;
```

The `plainTextToken` is the API token that can be used to authenticate API requests.

**Revoking Tokens**
Sanctum also allows you to revoke tokens for a specific user. To revoke a token, you can use the `tokens()->delete()` method on the user instance:

```
$user->tokens()->delete();
```

**Testing the Authentication**
To test the authentication, you can make API requests with the token attached as an authorization header:

```
GET /api/user
Authorization: Bearer {API_TOKEN}
```

Setting up Sanctum in Laravel provides a seamless way to implement token-based authentication in your application. It offers a lightweight and secure solution for protecting routes and APIs. By following the steps outlined in this tutorial, you can successfully set up Sanctum and enhance the security of your Laravel application.

Remember to consult the official Laravel Sanctum documentation for more detailed information and advanced usage.

Happy coding!
Hot Recruiters in Your Area
Tags: career, networking, interview, resume
Published: 2023-05-18 22:08:32

This week I’m doing something close to home— how to find a recruiter that works for you. Maybe you’ve lost your job, maybe you’re looking to move companies. Whatever the reason, I cannot stress enough how important it is to lean on and utilize recruiters. But we’ll get to more on that. 

If educational reading sounds like too much to take on this far into the week (an absolute vibe) here’s a link to this lovely and easily consumable 15-minute podcast:
[Spotify Link](https://open.spotify.com/episode/6DGYCseMaFOmp3Gy13O2tv?go=1&sp_cid=452bdd83f77a8d4918767db2a8f55d6d&utm_source=embed_player_p&utm_medium=desktop&nd=1)

Alright, so you’re looking for a recruiter…

I think it’s fair to take one step back even further and say why you should be looking for a recruiter in the first place. Recruiters are an absolute wealth of knowledge in the hiring world. No one understands the market quite like a recruiter because it’s, well, our job. Need help making your resume or LinkedIn stand out? Use a recruiter. Find a job posting you love but need a connection at a company? Use a recruiter. Need to get a feel for the average salary range of a position you’re thinking about pursuing? Use a recruiter. So instead of spamming 100 jobs with your resume use that energy to start messaging, calling and connecting with us. 

Okay, so here’s a quick rundown on how to find the recruiter for you. Start with a simple LinkedIn search. Search “tech recruiter” and then filter “Nashville” (or whatever city you’re looking to work in). Now you’re looking at somewhere around 650 results, right? Having flashbacks to your days on Tinder? Well, these are the specs I would use to narrow down the list:

- Profile Picture— if it’s stale, that’s a pass. 
- Connections— these people are recruiters, they should be the last people on LinkedIn who are low on connections. Look for 500 minimum but something in the 2,000-3,000 range is ideal.
- Activity— you can shoot your shot and message someone who isn’t particularly active but I think we both know how that’s likely to end.
- 2 & 2 Rule— you should be looking for at least two years of recruiting and two years of working for the same company. The fastest way for recruiters to get a bump in base pay is to switch companies, so take stints under two years with a grain of salt.

So now that you’ve narrowed down your search, it’s time to start messaging. Pro move: every time you message a new recruiter ask them to help you with **one thing**. Can you help with with my resume? What’s one thing you think I should change on my LinkedIn? You’re networking and you’re getting free help. I’d call that a double win. 

Alright, get out there. Start your search. Worst case scenario you make some great connections along the way.