teleren/devto huggingface dataset:
I wrote an article using OpenAI and received $100 for it
Tags: productivity, business, ai, career
Published: 2022-09-11 19:23:39

I was recently approached by a brand to write and publish a sponsored post about their business on my blog, [Inuidea.com](https://inuidea.com/). **In exchange for publishing the post, I'll receive $100.**

They told me to write a blog post about creating a budget, managing debts, and fixing bad credit scores.
I was procrastinating that day (probably due to fatigue), so I came up with a smart solution and did some smart work.

Furthermore, I wanted to write and publish the post as soon as possible without having to do any research.
So I logged into OpenAI and started giving different prompts for different parts of the blog post.

**For example,**

- Write a blog post about creating a budget.
- Write a blog post about debt management.
- Write a blog post about fixing bad credit scores.


![OpenAI prompt and output example. Photo by Inu Etc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1h8wr0hcuh4bo0mydkl8.png)

These are the prompts I gave. All that was left was to mix those outputs and do some proofreading and editing, and that was it - a perfect blog post about creating a budget, managing debts, and fixing bad credit scores.

**Take a look at the post I made with OpenAI:**
- [How to create a budget, manage debts, and fix bad credit scores](https://inuidea.com/create-a-budget-manage-debts-and-fix-bad-credit-scores/)

## The lessons I learned after writing a blog post using OpenAI:

To write a long blog post using OpenAI, you need to divide the post into sections, give AI different prompts for each section, and write each section separately. Once everything is mixed together, you'll have the perfect long blog post.

Aside from that, OpenAI and other AI writing tools might take information from other websites, so it might produce plagiarised content. However, you can make 100% original content by editing and proofreading it.

## Final thoughts

With artificial intelligence, our lives can be made easier.

A blog post I wrote in half an hour using AI made me $100 in an hour. Due to fatigue, I may have rejected the offer made by that brand that day. But because of AI, I decided to accept the offer, and I did a great job with its assistance. I was happy and so was the brand. Thanks to OpenAI. 💚

Thanks for reading this post.

If you are a writer or a tech enthusiast I suggest you try OpenAI, [CopyAI](https://inuidea.com/go/copyai/), and other AI tools.

If you have any questions or if you wanna [work with me](https://inuetc.com/work-with-me/), feel free to [contact me](https://inuetc.com/contact/).
Gamification in your daily development
Tags: gamification, achivements, development
Published: 2022-09-11 19:09:35

Development is fun and if you want to spice it up you could make a gamification plan for your developers. I have used this in some companies I have worked in and this is a fun way to add gamification in your daily development.

This is not something that is mandatory and everyone can choose if they want to participate or not.


### Gamification plan
Below is an example of some gamification for app development with five different levels, where level 1 is easiest and for each level it gets harder. It's easy to change this to a frontend, backend, or Cloud gamification plan.

### Rewards
It's important with rewards and I have worked with stickers that you can put on your computer. The stickers can symbolize how much work and effort you have put into this and can be used to show others.

### Rules and questions
There are a couple of rules that you can apply:
1. Retroactive: this is the question I mostly get and I always answer it's okey to go back three months but the idea with this is for everyone to start at the same level
2. Do I need to present what I have done for a level? No, your words is enough. Speak with your Scrum Master or Project Manager who will vouche for you and you´ll get a sticker
3. Is this mandatory? No, this is absolutely not mandatory
4. Do we need to have 5 levels? No of course not, choose whatever suits your company/group


### An example of an App Development gamification plan
 
| Level 1 | Level 2 | Level 3 |  Level 4 | Level 5 |  
|-----------|-----------|-----------|-----------|-----------|  
|Download IDE and create a project|Estimate a task|Contribute to the app coding guidelines (new section or feedback on existing)|Build an app using a Continuous integration tool|Create an app using Kotlin or SwiftUI|
|Compile project and run on a simulator|Join an app project|Host a knowledge sharing session|Create necessary certificates<br>Sign the application<br>Publish the app in stores|Host a meetup|
||Compile a project and run on a device|Distribute an app to testers using the chosen distribution tool|Mentor a new dev|Migrate or upgrade a major version of a project's platform SDK (iOS or Android)|
||Attend an app meetup|Release an app|Contribute to the open source community by uploading >= 3 public repositories to Github|Publish a public repository or create a third party library thru any dependency manager|
||Work in a project with >= 2 developers|Review a pull Request|Work in a project with >= 5 developers|Release your first app|
||Escort a task from todo to done|Create a flowchart describing a feature|Go to a developer conference|Released a second generation of an app|
||||Solve 10 reported bugs|Answer 50 questions on StackOverflow|
||||Answer 20 questions on StackOverflow|Create a CocaPods library and publish it|
|||||Create your own app and publish it to the store|


### Summary
Any comments, questions or discussions are always welcome!
The right way to build things
Published: 2022-09-11 18:59:28

---
title: The right way to build things
published: true
description: 
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ri6j4busbzxpf9qfbop6.png
canonical_url: 'https://kevwe.com/weekly/202237'
---
You might argue that, so far as you manage to build what you need, the process is not important.


Besides, the experience teaches that much of what takes us time in doing, needs to be enjoyable and meaningful.


Otherwise, the result will often end up showing the pains and unpleasantness of the process: you can't hide it.


And also: why hiding it in the first place?


There is so much to it in real life, and in the work of software development there is more: nothing is ever done, everything is part of an iterative process.


The aim is perfection, but the building material is sand: you need to like building things if you want to get anywhere.


Also, since there is so much to the process being part of the result, refrain from any ready-made all-comprehending solutions: you can use basic things and build your own tools all the way up to the great creations.


Out of the metaphor: you don't need Github, $giantballofframework or $somecrazyorchestrator to build something meant to lasts:


https://kevwe.com/weekly/202237
Primitives and References in JavaScript.
Tags: javascript, webdev, tutorial, react
Published: 2022-09-11 18:04:19

**Primitive**
String, boolean, number are primitive type.
Let's take a look at an example of it:
```
let number = 1;
let num2 = number;
number = 2

console.log(num2);

Output:
1
```
Here, whenever we are assigning the variable 'number' to the variable 'num2', we are actually copying the value of 'number' to the variable 'num2'. So even if we change the value of variable 'number', it won't affect the value of 'num2'. And this behaviour is called primitive.

**Reference**
Array and objects are reference type in js.
Let's look at an example.
```
const person = {
    name: 'Max'
}

const secondPerson = person;
person.name = "Ajith"
console.log(secondPerson)

Output:
{ name: 'Ajith' }
```
In the above code block, the object 'person' is assigned to the variable 'secondPerson'. And then we change the value of name in object 'person' from 'Max' to 'Ajith'. And then we console the secondPerson, we can see that the value of secondPerson has also changed. It is because, the variable 'secondPerson' actually stores a pointer which points to the memory location of the object 'person'. So whenever we change something in 'person', it will also affect 'secondPerson'.

In order to avoid this behaviour, we can use [spread operator](https://dev.to/sujithvsuresh/rest-and-spread-operator-in-javascript-es6-3gd8) to copy the values inside an array or object to a new array or objects which is assigned to a new variable.
3D Science Gallery
Tags: codepen
Published: 2022-09-11 17:57:35

<p>A CSS art gallery you can look around. Images of pure CSS art, but unfortunately peoples computer would explode if I didn't use images. Everything else is pure CSS though. </p>

<ul>
<li>There are a few Easter Eggs scattered about.</li>
</ul>

<p>A very short video of some of the coding:

{% codepen https://codepen.io/harunpehlivan/pen/GRdqMxQ %}
Generic Methods with Generic Parameters in c#
Tags: dotnet, csharp
Published: 2022-09-11 17:55:37

**The challenge**
Make a method to calculate the Min. Difference in a list of numbers.

- The input can be an Array, List, HashSet, IEnumerable
- The size unknown
- The type of number is unknown as well (int, long, float, double,...)

So we are looking to create a truly generic method

## The Code
```
public static T MinDifference<T>(this IEnumerable<T> numbers) 
{
   int count = 1;
   var _n = numbers.Cast<dynamic>().ToList();
   _n.Sort();
   return (T)_n.Skip(1).Min(n => n - _n[count++ - 1]);
}
```

## Explanation

- The return type of the function is **T** (Generic)
- Parameter is **IEnumerable&lt;T&gt;**  (Generic)
- Cast the parameter numbers as a **dynamic List**, this will allow you to make the calculations.  when you keep simply **T**, you will get an error when you try to subtract the numbers.
- Cast the result to **T**

## Result

```
List<int> _dividors = _n.GetAllDividors().ToList();
_dividors.MinDifference();

HashSet<double> _ht = new HashSet<double>();
    _ht .Add(1.1);
    _ht .Add(0.2);
    _ht .Add(0.4);
    _ht .Add(1);
    _ht .Add(0.1);
double _r1 = _t1.MinDifference();

decimal[] _dec = new decimal[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var _rdec = _dec.MinDifference();

Array _dividors2 = _dividors .GetAllDividors().ToArray();
_dividors2.MinDifference();
```

**Whatever type of list of numbers you use, the size of the list, you used 1 method.**
HOW TO START AND STOP A NGINX SERVER FROM MY KALI LINUX VM
Tags: nginx, vm, linux, devops
Published: 2022-09-11 17:46:15

As I was revisiting my notes about Linux processes I decided to post this about a simple setup for a Nginx server from my Kali Linux Virtual Machine.

## **Prerequisites**
1. Have a virtualised environment i.e Virtual Box and your preferred Virtual OS, I am using Kali Linux on my Oracle Virtualbox.
2. A command line interface/terminal.
3. Sudo access(never run your services as root.

**Check if NGINX is installed**
kali> sudo apt list ¦ grep -t nginx
If not available, download using 
kali>sudo apt-get install nginx

**Find the running processes 
a= all processes, u=user that it belongs to, x=processes not executed**
kali> sudo ps -aux

**Find if nginx is up and running**
kali > sudo ps -aux ¦ grep nginx

**Start up the nginx server**
kali> sudo systemctl start nginx

**Review if your nginx server is up and running**
kali> sudo systemctl status nginx

**Review if your nginx server is up and running on a tab**
**First get your machine's ip address**
kali> sudo ip address
-Paste your ip address on a terminal and search it, if the page is up and running, it will display a generic welsome page.

**Stop up the nginx server**
kali> sudo systemctl stop nginx

That's it, look up for more updates as I learn how to launch more complex servers.
Что нового в AIT-3
Published: 2022-09-11 17:31:54

Несколько новых функций находятся на тестировании у участников AIT-3. См. ниже:

## Petra (кошелек Aptos)

- Petra, новый кошелек Aptos, теперь доступен как расширение веб-приложения Chrome. Вы будете использовать этот кошелек для участия в стейкинге и управлении в AIT-3. Смотрите инструкции по установке Petra [здесь](https://dev.to/egormajj/rukovodstvo-po-ustanovkie-rasshirieniia-petra-5hb).

## Владелец, оператор и участник голосования
Участие в стейкинге и управлении теперь возможно с тремя персонами: владелец, оператор и участник голосования.

**Владелец**: Владелец - это владелец средств. Например, владелец Bob может назначить свой адрес оператора на учетную запись Alice, доверенного оператора валидатора. См. также раздел [Как владелец может делать стейкинг на Aptos](https://dev.to/egormajj/kontsieptsii-aptos-steikingh-1b4a). Учетная запись владельца содержит настройки валидатора и coins. Coins поступают на учетную запись владельца аирдропом.

**Оператор**: Если вы являетесь владельцем, то, используя свой ключ владельца, вы выбираете конкретного оператора и:

  - управлять настройками конкретного валидатора, и
  - Делегировать пул стейкинга валидатору.
  - Открытый ключ оператора - это тот же ключ, который вы (владелец) использовали при регистрации ноды валидатора на  Aptos Community Platform. Это `account_public_key` из файла "aptosbot.yaml" для валидатора.

**Участник голосования**: Участник голосования - это новая персона, вводимая в AIT-3. Владелец может назначить участника голосования. Это позволяет участнику голосования участвовать в управлении. Вы будете использовать ключ участника голосования для подписи голосов за управление в транзакциях.

## Стейкинг

- Новый пользовательский интерфейс для управления стейкингом упрощает управление стейкингом.

## Сетевое управление
Сообщество для голосования по предложениям. Предложения будут касаться следующих областей:

- Конфигурация блокчейна в сети, например, длительность эпохи.
- Конфигурация стейкинга, например, размер вознаграждения.
- Конфигурация управления, например, требование к количеству голосов.
- Обновление модулей перемещения.
JavaScript Date Cheatsheet
Tags: javascript, webdev, beginners, programming
Published: 2022-09-11 17:23:31

Getting our dates right and proper order has always been a tough job for us developers, me, specially. So here is the JavaScript Date Cheatsheet by me. It contains most of the methods that we can use to mold the date into our desired format.

_I have not mentioned the outputs here. That are for you to see and experience 😉_
[Link to working code](https://github.com/mursalfk/web_snippets/blob/main/articleCodes.html)
### JS Get Date Methods
```javascript
todayDate.getDate()
todayDate.getDay()
todayDate.getMonth()
todayDate.getFullYear()
todayDate.getYear()
todayDate.getHours()
todayDate.getMinutes()
todayDate.getSeconds()
todayDate.getMilliseconds()
todayDate.getTime()
todayDate.getTimezoneOffset()
```

### UTC - Universal Time Coordinated
```javascript
todayDate.getUTCDate()
todayDate.getUTCDay()
todayDate.getUTCMonth()
todayDate.getUTCFullYear()
todayDate.getUTCHours()
todayDate.getUTCMinutes()
todayDate.getUTCSeconds()
todayDate.getUTCMilliseconds()
```

### JS Set Date Methods
```javascript
todayDate.setDate(15)
todayDate.setMonth(11)
todayDate.setFullYear(2021)
todayDate.setHours(10)
todayDate.setMinutes(30)
todayDate.setSeconds(30)
todayDate.setMilliseconds(500)
todayDate.setTime(1000000000000)
```

### JS Date Parse Methods
```javascript
todayDate.toString()
todayDate.toDateString()
todayDate.toLocaleString()
todayDate.toGMTString()
todayDate.toUTCString()
```
Asynchronous in JavaScript
Tags: javascript, node, webdev, beginners
Published: 2022-09-11 17:16:38

Asynchronous Programming in javascript is simply done with callbacks.

Callbacks are functions that called inside the other function.

Asynchronous programming uses multiple tasks running in parallel with no delay between them. This makes any application faster because waiting on UI events stops its performance from dropping

3 Things to know in Asynchronous in Javascript:

- Promises (new in ES6)
- Async Await which was introduced in 2017
- For /await loop added in 2018

Read More : [Asynchronous in JavaScript with Examples](https://tronlab.in/asynchronous-in-javascript/)
How to Run Playwright test case in CI/CD Jenkins
Tags: javascript, tutorial, testing, career
Published: 2022-09-11 16:56:20

In this blog, I will talk about the Integration of Playwright with Jenkins. Jenkins is a self-contained, open-source automation server that can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.

For more detail please follow the below link
https://qaautomationlabs.com/how-run-playwright-test-case-in-jenkins-pipelines/
Allure report Integration with Playwright
Tags: javascript, programming, testing, opensource
Published: 2022-09-11 16:54:36

Why is Allure Reporting to Playwright? 

   

-  Easy to install
-  Allure reports provide great presentational diagrams
-  Clear and nice reporting UI
-  Can easily investigate test run

**For more detail **how we integrate Allure report with Playwright Follow below links

https://qaautomationlabs.com/allure-report-integration-with-playwright/
React & Vue Virtual DOM vs Shadow DOM - Summary
Tags: react, webdev, beginners, vue
Published: 2022-09-11 16:48:21

It is a bit like the differences between Java and JavaScript!

## Virtual DOM

- a copy of the entire real DOM and is implemented on top of browser APIs.
- used by libraries like React and Vue to address the problem of changing the DOM while keeping optimal performances.
- plain JavaScript apps don’t use the virtual DOM.

## Shadow DOM

- inherent in web components and browser APIs.
- a piece of DOM that is “fenced” in its own web component.
- might be used while using libraries like React and Vue, or frameworks like Angular.

## More Info

This is a super short summary of a longer article that I published on Medium. 
You can find the article at [React Virtual DOM vs Shadow DOM: What’s the Difference?](https://javascript.plainenglish.io/react-virtual-dom-vs-shadow-dom-whats-the-difference-b51a480d2c70)

I am experimenting with this straight-to-the-point summary. 
Let me know what you think!
Apache Apisix API Gateway — A walkthrough!
Tags: apisix, apigateway, kubernetes, gatewayapi
Published: 2022-09-11 16:45:43

This is the second instalment of “**_Learning API Gateways_**” series. In the last episode, we learnt about the **_[Tyk Api Gateway](https://dev.to/sanjitun/tyk-api-gateway-a-walkthrough-1npp)_**. Below I’m leaving behind some of the relevant links; do checkout these, if you haven’t yet!

1. Industry landscape of Api Gateways — https://sanjimoh.medium.com/api-gateway-landscape-347b91639f0b

2. A walkthrough of Tyk Api Gateway — https://dev.to/sanjitun/tyk-api-gateway-a-walkthrough-1npp

My focus has been around Kubernetes platform & how each of the industry API Gateways natively support it.

In today’s episode of Learning API Gateway series, I’ll take you through — **_<u>Apache Apisix Api Gateway</u>_**. You can find the video of this episode in the bottom of this article.

Hope you all find it useful!

**Note :-** Support for Kubernetes Gateway Api exists in Apache Apisix; however there are some caveats -

- I felt its documentations could be organised better to make it more accessible; especially finding notes around its support for Kubernetes Gateway API wasn’t really an easy task. You need to install Apisix in a specific way to enable it’s support for Kubernetes Gateway API & this wasn’t very obvious for me to start with.

- With the current Apisix SW version, deletion of Kubernetes Gateway httproutes resource doesn’t delete the corresponding Apisix route configurations. I created a GitHub ticket for the same and learnt that this feature is going to be available with the newer version of Apisix (1.5.0) which is yet to be released.

{% youtube p1n7JHadxws %}
ymlOverride
Published: 2022-09-11 16:33:00

i am trying to create an yaml file and pass inputs to jenins file like kind of trying to read content in jenkinsfile and doing find and replace of particular parameter from yaml file that i write.

for that i need on how to write a pipeline script / pattern build in jenkins file,i am using jules similar and customized from jenkins ,coudl say both are same.

could any one please explain or give some example on how to use ymlOverride and override in jenkinsfile.

if possible please share any documents or videos to refer.
Beginners Guide to Crypto
Tags: crypto, career
Published: 2022-09-11 16:23:56

Here’s everything you need to know about getting started on the crypto space.
Ever been curious about how you can transition into the crypto and NFT space and you didn’t know where to start from?
Seek no more, you can use the link below to get started on the basics of crypto, how to get crypto jobs, how to navigate the crypto space and how to make money on the crypto space.

https://medium.com/@olahisrael07/beginners-guide-to-crypto-beginner-to-advance-vol-1-f3b69b4af32d
Javascript: Clone object
Tags: javascript, webdev, beginners, programming
Published: 2022-09-11 16:20:19

Different ways to `clone object` without using third-party libraries.

Using `Spread Operator`:

```javascript
const example = {first: 1, last: 10};

const {...clonedExample} = example;

clonedExample
> {first: 1, last: 10}

clonedExample.first = 2;
> 2

clonedExample
> {first: 2, last: 10}

example
> {first: 1, last: 10}

```

Using `Object.assign()`;

```javascript

const example = {first: 1, last: 10};
const clonedExample = Object.assign({}, example);

clonedExample
> {first: 1, last: 10}

clonedExample.first = 2;
> 2

clonedExample
> {first: 2, last: 10}

example
> {first: 1, last: 10}

```

Using `JSON.parse`:

```javascript
const example = {first: 1, last: 10};
const clonedExample = JSON.parse(JSON.stringify(example));

clonedExample
> {first: 1, last: 10}

clonedExample.first = 2;
> 2

clonedExample
> {first: 2, last: 10}

example
> {first: 1, last: 10}

```

In above methods, first two can't achieve deep cloning of objects. Only first hand objects muted not the nested objects whereas deep cloning achieved only using `JSON.parse`. 

see below example:

```javascript
const example = {first: 1, last: {nested: 3}};

// Using Spread
const {...clonedExample} = example;

clonedExample.last.nested = 5;
> 5

clonedExample
> {first: 1, last: {nested: 5}}

example
> {first: 1, last: {nested: 5}}

// Using Object.assign
const clonedExample = Object.assign({}, example);

clonedExample.last.nested = 5;
> 5

clonedExample
> {first: 1, last: {nested: 5}}

example
> {first: 1, last: {nested: 5}}

// Using JSON.parse
const clonedExample = JSON.parse(JSON.stringify(example));

clonedExample.last.nested = 5;
> 5

clonedExample
> {first: 1, last: {nested: 5}}

example
> {first: 1, last: {nested: 3}}

```

You can follow me here: https://twitter.com/urstrulyvishwak

Thanks.