teleren/devto huggingface dataset:
Vauld Referral Code FREE100 Get Free Token
Tags: vauld, referral, code, vauldreferralcode
Published: 2022-04-04 14:45:37

Vauld Referral Code Get Free Cash Bonus. "FREE100" is the most recent Vauld referral code, which you can use to earn referral fees by introducing friends to this marketplace. Crypto is a volatile asset growing in popularity nowadays, especially because it is decentralized. Vauld is one such Singapore-based application. It has been newly launched in India to invest in cryptocurrency. It provides several things such as information, tools, and guidance to help you become a successful investor.
 
Vauld is a Singapore-based application that has been newly launched in India to invest in cryptocurrency. It provides several things such as information, tools, and guidance to help you become a successful investor.

[Vauld Referral Code](https://www.hindustantimes.com/brand-stories/vauld-referral-code-free100-earn-40-bonus-12-interest-101646398102992.html)
[Vauld Referral Code](https://www.dnaindia.com/business/report-vauld-referral-code-free100-get-free-40-discount-on-trading-2920973)
[Vauld Referral Code](https://theprint.in/theprint-valuead-initiative/use-this-vauld-referral-code-to-earn-interest-bonus-on-bitcoin-other-cryptocurrencies/840607/)
[Vauld Referral Code](https://coupenyaari.in/vauld-referral-code-earn-free/)
Be Careful About Timezones In Backend and Frontend Development
Tags: javascript
Published: 2022-04-04 14:33:18

Dear Devs, 

Today I ran into an issue regarding  timezones 
When I was working on the local host the backend , frontend(browser) and the database all ran on the same machine which is my laptop in a single timezone.

But when I push to production the dates in the backend and the dates in the frontend was 5 hours apart. 
This is because the server and the frontend resided in different time zones. 

I checked the backend code and the database they were fine , and the frontend code also didn't show any issues.

When I checked my Javascript code it was using 

```
	<h4>{new Date(startTime).toLocaleTimeString()}</h4>
```
which uses local-time which adds 5 hours to the start time
So instead I used UTC time.  

the backend code was using UTC time 
    
**So make sure you pay attention to timezones configurations in your database , backend and frontend according to your use case and your execution environments. **

here are some articles that helped me 
https://www.ursahealth.com/new-insights/dates-and-timezones-in-javascript
https://stackoverflow.com/questions/24192558/incorrect-timezone-from-server-side-to-javascript

Photo Credit Donald Wu on Unsplash
I'm looking for a Developer Advocate Role
Tags: advocate, programming, career, showdev
Published: 2022-04-04 14:32:25

Hi, everyone. My name is Daniel Reis, aka. "danielhe4rt", I'm Brazilian and I'm looking for a Developer Advocate/Evangelist role.

I’m passionate about connecting people into the most diverse technologies and I see a greater way to do it by raising inclusive communities.

Some important informations about me:

- Studying programming since 2011;
- I have been in the Web Development as a dev for 4 years (PHP/Laravel);
- I’ve been leading a Technical Community (He4rt) with more than 12.000 members for almost 4 years now;
- I have been doing live coding for almost 4 years and I got Twitch Partnership with an average of 140 viewers (22.000 followers);
- Four technical articles submitted to dev.to over the past year with more than 8000 views;
- Content produced for YouTube audience on a channel with currently 3k subscribers;
- Joined on Microsoft MVP Program in 2020;
- I’ve participated in two talks in important events (PHP Community Summit, GitHub Presente) and I’m willing to get into Brazilian Universities to talk more about the importance of communities.
- My goal is to make a diverse and inclusive environment for everyone that wants to become a developer.


I found a passion like no other participating in communities and helping other people in the area. Being able to be the difference and inspire other people took me here. I want to do more, and I’m looking for a new home to allow me to in this journey.

He4rt Developers: [https://heartdevs.com](https://heartdevs.com)
LinkedIn: [https://linkedin.com/in/danielheart](https://linkedin.com/in/danielheart)
Portfolio: [https://danielheart.dev](https://danielheart.dev)
MVP Award Contribution Page: [https://mvp.microsoft.com/en-us/PublicProfile/5004001](https://mvp.microsoft.com/en-us/PublicProfile/5004001)
DevTo: [https://dev.to/danielhe4rt](https://dev.to/danielhe4rt)
Twitch Channel: [https://twitch.tv/danielhe4rt](https://twitch.tv/danielhe4rt)
YouTube Channel: [https://youtube.com/danielhe4rt](https://youtube.com/danielhe4rt)
Twitter (most in PT-BR): [https://twitter.com/danielhe4rt
](https://twitter.com/danielhe4rt
)
Personal Developer Roadmap: [https://roadmap.danielheart.dev](https://roadmap.danielheart.dev)
Project Tracking?
Tags: management, help, productivity
Published: 2022-04-04 14:29:07

Can anyone recommend a tool, approach, philosophy, a combination of all three, or something else entirely to help with project tracking? I'm not looking for full-blown project management (I hope), just something to keep track of what's done, what's next, and maybe miscellaneous ideas for future versions. I've been using my To-Do list for this, but that is really not working. Most of my projects are solo, personal interest type stuff, but I occasionally collaborate with a friend of mine as well. I'd be interested in hearing how others handle this situation.
Sorting in JavaScript
Published: 2022-04-04 14:17:51

Sorting a list or array has many uses in web applications, from lists to tables, it is very useful. Let's look at some of the ways data can be sorted in JavaScript

---

For sorting data in javascript, we make use of the sort() function and its parameters.

# Sorting an Array of Strings

The most common application of sorting is when a list or table needs to be sorted alphabetically. There are a number of ways to achieve this. 

### Sorting A-Z

This is quite simple and the sort() function will automatically sort and array of strings A-Z. No other parameter is required in this case.

```javascript
const data = ["Banana", "Orange", "Apple", "Mango"];
const sort = data.sort()
console.log(sort)
// ["Apple","Banana","Mango","Orange"]
```

### Sorting Z-A

This is a little longer to achieve but quite simple. We will pass a function within the sort() that will sort the array into descending order. 
There are a number of ways to achieve this.

- 1. 
 Reversing the sorted Array
To sort the array into descending order, we can simple reverse the array we sorted in ascending order

```javascript
const data = ["Banana", "Orange", "Apple", "Mango"];
const sort = data.sort().reverse()
console.log(sort)
//["Orange","Mango","Banana","Apple"]
```

- 2.  
Manually comparing using parameters

You can also run a function within the sort function that checks two items for the greater one and returns a value

```javascript
const data = ["Banana", "Orange", "Apple", "Mango"];
const sort = data.sort((a, b) => (a > b ? -1 : 1))
console.log(sort)
//["Orange","Mango","Banana","Apple"]
```

We are using inline conditional statements here.
- 3. 
 The localCompare function

The localeCompare() method returns sort order -1, 1, or 0 (for before, after, or equal).

```javascript
const data = ["Banana", "Orange", "Apple", "Mango"];
const sort = data.sort((a, b) => b.localeCompare(a))
console.log(sort)
//["Orange","Mango","Banana","Apple"]
```

# Sorting an Array of Numbers

Sorting numbers in javascript is pretty simple and can be done by  running a compare function within the sort()

### Sorting numbers in Ascending order

```javascript
const data = [5,1,6,9,3];
const sort = data.sort((a, b) => a-b)
console.log(sort)
//[1,3,5,6,9]
```

### Sorting numbers in Descending order

```javascript
const data = [5,1,6,9,3];
const sort = data.sort((a, b) => b-a)
console.log(sort)
//[9,6,5,3,1]
```

----

Thanks for reading!
Check out the complete in depth Hubpages tutorial on this topic:
>[Sorting in React JS](https://discover.hubpages.com/technology/creating-a-sortable-list-in-react-js)
Cheers
How to change a file locally without commit it on Git
Tags: git, programming, webdev, productivity
Published: 2022-04-04 14:12:16

## Scenario
I wanted to freeze a file in git, so that when someone commits, this file is not updated.
The scenario was something like that: I need an ENV variable that usually will be available only on CI/CD to take the right token but on the local side I don't need it.

## The Problem
So I want a file that will be on my repository, and will be versioned but I want to change it on the local side and not commit it (I can skip it every time without include it on `git add` but it's so boring and in long term will not work).
I tried a different hack solution like `.gitignore` but it did not work.
So I read some documentation and I discovered the [`update-index`](https://git-scm.com/docs/git-update-index) option on git.

## How update-index works
With this command:
`git update-index --assume-unchanged <file>`
Are you basically changing the [`assume unchanged bit`](https://git-scm.com/docs/git-update-index#_using_assume_unchanged_bit) and are you forcing Git to pretend it never changes. 
In this way Git will exclude this file from any tracking, so you can modify it on the local side and basically forget it. 

If you want to came back to the "normal version" u can easily exec this command:
`git update-index --no-assume-unchanged <file>` 
and everything will come back like before.

If u want to check what kind of files are with this active flag you can easily run:
`git ls-files -v`
Files where the flag is `--assume-changed` have `H`, `--assume-unchanged` is `h`.
Do you get burnout?
Tags: help, productivity, mentalhealth
Published: 2022-04-04 13:42:01

If you’re a developer, lead, or manage them, please take my @StateOfDevs survey about burnout.

I like to help our community recover from it.

Short survey w/ optional Qs. 👇🏾
https://stateofdevs.com/survey/helps/devto-crew
I'll share the results once I hit my 500 devs goal.


> 🎂  **Oh, it's my BIRTHDAY!** Can you help me ***get 100 devs*** to [take my survey](https://stateofdevs.com/survey/helps/devto-squad)?

---

*Short on time, here's a poll instead* 👇🏾 
{% twitter 1510974782082273280 %}
Swift - Optional Chaining
Published: 2022-04-04 13:40:15

- Optional chaining is a process for querying and calling properties, methods, and subscripts on an optional that might currently be nil. 

- If the optional contains a value, the property, method, or subscript call succeeds; if the optional is nil, the property, method, or subscript call returns nil. 

- This is very similar to (!) forced unwrapping of its value. The main difference is that optional chaining fails gracefully when the optional is nil, whereas forced unwrapping triggers a runtime error when the optional is nil.

- The result of an optional chaining call is always an optional value, even if the property, method, or subscript you are querying returns a non-optional value.

example :

``` swift
class Person {
    var residence: Residence?
}
```

``` swift
class Residence {
    var rooms: [Room] = []
    var numberOfRooms: Int {
        return rooms.count
    }
    subscript(i: Int) -> Room {
        get {
            return rooms[i]
        }
        set {
            rooms[i] = newValue
        }
    }
    func printNumberOfRooms() {
        print("The number of rooms is \(numberOfRooms)")
    }
    var address: Address?
}
```

``` swift
class Room {
    let name: String
    init(name: String) { self.name = name }
}
```

``` swift
class Address {
    var buildingName: String?
    var buildingNumber: String?
    var street: String?
    func buildingIdentifier() -> String? {
        if let buildingNumber = buildingNumber, let street = street {
            return "\(buildingNumber) \(street)"
        } else if buildingName != nil {
            return buildingName
        } else {
            return nil
        }
    }
}
```

``` swift
if let beginsWithThe =
    john.residence?.address?.buildingIdentifier()?.hasPrefix("The") {
    if beginsWithThe {
        print("John's building identifier begins with \"The\".")
    } else {
        print("John's building identifier doesn't begin with \"The\".")
    }
}
```
I created rattle 🐍🐍🐍password_generator
Tags: webdev, python, showdev, productivity
Published: 2022-04-04 13:16:23

Hello Developers i created rattle password_generator.In everytime it generate a different password and it didn't store it in any database or servers .The site is open-source you can view it in my github account and clone it or download it directly from our 
website if you have any doubt contact me through my email id.

website- https://rattleofficial.github.io
github- https://github.com/rattleofficial
email- rattlefoundation@gmail.com
Do you need the decoding attribute?
Tags: image, html, performance
Published: 2022-04-04 13:06:29

Do you know the `decoding` attribute for images? You can combine it with the `loading` attribute like that:

```HTML
<img alt="" src="" decoding="async" loading="lazy">
```

[Source: MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding)

There are 3 possible values: 

* `sync`: force synchronous decoding
* `async`: force **a**synchronous decoding
* `auto`: let the browser decides (~ no preference) - the defaut value

[Browser support](https://caniuse.com/mdn-html_elements_img_decoding) is not that bad (~ 66% at the time of writing).

Pratically speaking, when the `decoding` attribute is set to `async`, the browser can parallelize the image decoding process, which might significantly improve the page rendering, as it can be an expensive operation, especially with large images.

`async` puts image decoding off the main thread and can thus save some CPU. As far as I know, it's safe to use even with browsers that do not support it yet.

Actually, `async` is not the default value probably because of some edge legacy issues, but I don't see why you would not use it in most cases.
React Native Text Cycler using reanimated
Tags: reactnative, reanimated, animations, mobile
Published: 2022-04-04 13:04:54

Below is a code snippet on how to make a text looping effect in React Native with reanimated for animations.

Check out the snack example [here](https://snack.expo.dev/@nyashanziramasanga/text-cycler)

```javascript
import React, { useEffect, useState } from 'react';
import { StyleProp, TextStyle } from 'react-native';
import Animated, { FadeInDown, FadeOutUp } from 'react-native-reanimated';

const TextCycler = ({
  items,
  textStyles,
  duration = 3000,
  textColors = ['#000000'],
}) => {
  const [index, setIndex] = useState(0);
  const numberOfItems = items.length;

  useEffect(() => {
    const timeout = setInterval(() => {
      setIndex((previousIndex) => {
      // if last item in the array the index is set to 0 meaning start again (looping effect)
        if (previousIndex === numberOfItems - 1) return 0;

        // go to next index
        return previousIndex + 1;
      });
    }, duration);

    // cancels repeating timer
    return () => clearInterval(timeout);
  }, [duration, numberOfItems]);

  return (
    <Animated.Text
      key={index}
      entering={FadeInDown}
      exiting={FadeOutUp}
      style={[textStyles, { color: textColors[index] }]}>
      {items[index]}
    </Animated.Text>
  );
};

export default TextCycler
```
How to make two Arduinos communicate over serial.
Tags: arduino, cpp, robotics, electronic
Published: 2022-04-04 13:04:08

As we all know, an Arduino can't handle too many sensors and calculate all of them without freaking out, so sometimes we need to out source a sensor to other Arduino and let it calculate a value and send it to us in the master.

#Wiring 


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

RX  ===> TX
TX  ===> RX
GND ===> GND


I needed to send data to the other Arduino, and make it calculate it and send it over to me in the master.

#Master code
```c++
char number  = ' ';
String message = "";
bool send_data = true;
void setup()
{
  Serial.begin(9600);

}

void loop()
{
  
  while(send_data){

  Serial.println("Little bord Hi!! ");

   readData();
  delay(2000);
  if(message != ""){
      if(message == "2222"){
      send_data = false;

      Serial.println("Message received");
      Serial.println("******************");
      Serial.println(message);
      Serial.println("******************");
      }
  }
      message = "";

  }


}

void readData(){
  while(Serial.available()){

   if(Serial.available())
   {
      char number = Serial.read();
      message += number ;
   }
  }
}
```
#Slave code
```
char number  = ' ';
String message = "";
bool is_not_sent = true; 
void setup() 
{
  pinMode(LED_BUILTIN, OUTPUT);
   Serial.begin(9600);
   Serial.println("START");
}
 
 
void loop()
{


 readData();
  delay(2000);
 if(is_not_sent)
  {
    if(message != ""){
      message = "Big bro said : " + message;
      // Serial.println(message);
      digitalWrite(LED_BUILTIN, HIGH); 
      delay(500);
      Serial.print(2222);
      delay(500);

      // Todo check wach correct data
      is_not_sent = false;
      message = "";
  }
  }
}



void readData(){
  while(Serial.available()){

   if(Serial.available())
   {
      char number = Serial.read();
      message += number ;
   }
  }
}
```
A simple decision tree on how to choose communication styles between microservices
Tags: microservices, architecture, discuss
Published: 2022-04-04 13:00:34

When I design a microservices system, one of the questions I always ask myself: **how will service A communicate with service B?**


This one question seems simple, but the right (maybe just reasonable) answer can depend on many things. Such as synchronous or asynchronous? Request-response or event-driven? Queue or Topic? REST or GraphQL or RPC? etc.
That's why I decided to put some effort into building a decision tree that can somehow help choose a good communication style between two services.


**Note**: We can use a mix of styles in our microservices, **and don't take it for granted**. My decision tree can have mistakes and can be incomplete, and I very much appreciate it if you could help me correct them :)

_You can open the original size image of the decision tree here: https://live.staticflickr.com/65535/51981736503_9eb0839e08_h.jpg_

![Microservices communication styles decision tree](https://live.staticflickr.com/65535/51981736503_9eb0839e08_h.jpg)
Part 3: I'm building a telegram bot to remind me changing my car oil
Tags: node, tutorial, productivity, programming
Published: 2022-04-04 12:55:56

Welcome to the part 3 of my journey to create a telegram bot that will remind me changing my car oil.

Checkout [part 1](https://ahmednagi.com/oilly-telegram-bot) and [part 2](https://ahmednagi.com/oilly-telegram-bot-part-2) for context.

## Demo Preview

I got the bot to ask questions and record answers. Here's a demo 👇!


![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8avvrdqr4kot9okwj2ym.gif)

Full demo can be found on Imugr 👉 [https://imgur.com/a/gPkI95A](https://imgur.com/a/gPkI95A)

## Ask Questions and record answers

Oilly now can ask questions like, "what is your current mileage?", and make sure to correctly record the answers in the database.

### Telegram persistance problem

Unfortunately telegram wont let you send any custom data with the message you have to debend on the text you send to record answers and here where I get stuck for 3 hours trying to find a way around.

Let me explain the problem in another way:

 When Oilly asks the user **What is the current mileage in (km) as shown in your car dashboard?** and waits for an answer there's no way for me to know wither the following text will be answer for this question or not because telegram doesn't return the message id in this case the question id, nor let you send custom data with the message.

```js
	bot.sendMessage(chat.id, "What is the current mileage in (km) as shown in your car dashboard?", {
		reply_markup: {
            // Options that doesn't contain custom data
		},
	});
```

Continue reading with images and visual aids on my blog [Ahmednagi.com/oilly-telegram-bot-part-3](https://ahmednagi.com/oilly-telegram-bot-part-3)
Train your design thinking with ORACULO
Tags: design, tutorial, ux, uiweekly
Published: 2022-04-04 12:55:16

ORACULO is a simulator for UX designers. Created by Evrone, it generates non-standard tasks that help develop product thinking. A character of the same name will offer you three random cards that will not tell your fate, but will provide an unexpected topic for design practice.

[Read more about ORACULO and try it out here!](https://evrone.com/oraculo)
Celebrating v1.0.0
Tags: watercooler, webdev, opensource, privacy
Published: 2022-04-04 12:50:01

We are building [Offen,](https://www.offen.dev/?utm_source=forum&utm_campaign=0220) a fair and self hosted web analytics software that treats operators and users as equal parties. Here's what's been happening over the past four months. Read the full version of [this article on the Offen blog.](https://www.offen.dev/blog/complete-stable/?utm_source=forum&utm_campaign=0220) 

Yes, you have read correctly. Offen v1.0.0 is here! Altough this does not bring major changes, we have decided to keep Offen and its configuration APIs stable for now. That means you will always be able to upgrade a v1 instance to a later v1 version without any further steps required.

Obviously, the development of Offen is not finished with ther current v1.0.0 version. We will continue to maintain the project and adapt it to new requirements. For this we also need your support. Continue to test and install Offen [latest releases](https://github.com/offen/offen/releases/tag/v1.0.0) and share your experience with us.

Furthermore, our consent banner and the Auditorium for operators as well as users can now be displayed in two more locales. Offen is available in English, German, French and recently also in Spanish and Portuguese.

Maybe now would be a good time to look back on the past 2 years. However, since we are already working on projects that take the idea behind Offen even further, writing a project summary is postponed for the time being. In the meantime, we suggest taking a look at this [interim retrospective](https://www.offen.dev/blog/our-story-so-far/?utm_source=forum&utm_campaign=0220) and our [analytics.txt](https://www.analyticstxt.org/) project. Also be sure to stay tuned and follow us here or on [Twitter](https://twitter.com/hioffen) and [Mastodon](https://fosstodon.org/@offen) for the next release updates.
_