teleren/devto huggingface dataset:
What can Slack tell me about my developer team's culture?
Published: 2023-03-16 15:58:06

What can Slack tell me about my developer team's culture?

Surprisingly, a lot!

At Adadot.com we analysed data in 35,000 developer datasets from GitLab, GitHub, Slack and Google Calendar. Here are some findings:

The vast majority of messages will always be Direct messages to colleagues and that's normal. When the ratio of public vs private messages falls below 10% this can create a number of issues

📃 More need for documentation. If solutions are not being shared openly in a searchable environment like Slack, it means you will need to formally document more.

🤗 Culture of safety. If developers are not feeling confident enough to raise challenges or solutions publicly are you seeing the effects somewhere else, for example overall code quality?

🔎 Visibility. Are the engineering leaders leading by example by being visible across the team and / or the organisation?

Some of the best performing teams we see either:

Have a higher public vs private message ratio than 10%

or

Are actively working to increase it
Starting a bootcamp
Tags: bootcamp, flatiron
Published: 2023-03-16 15:57:19

I should start by saying that I should have written and posted this months ago, however I did not know that it was a requirement to complete the class until the last week of the class.  Fortunately I tend to journal frequently and I just so had one entry that I would like to share prior to my first day of coding bootcamp at flatiron school.

Starting a coding bootcamp can be both exciting and anxiety-inducing. On the one hand, I feel eager to learn new skills and embark on a new career path. On the other hand, I am nervous about whether you have what it takes to succeed and keep up with the fast-paced curriculum.

I completed the prework for the bootcamp, it felt like I was drinking water through a firehose. The amount of information to absorb was overwhelming, and it feels like I'll never be able to retain it all. However, I have been told that this intense immersion is an essential part of the bootcamp experience, and it will prepare me for the challenges to come.

I'm feeling a mix of emotions. Excitement at the prospect of learning new skills and building projects, anxiety about meeting expectations and keeping up with the pace of the curriculum, and a bit of apprehension about the unknown.

Do others in the bootcamp feel the same excitement and nerves as I do? I hope to be there for my cohort and put in time so that we as a cohort can be there to lean on each other and push each other. I'm really hoping on a great instructor and mentors to guide me and help me succeed.

As I dive into the bootcamp curriculum, I hope to get a feel  of what's to come. I'm looking forward to building projects, solve challenging problems, and learn new programming languages and technologies. While it may be difficult at times, I just need to keep reminding myself that I'm building the foundation for a fulfilling and rewarding career in tech.

In conclusion, starting a coding bootcamp can be an exciting yet nerve-wracking experience. The pre-work may have felt like drinking water through a firehose, but it's all part of the process. Lean on your cohort for support, and remember that you're building the foundation for a rewarding career in tech. Get ready for a taste of things to come!
How to allow Site Members (Non Site Owners) to share files with anyone?
Tags: sharepoint, sharepointonline
Published: 2023-03-16 15:53:54

How do you allow your **site members** _(non site owners)_ to be able to share files with **"Anyone"**?

By default, the **"Anyone" option is disabled** 🚫 for site members when trying to share files from SharePoint

![Default settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzu2i2pr25tcxgqmf6y6.png)

> ⚠️⚠️ **Anyone** here means anyone who gets hold of the shared link **can access this file without signing-in**,i.e. unauthenticated users. Please be extra careful when enabling this option.

---

### Step 1: SharePoint Admin Center Settings

This setting can be found under **Policies** -> **Sharing**
Enable **External Sharing** by dragging the slider to **"Anyone"**

![SharePoint Admin Global Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/el7j892cbzjcypclk7hr.png)
<br/>

### Step 2: Site Level Settings

1. Click the **Gear** icon on top right corner
2. Select **Site permissions**
![Gear](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtcvcp9xi6hecn1zg2ry.png)
3. Select **Change how members can share** under _Site Sharing_
![Share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6te5tqg0gd4vzt8dzi4.png)

4. In the **Site sharing settings** dialog, depending upon your requirements, select any of the options other than **Only site owners can share files, folders, and the site**

