teleren/devto huggingface dataset:
2 ways to create file with ansible
Tags: devops, linux, beginners
Published: 2023-05-01 14:39:38

{% embed https://www.howtouselinux.com/post/create-file-with-ansible %}

Ansible is an open-source automation tool that allows users to manage and configure systems remotely. One of the key features of Ansible is its ability to manage files on remote hosts using modules such as the "file" module and the "template" module. These modules allow users to create, modify, and delete files on remote hosts using Ansible playbooks. In this article, we will explore the "file" and "template" modules and how they can be used to create files on remote hosts.

| feature 	| "file" module 	| "template" module 	|
|---	|---	|---	|
| Purpose 	| Creates, modifies, or deletes files on remote hosts 	| Creates files based on templates containing variables and logic 	|
| File contents 	| Static contents provided in the playbook 	| Dynamic contents generated from a template file 	|
| Syntax 	| file: 	| template: 	|
| Use case 	| Useful for creating simple text files, modifying file permissions, or deleting files 	| Useful for generating configuration files based on dynamic input or variable values 	|

The "file" module is one of the most commonly used Ansible modules for managing files. With this module, users can create, modify, and delete files on remote hosts. To create a file using the "file" module, users simply need to specify the name and contents of the file in the Ansible playbook.

The "template" module is another powerful Ansible module for managing files. With this module, users can create files based on templates, which can contain dynamic content and variables. The "template" module works by substituting variables and expressions in the template file with their corresponding values. This allows users to create custom files for each remote host based on their specific configuration. 

[we dived into this and explored the difference here.
](https://www.howtouselinux.com/post/create-file-with-ansible)
Weekly Roundup 002 (Apr 24) - 🔥Hot Topics🔥 in workplace, sharepoint, and powerplatform
Tags: roundup, workplace, sharepoint, powerplatform
Published: 2023-05-01 14:12:33

Hey fellow developers! It's @jaloplo, here to give you the latest scoop on what's been happening in the #workplace, #sharepoint, and #powerplatform communities. 😎

## #workplace 

- [6 Tips for leading effective technical meetings as a Software Engineer](https://dev.to/erjan_tj/6-tips-for-leading-effective-technical-meetings-as-a-software-engineer-319l) by [Yerzhan Torgayev](https://dev.to/erjan_tj) encourages software engineers to lead effective technical meetings by setting clear goals, managing time effectively, and fostering a collaborative environment.

## #sharepoint

- [A User's Guide to SharePoint Online Navigation: Top Menu, App Bar, and More](https://dev.to/jaloplo/a-users-guide-to-sharepoint-online-navigation-top-menu-app-bar-and-more-4c6a) by [Jaime López](https://dev.to/jaloplo) explains the different navigation options in SharePoint Online and provides guidance for selecting the right navigation option for your needs.

## #powerplatform 

- [Power Automate 10 Quick Developer Tips](https://dev.to/wyattdave/power-automate-10-quick-developer-tips-3ik9) by [David Wyatt](https://dev.to/wyattdave) covers tips for using Power Automate, including using the expressions editor, handling errors, and working with arrays and loops.

- [Power App - Design Reviews](https://dev.to/wyattdave/power-app-design-reviews-5364) by [David Wyatt](https://dev.to/wyattdave) discusses the importance of design reviews for Power Apps and provides tips for conducting effective design reviews.

- [Power Apps, How many ways to make a Calculator](https://dev.to/wyattdave/power-apps-how-many-ways-to-make-a-calculator-5aeh) by [David Wyatt](https://dev.to/wyattdave) explores different ways to create a calculator in Power Apps, including using the built-in calculator control and creating a custom calculator using formulas.

- [How to – Use Power Automate Instead of Power Apps](https://dev.to/wyattdave/how-to-use-power-automate-instead-of-power-apps-3iob) by [David Wyatt](https://dev.to/wyattdave) suggests using Power Automate instead of Power Apps for certain tasks, such as sending emails and notifications.

- [Power Apps 10 Quick Developer Tips](https://dev.to/wyattdave/power-apps-10-quick-developer-tips-20bf) by [David Wyatt](https://dev.to/wyattdave) provides tips for developing with Power Apps, including using variables, understanding data sources, and working with galleries.

- [How to restore a mistakenly deleted Microsoft Power Automate flow](https://dev.to/fernandaek/how-to-restore-a-mistakenly-deleted-microsoft-power-automate-flow-4nc1)  by [Fernanda Ek](https://dev.to/fernandaek) provides step-by-step instructions for restoring a Power Automate flow that has been mistakenly deleted.

That's all for this week's roundup! Thanks for tuning in, and remember to keep the discussions lively and informative in our tags. 💬 If you have any suggestions for future topics, feel free to drop them in the comments below. See you next week! 👋
🗞 Rapyd Developer Newsletter: April 2023
Tags: api, fintech, payments, rapydnews
Published: 2023-05-01 13:57:18

Hey fellow developer, 👋🏻

Here is a list of what happened in April, just for you.  

----

**Rapyd Developer Bug Bounty Program**
Hey, global security community – find vulnerabilities in the Rapyd API, prove it, and get paid. Sign up through the Rapyd Client Portal, obtain your API keys, and begin testing through any integration method. Happy hunting!
[**Learn More**](https://bugcrowd.com/rapyd-og)

**Python Checkout Integration**
Check out the GitHub repository of a Rapyd Integration using Python. Clone the repo to get started on your integration.
[**Learn More**](https://github.com/Rapyd-Samples/python-payment-gateway-using-rapyd)

----

## Changelog ♻️
Rapyd has updated the Identity Verification (IDV) process to include a comparison check to verify info to match values from the personal ID. 

The IDV Request has been updated to improve the selfie image validation. The user now receives real-time feedback if the image is valid or not (prompting a reupload).

The Rapyd API has been updated to be able to map and process the original sender of a USD Swift Payout in the outgoing message

[**Read the Docs**](https://docs.rapyd.net/build-with-rapyd/changelog/rapyd-verify-idv-check-swift-payout-update)

----

## Discover 🔍
**Hosted Checkout Page with Custom Elements** `/video`
Save customer billing address, name, and more using a checkout page. 
[**Watch the Video**](https://www.youtube.com/watch?v=JaL26f03vhM)

**Create Payout with FX** `/video`
Learn how to create a payout with FX (foreign exchange). 
[**Watch the Video**](https://www.youtube.com/watch?v=k9FiE2DOAl4)

**Get Daily Rate** `/video`
Capture currency exchange rates for FX payments and payouts. 
[**Watch the Video**](https://www.youtube.com/watch?v=TdkAIkzZrlk)

**Rapyd Verify IDV, Swift Payout Update** `/video`
Follow recent updates to Rapyd Verify and Rapyd Disburse. 
[**Watch the Video**](https://www.youtube.com/watch?v=raUsSRPhCZs)

**Fintech, APIs, Node.js & Rapyd: Building Next-Gen Apps** `/article`
Get inspired to build your application among the next generation of apps. 
[**Read the Article**](https://community.rapyd.net/t/fintech-apis-node-js-and-rapyd-a-comprehensive-guide-to-building-the-next-generation-financial-apps)

**A Look at the Fintech API: A Rapyd Product** `/article`
Learn more about the essentials of an API and what’s in a Fintech API. 
[**Read the Article**](https://community.rapyd.net/t/a-look-at-the-fintech-api-a-rapyd-product)

---- 

## Rapyd 🤔
[**Rapyd**](https://rapyd.net/developers) is an API first, developer focused company. The [**Rapyd Dev Community**](https://community.rapyd.net) makes it easier to get started building payment and fintech experiences that makes global commerce possible.

---- 

## Share 🤝
[**Submit content ideas**](https://forms.gle/R5enobo8bMZE6PQr9)


[**Subscribe**](https://go.rapyd.net/dev-newsletter) to the Rapyd Newsletter and get inbox updates.
Music Monday — What are you listening to? (Long Trip Edition)
Tags: watercooler, discuss, music
Published: 2023-05-01 13:41:58

_cover image source: [Hollywood Suite](https://giphy.com/gifs/hollywoodsuite-waynes-world-3o6ZtjUZAD5Lf0QFLW)_

**This time around, I'd like to know what music you all listen to when you have a long journey ahead of you. Whether you're cruising down the highway in your car, flying through the clouds in an airplane, or coasting along the tracks on a train ride, I'm curious to know what y'all like to listen to when going on a long trip.** 🛩🚆🚗

![A woman dances in the car and is being silly](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ip61jm9e355ga4vjqa73.gif)

***

## How we do 

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others suggestions.

If you like talking about music, consider following the org [#music discussions](https://dev.to/music-discussions) for more conversations about music!

{% embed https://dev.to/music-discussions %}

***

Okay then, drop some tunes and let's start this journey... _Note: you can embed a link to your song using the following syntax `{% embed https://... %}`. This should work for most common platforms!_

Looking forward to listening to y'all's suggestions! 🎶
Authentication for apps -> How can utilize next-auth for authentication?
Tags: nextjs, react, webdev, javascript
Published: 2023-05-01 13:38:08

Log in using GitHub: https://poc-next-auth.netlify.app/

Authentication and Authorization is an integral processes to keep the application secure. Without proper authentication measures in place, unauthorized users could gain access to sensitive information or perform actions that could harm the application or its users.

Authentication can be done using the User's Google account or GitHub Apple etc.

How can we implement such an authentication process?
There are several ways to implement but today we can check how we can utilize the next-auth library for GitHub authentication and it can be extended to any other authentication (google, apple, Reddit etc).

Steps for GitHub authentication :
1.First, get Github Client ID and secret Id by creating a new OAuth app from (Setting ->Developer setting -> New OAuth app-> provide URL and callback URLs) then generate the client Id.

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

2.Keep the Client ID and secret ID in the env file (.env file)
# Authentication (NextAuth.js)

NEXTAUTH_URL=localhost:3000

NEXTAUTH_SECRET=

GITHUB_CLIENT_ID=

GITHUB_CLIENT_SECRET=

GITHUB_ACCESS_TOKEN=
3.

```
 // Keep  this Option in any folder(lib->auth.js)
   import GithubProvider from "next-auth/providers/github"

   export const authOptions = {
     // Configure one or more authentication providers
     providers: [
       GithubProvider({
         clientId: process.env.NEXT_GITHUB_CLIENT_ID,
         clientSecret: process.env.NEXT_GITHUB_CLIENT_SECRET,
       }),
       // ...add more providers here
     ],
     secret:process.env.NEXT_JWT_SECRET
   }
```
4.create a folder under (src->pages->auth->[...nextauth].js file and add these lines of codes.

```
import NextAuth from "next-auth"

import { authOptions } from "@/lib/auth"

// @see ./lib/auth
export default NextAuth(authOptions)
```
5.Then import sign/signout/ from next-auth/react and call on the login and signout button.

```
 import { signIn } from "next-auth/react"
   <button
             type="button"
              className="bg-white border border-slate-200 hover:bg-white-100 dark:border-slate-700 dark:text-slate-100 p-10 rounded"
              onClick={() => {
                signIn();
              }}
            >
              Login With GitHub
            </button>

```
With all these changes we will be able to GitHub log in.

DEMO URL: https://poc-next-auth.netlify.app/

CODE: https://github.com/Vijendra-Tech/poc_next_auth

Happy Coding :)
Why Javascript mcq is important?
Tags: javascript, mcq, webdev
Published: 2023-05-01 13:33:15



Multiple Choice Questions (MCQs) on JavaScript are important for a number of reasons:

1. Assessment of Knowledge: [Javascript MCQs](https://bbbootstrap.com/mcq/javascript-mcq-43545354) are an efficient way to assess the knowledge of an individual. They help to identify areas where a person needs improvement and areas where they excel.

2. Standardization: MCQs are standardized, meaning that each person is asked the same set of questions. This makes it easier to compare the results of different individuals.

3. Objective Evaluation: MCQs provide an objective way to evaluate a person's knowledge. Unlike subjective evaluation methods, such as essays or open-ended questions, MCQs do not require a grader to interpret the response.

4. Job Interviews: Many companies use MCQs as a part of their job interview process for hiring candidates. This helps them to filter out candidates who do not have the required level of knowledge.

5. Competitive Exams: MCQs are commonly used in competitive exams to test the knowledge of candidates. For example, many entrance exams for engineering, medical, or business schools use MCQs to evaluate the candidates.

In summary, MCQs on JavaScript are important for assessing the knowledge of individuals objectively and efficiently, as well as for job interviews and competitive exams.
DOMContentLoaded vs window.onload
Tags: webdev, javascript, beginners, programming
Published: 2023-05-01 13:32:21

You've been waiting for a friend to come and play, but they haven't come yet, you'd probably be bored and sad, wouldn't you?
![Sad Lonely GIF By Pokémon](https://media.giphy.com/media/7SF5scGB2AFrgsXP63/giphy.gif)That's a little like the way it works when you load your website. Your computer will have to open all the pictures, words, and videos that make up this website when you visit a Web site. It may take some time to put everything in order, especially if the site is large.
That is exactly what `DOMContentLoaded` and `window.onload` wants to avoid by making sure that everything on the website is loaded properly so that visitors don't have to wait for a long time to see the website.

**`window.onload` is like a signal that tells the website that everything has finished loading**. It's like your friend finally showing up to play after you've been waiting for a long time.

Here's an example of how window.onload works in code:

```JS
window.onload = function() {
  // This code will only run when the page has finished loading
  alert('The website is fully loaded!');
};
```

The DOMContent Loaded is a little bit of a different. It's like a **signal that tells the website that the basic structure has been loaded, but some of the pictures and videos may still be loading.** It feels like your friend's come, but so far they haven't brought all the toys. 
This is a code example of how DOMContentLoaded works.

```JS
document.addEventListener('DOMContentLoaded', function() {
  // This code runs when the basic structure of the page has loaded
  alert('The website structure has loaded!');
});
```
The basic contents that need to be loaded before the DOMContentLoaded event is fired are the elements that are required for the page layout and structure to be visible and functional to the user, while the other contents such as images and videos are usually considered secondary contents that can be loaded later without affecting the functionality of the page.

By using these events, website developers can make sure that the website loads as quickly as possible, and that visitors can start interacting with the website as soon as the basic structure is loaded. This helps to provide a better user experience and ensures that visitors don't get bored or irritated while waiting for the website to load.

In summary, window.onload and DOMContentLoaded are **signals that tell the website when everything is finished loading, or when the basic structure of the website is loaded**. It's like you're waiting for a friend to show up to play, and you're happy when he finally shows up.
![Happy Lets Go GIF By SpongeBob SquarePants](https://media.giphy.com/media/TdfyKrN7HGTIY/giphy.gif)

If you found this article helpful or informative, I would love to hear from you! Please feel free to leave a comment or like the post to let me know your thoughts. Your feedback is greatly appreciated. Thank you for reading!



My name is **Nwosa Tochukwu** and I'm a Junior **Front-end developer (REACTJS)**
Balancing Collaboration and Autonomy in a Distributed Tech Team
Published: 2023-05-01 13:27:19


Balancing collaboration and autonomy in a distributed tech team can be a challenge. On the one hand, collaboration is essential for creating a cohesive and productive team. On the other hand, autonomy is necessary to ensure that team members have the freedom to work in a way that suits their strengths and preferences. Here are some tips to help you balance collaboration and autonomy in your distributed tech team:

Set clear goals and expectations: It's important to establish clear goals and expectations for the team. This includes outlining specific tasks, deadlines, and performance metrics. Make sure that everyone understands what is expected of them, and provide regular feedback to help them stay on track.

Foster communication and collaboration: Communication is key to balancing collaboration and autonomy in a distributed tech team. Encourage team members to communicate regularly and collaborate on projects. This helps build trust and improves the quality of work produced.

Encourage autonomy: Autonomy is important for allowing team members to work in a way that suits their strengths and preferences. Encourage team members to take ownership of their work and to suggest new ideas and approaches.

Use project management tools: Project management tools can help you balance collaboration and autonomy in a distributed tech team. These tools allow you to assign tasks, set deadlines, and monitor progress in real-time. This helps ensure that everyone is on the same page and working towards the same goals.

Encourage feedback and learning: Encourage team members to provide feedback and to learn from each other. This can help improve collaboration and ensure that everyone is working towards the same goals.

Balancing collaboration and autonomy in a distributed tech team requires a combination of clear goals, effective communication, and the right tools. By following these tips, you can help your team work together effectively while also allowing for individual autonomy and creativity. Remember to foster communication and collaboration, encourage autonomy, and use project management tools to ensure that everyone is working towards the same goals.
Make Ruby code thread-safe
Tags: ruby, thread
Published: 2023-05-01 13:06:02

---
title: Make Ruby code thread-safe
published: true
description: 
tags: ruby, thread
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gyvoan9knpdju63rhfzx.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-05-01 12:52 +0000
---

For example, we have ruby-code that execs some I/O operations in a row (for instance, it runs 3 queries to database).

```ruby
class A
  def initialize
    @data = {}
  end

  # Run class and collect data to the hash
  def call
    do_1
    do_2
    do_3
    @data
  end

  private

  def do_1
    @data['1'] = exec_some_io
  end

  def do_2
    @data['2'] = exec_some_io
  end

  def do_3
    @data['3'] = exec_some_io
  end

  def exec_some_io
    time = (0.1..0.2).step(0.01).to_a.sample
    sleep(time)
    [1,2,3].sample
  end
end

puts A.new.call
```

In order to optimise code and reduce execution time, we can rewrite it and use [Thread](https://ruby-doc.org/core-2.5.0/Thread.html).

```ruby
class A
  def call
    [
      Thread.new { do_1 },
      Thread.new { do_2 },
      Thread.new { do_3 },
    ].map(&:join)
    @data
  end

  private

  def do_1
    @data['1'] = exec_some_io
  end

  def do_2
    @data['2'] = exec_some_io
  end

  def do_3
    @data['3'] = exec_some_io
  end
end
```

Please, don't write the code like that. Firstly, methods `do_1`, `do_2`, `do_3` know a lot of information about the data structure. Secondly, as we are using threads, we don't control context. It's dangerous and can produce errors in our application. In order to fix it, we have to use [value method](https://ruby-doc.org/core-2.5.0/Thread.html#method-i-value). It's easy to rewrite:

```ruby
class A
  def call
    @data = {
      '1' => Thread.new { do_1 },
      '2' => Thread.new { do_2 },
      '3' => Thread.new { do_3 },
    }.transform_values(&:value)
    @data
  end

  private

  def do_1
    exec_some_io
  end

  def do_2
    exec_some_io
  end

  def do_3
    exec_some_io
  end
end
```

Now, our ruby-code is thread-safe.
Amos's theory
Published: 2023-05-01 13:02:28

[https://www.bankfanz.com/kuda-bank-transfer-code/](https://www.bankfanz.com/kuda-bank-transfer-code/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)
https://plaza.rakuten.co.jp/kudabank2023/diary/202305010001/
https://peatix.com/user/17114937/
https://www.provenexpert.com/kuda-ussd-code-20236/
https://www.producthunt.com/@kudaussd37
https://www.divephotoguide.com/user/Kudaussdcode37
https://vocal.media/authors/amos-cypher
https://www.lifeofpix.com/photographers/kudaussdcode37/
https://seedandspark.com/user/kuda-ussd-code-2023-5
https://rosalind.info/users/Kudaussdcode37/
http://phillipsservices.net/UserProfile/tabid/43/userId/217026/Default.aspx
https://app.roll20.net/users/11929056/kuda-ussd-code-2
https://speakerdeck.com/kudaussdcode37
https://social.msdn.microsoft.com/Profile/Kuda%20ussd%20code%202023%2037
https://camp-fire.jp/profile/Kudaussdcode37
https://plazapublica.cdmx.gob.mx/profiles/Kudaussdcode37/activity
https://www.metal-archives.com/users/Kudaussdcode37
https://storium.com/user/kudaussdcode37
https://trabajo.merca20.com/author/kudaussdcode37/
https://www.intensedebate.com/people/Kudaussd37
https://www.mifare.net/support/forum/users/kudaussdcode37/
https://pinshape.com/users/2625397-kudaussd37
http://foxsheets.com/UserProfile/tabid/57/userId/130099/Default.aspx
https://www.kompasiana.com/kudaussd37
https://leanin.org/circles/kuda-ussd-code-2023-37
https://www.credly.com/users/kuda-ussd-code-2023.b337f33a/badges
https://www.myminifactory.com/users/Kudaussdcode37
https://www.sqlservercentral.com/forums/user/kudaussdcode37
https://www.longisland.com/profile/Kudaussdcode37
https://guides.co/a/amos-cypher
https://myanimelist.net/profile/Kudaussdcode37