![Site sharing settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ii7cfzuulxgjrejg1yd.png)

---

### ⚙️⚙️ Default Settings

It is probably a good idea to set the **default** type of link & permissions to be a **more restrictive** 🔒

In the **SharePoint Admin Center** **Sharing** page as per in **Step 1**, go to the **File and folder links** sub-section.

Here you can choose the default value for the:
- Type of link
- Permission of link

![File and folder links](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/upc8tk1qoimhigyc99b9.png)

---


### 📖📖 Further Reading
- https://learn.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off
- https://learn.microsoft.com/en-us/sharepoint/change-default-sharing-link
Implementing encryption in postman
Tags: api, postman
Published: 2023-03-16 15:53:38

Hello community, I am Hyunjoe Yoo, a Software Developer in the DevRel Team at Mastercard.

Encryption is a method to protect sensitive information such as personally identifiable information, credit card numbers, and more. Its application could be expanded to API when handling sensitive data, so the body of the request could be encrypted.

Mastercard provides encryption helper libraries in different languages (Java, Python, Node, Ruby, C#, PHP and Go) to help you do this in code. You can find them [here](https://bit.ly/ma-github).

But if you want to quickly test out an API through Postman, you can’t use/import these helper libraries directly into Postman.

Please refer to [How to implement encryption in postman](https://mstr.cd/3TzfICw) for more information with a video that walks you through the basics of creating a project in Mastercard Developers, getting the consumer and authorization keys and how to plug them into Postman. It is a great guide that shows how to import a script into Postman, which encrypts/decrypts the request/response bodies as well as how to configure it to use the correct keys.

Start building with Mastercard APIs across fraud, open banking, cryptocurrency, data intelligence and much more. Visit [Mastercard Developers](https://bit.ly/mastercard-developers).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c7d3n9df7b2nbd2e8774.png)
Creating users in postgres
Published: 2023-03-16 15:47:08

**Creating a user**

CREATE USER myusername WITH PASSWORD 'mypassword';

**Assigning read only permissions**

Check if a user has permissions on a table

`SELECT * from information_schema.table_privileges WHERE grantee = 'read_only_user' and table_name = 'users';`

Grant read only permissions

`GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only_user;`

Whenever the user ted creates a table, it will grant select rights for read_only_user.

`ALTER DEFAULT PRIVILEGES 
FOR USER ted
IN SCHEMA public
GRANT SELECT ON TABLES TO read_only_user;`

**Assigning read and write permissions**

`GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO tom;`

`ALTER DEFAULT PRIVILEGES
FOR USER admin
IN SCHEMA public
GRANT ALL PRIVILEGES ON TABLES TO tom;`

**Deleting a user**

Assign the object ownership from the error detail to another user.

`REASSIGN OWNED BY tom TO harry;`

Remove the database object connections to the user with:

`DROP OWNED BY tom;`

At the moment, the user no longer has any dependencies. To drop the user, run

`DROP USER tom;`

**Updating a user password**

`ALTER USER tom WITH PASSWORD 'fvfvfvafdfgff';`


To give a user access to the postgres pg_stat_activity table, execute the command below from a superuser account.

`GRANT pg_read_all_stats TO username;`

You may need to kill a process like this.

`SELECT pg_cancel_backend(31809);`

You need to this permission.

`GRANT pg_signal_backend TO brian;`

**Granting read permissions on sequences**
`GRANT SELECT, USAGE ON ALL SEQUENCES IN SCHEMA public TO myuser;`

If you want to grant the user the ability to modify sequences directly (e.g., to reset them), you can include the UPDATE permission as well:

`GRANT SELECT, USAGE, UPDATE ON ALL SEQUENCES IN SCHEMA public TO myuser;`
Why an SME should use Managed Kubernetes
Tags: kubernetes, saas, cloud, devops
Published: 2023-03-16 15:28:45

If you manage the infrastructure for a small or medium-sized company, you understand that having a scalable, secure, and flexible infrastructure is crucial for the success of your business.

Kubernetes is a popular open-source container orchestration platform, that is already used by **[61%](https://www.statista.com/statistics/1233945/kubernetes-adoption-level-organization/) of software organizations** globally.

However, managing Kubernetes can be a complex task, requiring specific expertise and a learning curve, especially at a time when your development team should be focused on making the best application possible.

At such a critical junction of your business, a complex infrastructure set up can be extremely draining. The most common complaint we've heard is that there are just **too many things that can go wrong**. Whether it is network routing, security controls or just trying to get your team up to speed on the YAML manifests.

That's where managed Kubernetes services come in, offering a solution that can benefit companies of all sizes.
Simplified management

A managed Kubernetes service provides you with a simplified approach to Kubernetes management & day-2 operations. It can help you **avoid the complexities of maintaining and updating the infrastructure**, allow configuration of access controls and also provide integration with other managed services like databases.

Most managed services provide all key benefits of the Kubernetes API like autoscaling, auto-healing and replication. This way, you can spend more time building your application, and less time managing your infrastructure.
Security

Kubernetes can be challenging to secure, requiring extensive knowledge of container security and network security. Managed Kubernetes services offer security features such as:

- network isolation
- identity and access management
- vulnerability scanning
- multi-region support.

These features ensure that your infrastructure and data are protected, and that you comply with industry standards and regulations.

## Cost savings

While hyperscalers like Amazon and Google offer Kubernetes services, they can become expensive as soon as the company is out of their free credit program.

Managed Kubernetes services offer cost-effective options that are tailored to small and medium-sized companies' needs, (for example, Symbiosis can save you up to 82% compared to AWS).

Managed services providers offer solutions that fit within the company's budget while ensuring a high level of security and scalability.

## Summary

A managed Kubernetes service offers small and medium-sized companies the **scalability, security, and flexibility** they need to grow their businesses.

It can help you save costs, simplify management, and scale efficiently without compromising on security.

If you're working for a fast-growing company, consider the benefits of using a managed Kubernetes service for your infrastructure.
Beyond Console Logs: 3 Advanced Methods to Measure Function Execution Time in JavaScript
Tags: javascript, beginners, optimization
Published: 2023-03-16 15:28:17

---
title: Beyond Console Logs: 3 Advanced Methods to Measure Function Execution Time in JavaScript
published: true
description: Looking to improve the efficiency of your JavaScript code? Check out these three effective methods for measuring function execution time, and discover how to optimize your code's performance for better results.
tags: javascript, beginners, optimization
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8q8c01j5562w871dzrd.jpeg
---

In JavaScript, measuring the performance of a function can be a crucial aspect of optimizing your code. There are various ways to measure how long a function takes to execute, and in this article, we'll explore 3 of the most common methods. Whether you prefer using console timers, Date objects, or performance.now(), we'll provide you with practical examples that you can use to measure the time taken by your functions. 

By the end of this article, you'll have a better understanding of how to measure your JavaScript code's performance and make informed decisions to optimize it.

## 1. Using console.time() and console.timeEnd():

These two methods can be used to start and stop a timer respectively. They can be used to measure the time taken by a function by calling `console.time()` before the function and `console.timeEnd()` after the function, and passing the same label to both methods. Here's an example:

```js
console.time("myFunction");
// Call your function here
console.timeEnd("myFunction");
```

## 2. Using Date objects:

You can also measure the time taken by a function using Date objects. You can record the current time before and after the function call and subtract the two to get the time taken by the function. Here's an example:

```js
const start = new Date();
// Call your function here
const end = new Date();
const timeTaken = end - start;
console.log(`Time taken: ${timeTaken}ms`);
```

## 3. Using performance.now():

The `performance.now()` method returns a high-resolution timestamp that can be used to measure the time taken by a function. You can record the current time before and after the function call and subtract the two to get the time taken by the function. Here's an example:

```js
const start = performance.now();
// Call your function here
const end = performance.now();
const timeTaken = end - start;
console.log(`Time taken: ${timeTaken}ms`);
```

All of these methods can be useful in different scenarios, and you can choose the one that works best for you.

By implementing these techniques and regularly monitoring your code's performance, you can identify potential bottlenecks and improve your application's overall performance. We hope this article has provided you with a better understanding of how to measure your JavaScript code's performance and will help you write more efficient and optimized applications.

What methods do you use to optimize JavaScript functions? Share your strategies in the comment section below.
AI SQLite Assistant
Tags: sqlite, sql, ai, chatgpt
Published: 2023-03-16 15:22:48

While trying to trick AI into saying ethically questionable things may be fun for some of us, I prefer more practical and useful scenarios.

So, as of today, [Sqlime](https://sqlime.org/) — an online SQLite playground — includes the "Ask AI" feature.

AI can explain, teach, and troubleshoot your SQL without leaving the playground:

1. Write a question as a comment above the query.
2. Click "Ask AI".
3. Receive a not-so-fast, but often useful answer from AI.

![Ask AI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdbftrq5w4hhz31mtb7y.jpg)

Try it out! All you need is an OpenAI API key.

[**Ask AI in Sqlime**](https://sqlime.org/)

_Follow [**@ohmypy**](https://twitter.com/ohmypy) on Twitter to keep up with new posts_
PyI18n v1.2.0: The Ultimate Solution for Python Internationalization
Published: 2023-03-16 15:18:57



I'm very excited to announce the release of `PyI18n v1.2.0`, the latest version of open-source Python library for internationalization. `PyI18n` is designed to provide an easy and efficient way to manage translations and support multiple languages in your Python applications. With this latest release, `PyI18n` is now even more powerful and flexible, making it the ultimate solution for Python internationalization.

## Key Features of PyI18n v1.2.0:

1.  `Namespaced Translations`: PyI18n now supports namespaced translations, which allows you to organize your translations into logical groups. Namespaces make it easier to manage your translations and prevent naming conflicts.
2.  `Improved Translation File Handling:` `PyI18n` now supports nested translations and improved file handling, making it easier to manage and organize your translations.
3.  `Dynamic Translation Loading`: `PyI18n` can now dynamically load translations based on user preferences, making it easy to switch between languages at runtime.
4.  `Improved Documentation`: We have improved the `PyI18n` documentation, making it easier to get started and use PyI18n in your projects.

How to Get Started with PyI18n:

Getting started with PyI18n is easy. Simply install the PyI18n package using pip and import it in your Python project.

```sh
pip install pyi18n-v2
```

To use `PyI18n`, you need to create a translation file in eg. `YAML format`. The translation file should contain a dictionary with translations for each language you want to support.

en.yml
```yaml
en: 
	hello: "Hello, World!
	welcome: "Welcome to PyI18n!" 
```

fr.yml
```yaml
fr: 
	hello: "Bonjour, le monde!" 
	welcome: "Bienvenue à PyI18n!" 
```

Once you have your translation file, you can load it in your Python code using `PyI18n`.

```python
from pyi18n import PyI18n


i18n = PyI18n(('en', 'fr'))
_: callable = i18n.gettext
```


You can then use `_` method to get translations for your application.

```python
print(_('en', 'hello.welcome'))
```

## Conclusion:

`PyI18n v1.2.0` is the ultimate solution for Python internationalization, offering powerful features and flexibility for managing translations and supporting multiple languages in your Python applications. With `PyI18n`, you can easily create and manage translation files, dynamically load translations, and support pluralization in translations. We hope you will find `PyI18n v1.2.0` useful in your projects.
Remixing songs using Chat GPT-4 and the command line
Published: 2023-03-16 15:16:24

I've recently heard a song that I really liked, and I've thought about how I wanted the tempo to be a bit slower.

We've all heard Youtube "slowed, reverbed, bass boosted" versions of popular radio songs.

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

Just playing it at 0.9x at Youtube wasn't going to be enough!

Since we just got GPT-4 available and it's all the rage, I've decided to go to it and prompt it for the tips.

First prompt was pretty basic - 

```
Could I do a basic song (mp3) remix via ffmpeg
```

and the answer was more in the line of mixing different songs together, so I had to be a bit more direct.

```
It's more in the line that I have extracted vocals from a song, and a separate track for the instrumental of the song and I want to slow the instrumental by some 12 %, add bass boost and slight reverb, and then merge that again with the vocals, is that possible with ffmpeg?
```

I got back the following -

![ffmpeg commands part I](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0w32y6ubtmmxv265auo.png)


![ffmpeg commands part II](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y7e4e7zr3wr3jwhiem4s.png)


![ffmpeg commands part III](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/canx3rj7becixt2tnaat.png)

But then my session crashed and I realized I forgot to copy actual commands :). 

After a bit of back and forth with OpenAI's GPT and "Sidney" via Edge chat - I got the following pipeline to make a decent result - 

1. Slow it down

```
ffmpeg -i input.mp3 -filter: a "atempo=0.89" slowed_input.mp3

```

2. Add some boost to bass frequencies

```
ffmpeg -i slowed_input.mp3 -af "equalizer=f=100:width_type=h:200:g=6" input_boosted.mp3
```


3. Add reverb with `sox`

```
sox input_boosted.mp3 reverb_input.mp3 reverb 30 50 100 50 0
```

And this is the result

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

I've also prompted GPT for a statement that I own no copyright of the song for Youtube video description (legal purposes), in Croatian (!!) and it handled that pretty well.

NOTES

- I had to use sox, because there is some mismatch between my Fedora version of ffmpeg and it's filters to add reverb
- As you'll notice I've ignored my first idead to split the track into vocals and instrumental, since that ended me up with a too big of a mismatch between vocals and the music track
- When applying bass boost, the effect is modulated with the last 'g' variable, sometimes more than 5 gives loud thumps one would have to further clean
- There is ample room to play with the reverb effect but I like this as it's quick and dirty
- At times Sidney straight up refuses to give you a direct ffmpeg or sox command

This is another one in my line of experimenting building stuff with the tiny shoggoths that LLMs are.

![LLM as a shoggoth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6r5npgrlu18lmca330f.png)

I've been using it as a math tutor, CRUD coding buddy, and to automate generating recipes from Youtube cooking videos.
Transitioning from Frontend Engineer to DevOps Engineer: Four Questions to Streamline Processes
Tags: devops, productivity, agile, kanban
Published: 2023-03-16 15:05:15

As a Frontend Engineer turned DevOps Engineer, I've learned the importance of optimizing team productivity and efficiency. But let's face it, DevOps is not just about mean time to recovery or continuous integration pipelines, it's about making work fun and playful. So, in collaboration with my colleague Karl Monney, we've come up with four simple questions that will help streamline processes and keep things playful.

## The Four Questions

### 1. What's your endgame, and how does this task fit in?

Tell me what you want to achieve with this task and how it fits into your grand scheme of things. It's like playing a game of chess. We need to know your strategy so we can help you execute your moves.

### 2. What can you offer to speed things up?

We know you're busy, and so are we. So, let's make things more efficient. What do you have that can help us get the job done faster? Screenshots, links, or code snippets, you name it. If you want it fast, give us the tools to do it.

### 3. How is this affecting you right now, and how can it help us establish priorities with our own work?

We get it. You're under pressure, and we don't want to add to it. So, tell us how this task is impacting you right now, and we'll make sure it gets done with the urgency it deserves. Not only does this help us understand your pain points, but it also helps us establish priorities with our own work. We want to make sure that we're addressing the most critical issues first, so your feedback is critical.

### 4. How will you know when it's done?

It's all about setting clear expectations. So, let us know what "done" means to you, and we'll make sure to hit the mark. We want you to feel confident that when we say it's done, it's done.

## Conclusion

These four questions are easy to use and will keep things playful while helping us streamline processes, establish priorities, and define completion criteria. Whether you're a designer, developer, or a DevOps engineer, these questions can be used by anyone, anytime, anywhere. So, let's get playful and make work fun again!