teleren/devto huggingface dataset:
Day 6/30 : Toggle Neumorphism Switch using HTML and CSS
Tags: html, css, webdev, tutorial
Published: 2021-05-25 12:24:32

Welcome to Day 6 of this [Challenge](https://dev.to/somanathgoudar/30dayschallenge-30-days-extreme-html-css-challenge-50k1). This is what I created today. 

**➜ Here is the Demo :**
![Toggle Neumorphism Switch](https://1.bp.blogspot.com/-gFvR8CbqkJg/YKObf1aWqNI/AAAAAAAAABw/I6xAnsbuTu0Pn85hCnKemCsXVIVZwjDVgCLcBGAsYHQ/s600/p6.gif)

**➜ Video Tutorial :**

{% youtube HcEXOqHgcL4 %}
**➜ Source Code :**
https://www.futurecodersweb.com/2021/05/css-toggle-neumorphism-switch-on-off.html


**➜ Instagram Post and Reel for Day 6 :**
[See Post and Reel](https://www.instagram.com/future_coderss/)

------------------------------------------------------------------

Hey, If You don't know what is happening here. Don't Worry, I am doing a crazy challenge 😅. Read More about it from the post below.

{% link https://dev.to/somanathgoudar/30dayschallenge-30-days-extreme-html-css-challenge-50k1 %}

**Support Me :**
👉 Buy me a Coffee: https://www.buymeacoffee.com/somanathgoudar
👉 [Follow Me on Instagram](https://www.instagram.com/somanath_goudar/)
👉 [Follow Future Coders on Instagram](https://www.instagram.com/future_coderss/)
👉 [Subscribe to My Main Channel](https://www.youtube.com/channel/UC_nTrhTr5fnBGjOxnkPUmmA)
👉 [Subscribe to Channel Created for this Challenge](https://www.youtube.com/channel/UCzGSyMOf2jPt1MkNBB3SJ3g)

------------------------------------------------------------------
Fix Trusted Host Settings error in Drupal status report
Tags: drupal, troubleshooting
Published: 2021-05-25 12:19:46

## Summary

I installed [Drupal](https://drupal.org/) 9 on [OpenBSD](https://www.openbsd.org/) few days ago. An error on "Trusted Host Settings" seemed to remain after installation via the web installer.
The cover image of this post is screenshot of the error.

## Description

In order to fix it, all what to do is edit `settings.php` in `web/sites`.

```console
$ doas nvim /var/www/.../<drupal-dir>/web/sites/default/settings.php
$ # settings.php is read-only by default
```

When \<fqdn\> is "sub.orroot.domain" in actual, add lines like this:

```diff
  /**
   * Trusted host configuration.
   *
   * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host
   * header spoofing.
   ...
   * For example:
   * @code
   * $settings['trusted_host_patterns'] = [
   *   '^www\.example\.com$',
   * ];
   * @endcode
   * will allow the site to only run from www.example.com.
   ...
   */
+ $settings['trusted_host_patterns'] = [   
+   '^sub\.orroot\.domain$',   
+ ];
```

Refreshing "Status report" page will bring comfortable result that all tests are passed.

## Reference

- [Drupal - Trusted Host settings](https://www.drupal.org/docs/installing-drupal/trusted-host-settings)
Getting started with Esp-12F
Tags: esp12f, esp8622, wifiscan, ftdi
Published: 2021-05-25 12:18:26

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qwcgzsx2yl9ag1h5wtd.jpg)
Esp-12F is a miniature WiFi Module present in the market. It is used to establish a wireless network connection for microcontrollers or processors. Esp-12F is based on the ESP8266 module, with built-in 32Mbit Flash, in the small SMD22 package. 

There are many ways of programming Esp-12F module. Some include: 
* Using a dedicated programmer board
* using NodeMCU
* using a dedicated USB-to-Serial adapter
* using a witty cloud development board

For this tutorial, I am using a dedicated USB-to-Serial adapter to program the Esp-12F module via Arduino IDE.  

###Requirements

Esp-12f
USB-to-serial FTDI(YP-05)
Esp-12F breakout board
A couple of jumper wires

### Connecting the Devices

To make connection with Esp-12F module easier, I am using a breakout board. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmkw2ex0v0uulzxwmfyq.png)

I am connecting the devices as shown below:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5cmnzsd0bohniv0zzakt.png)

### Running the first program

The code I am using to get started with the Esp-12F module is a WiFi scan code. This program will scan all the WiFi networks within reach of the module. 

Before running the code, I am [installing FTDI drivers](https://ftdichip.com/drivers/vcp-drivers/) in my laptop. The documentation provided in the website provides a clear guide on the installation process. I am installing the divers to enable my Arduino IDE to read the FTDI as a COM port.

Once the installation is complete, I am uploading the code shown below for WiFi Scan. If the connection was correct and the code runs successfully, the Serial Monitor should display the WiFi networks within reach. 
```C++
#include "ESP8266WiFi.h"
#define BLINK_PERIOD 250
long lastBlinkMillis;
boolean ledState;

#define SCAN_PERIOD 5000
long lastScanMillis;

void setup()
 {
  Serial.begin(115200);
  Serial.println();

  pinMode(LED_BUILTIN, OUTPUT);

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
}

void loop()
{
  long currentMillis = millis();

  // blink LED
  if (currentMillis - lastBlinkMillis > BLINK_PERIOD)
  {
    digitalWrite(LED_BUILTIN, ledState);
    ledState = !ledState;
    lastBlinkMillis = currentMillis;
  }

  // trigger Wi-Fi network scan
  if (currentMillis - lastScanMillis > SCAN_PERIOD)
  {
    WiFi.scanNetworks(true);
    Serial.print("\nScan start ... ");
    lastScanMillis = currentMillis;
  }

  // print out Wi-Fi network scan result upon completion
  int n = WiFi.scanComplete();
  if(n >= 0)
  {
    Serial.printf("%d network(s) found\n", n);
    for (int i = 0; i < n; i++)
    {
      Serial.printf("%d: %s, Ch:%d (%ddBm) %s\n", i+1, WiFi.SSID(i).c_str(), WiFi.channel(i), WiFi.RSSI(i), WiFi.encryptionType(i) == ENC_TYPE_NONE ? "open" : "");
    }
    WiFi.scanDelete();
  }
}
```
Ways to convert string to date in Javascript
Tags: javascript
Published: 2021-05-25 12:16:39

This article was originally posted in my [blog](https://anjandutta.com/convert-string-to-date-in-javascript).

A string date can be of three types and, we will convert each of those to a date object in javascript.
Formats of string date:

* yyyy-mm-dd
* mm-dd-yyyy
* dd-mm-yyyy


## Convert yyyy-mm-dd format string to date in javascript

We can pass the `yyyy-mm-dd` format string directly in the `new Date()` constructor as below example.

```js
let date_string = "2020/04/03/"; // Apr 03 2020
let output = new Date(date_string);

console.log(output.toString()); // Fri Apr 03 2020 00:00:00 
```

Next two conversions are, 

* mm-dd-yyyy
* dd-mm-yyyy

[Read more...](https://anjandutta.com/convert-string-to-date-in-javascript).
4 Habits For Better Life
Tags: productivity
Published: 2021-05-25 12:11:06

### Habit 1 : Never Stop Learning

Don’t get confused between what people say you are and who you 
know you are. - Unknown
The people who stop learning are the ones who remain mediocre and poor in life. Never stop learning no matter what age are you in because the ones who stop learning will never grows in life. Be a student of your calling learn something everyday in your calling and start taking action on it because knowledge is not enough you must take action to achieve something. Develop growth mindset within yourself the people with growth mindset always try to learn from everywhere like from failure or from another successful people. 

### Habit 2 : Think Big
If you see someone without a smile give them yours. – Dolly Parton
Think big it does not matter how big dreams you have what matter is what are you willing to sacrifice for achieving your dreams. In real world people are not measure by how many dreams they have what matters is how big their dream are. Think big enough you have to think anyway why not think big so in the end you feel proud of yourself. Start thinking big don't settle for small life make your life a inspiring story which people will admire and get inspiration from your life. Think big start small fail early and achieve greatly. 

### Habit 3 : Vision
If you want to fly give up everything that weigh you down. - Buddha
Be a visionary person the person who think in future the person who invent things and change the world with their ideas. The people Like Mark Zuckerberg and Larry page are visionary people because they think in future they always try to innovate with their crazy ideas and change the world. 
As Mahatma Gandhi Said " Be the change you wish to see in the world". If your dream is to become an entrepreneur they you definitely need the habit of thinking in future because successful entrepreneur are the ones who change the world and solve real world problem with their crazy Ideas.

### Habit 4 : Focus
You are what you do not what you say you will do. - Unknown
Be a focused person the person who remain focused on her goals no matter what happening around him. If you want to achieve great things in your life you need focus because when you focused on your goals you will get more [creative ideas](https://ayushantiwal.com/untouchable-novel-summary/) about the things you want to accomplish. Focus does not means what to focus on focus means elimination for the things you want to focus on.
Daily Developer Jokes - Tuesday, May 25, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-05-25 12:00:01

---
title: "Daily Developer Jokes - Tuesday, May 25, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Tuesday%2C%20May%2025%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12589f412c5.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why did the angry function exceed the callstack size?

___A:___ It got into an Argument with itself
 -->
How to remove spaces from a string in javascript
Tags: javascript
Published: 2021-05-25 11:56:34

Space can be present at any position in a string and, a single solution will not work in every situation.

In this article, I have discussed two ways to:
* Trim the extra space from the beginning or end of a string.
* Remove all extra spacing between words.

## Trim the extra space from the beginning or end of a string.

Javascript has an inbuild `trim()` function for this purpose. The trim function takes one parameter, the string itself and, it returns a trimmed string.

The syntax looks like below:
```js 
var content = "      The Quick!       ";
console.log(content.trim());
//The Quick!
```

Simple, right!

Next, you can read how to remove all extra spacing between words from [here in my original blog post](https://anjandutta.com/remove-space-from-string-in-javascript/)
We need a better way to communicate and explain our code decisions
Tags: rails, productivity, techtalks
Published: 2021-05-25 11:26:30

Last month, I gave a talk at [RailsConf 2021](https://railsconf.org/) titled "Teach your code to describe its own architecture". If you weren’t able to watch it during the conference, don’t worry -- I’m going to share a recap of my talk in a series of four, short blog posts and videos.

This first post recaps the intro of my presentation. You can watch this part of my talk in the video clip shown above, and take a look at how I framed the architecture documentation problem and solution for RailsConf attendees. I’d love to hear if it resonates with you in the [AppMap Discord](https://discord.com/invite/N9VUap6)! 

## Problem

* Architecture documents and diagrams are always out of date. 
* As developers, the docs we make for end users aren’t the same as the ones we need for our own work.
* The freedom to make decisions about code design now belongs to developers, not architects. So we as developers need a better way of communicating and explaining our decisions to other developers.

## Solution

* A new kind of documentation that developers create as they work so it’s available when newcomers to the code need it 
* This new kind of documentation should always be:
  * **Up-to-date** Wrong documentation is worse than useless -- it’s misleading. 
  * **Interactive** A static picture isn’t powerful enough.
  * **Contextual** Traditional architecture documentation is too big and complex to be immediately useful.
  * **As close to the code as possible** Ideally, the documentation is in the code, because that’s where we’re working.

## Coming up next

In Parts 2, 3 and 4, I’m going to recap the demo portions of my RailsConf talk. Using tools that automatically generate documentation and visualizations of architecture and code design, I’ll auto-document end-to-end code and data flows, web services and the relational database schema.
C++ cryptocurrencies multi exchange client
Tags: cpp, cryptocurrency
Published: 2021-05-25 11:25:59

I just created a tool (as a CLI or available as a static library for larger projects) to avoid opening a web browser to manage my crypto currencies on several exchanges.

My other aim is to experiment and learn new C++20 features, cross platform building with cmake.

If you are interested, check it out [here](https://github.com/sjanel/coincenter)!
My First Open Source Contribution
Tags: opensource, java, checkstyle, gsoc
Published: 2021-05-25 11:25:08

Hey Guys,
DISCLAIMER: THIS IS MY EXPERIENCE AND I AM STILL A BEGINNER 
I was very afraid at first to understand the hype of Open source contribution and the only guidance I had is YouTube and to be precise @codeforcause channel. 

~HOW TO Know which project is good for you?
1. I only learned java and java intermediate but when I saw projects it was like tons of projects and I was confused, so I opened every project and I was trying to understand the readMe file and also the organization provides different documentations to understand the issues.

2. I joined Checkstyle community after all the understanding and the first thing I did is, 1. Connected with the community through 1.GITTER and introduced myself. 2. Added to google groups for doubts.

3. After joining I visited the Codebase of the Checkstyle and I saw all the issues by labeling GSOC FIRST ISSUE.

4. I first saw closed issues to understand how to solve them.

5. After that, I got a lot of doubts and I first learned git 
command because Git and GitHub are like Heart of Body.

6. The issuer also provides some information to solve the issue.
7. Also remember, after solving the issue, you should always wait for test checks and if the test fails and if you don't have any idea, go and ask in the comment about it.


THATS ALL FOR NOW, I RESOLVED ONLY 2 ISSUES IN LAST 6 DAYS BUT I LEARNED A LOT ABOUT:
1. HOW TO GENERATE JAVA DOC
2. MAVEN TOOL
3. XPATH
4. GIT COMMANDS

REMEMEBER: I ONLY KNEW JAVA WHEN I STARTED


I will recommend you (if you are reading this):
visit this:
https://www.youtube.com/watch?v=dDE3tOa4JUs&list=PLyzHIYrZBplqcJXQ0XWA4gRs0sdh6zWfD


(I am not promoting this, but this helped me a lot to understand and learn.)
4 Habits of Successful People
Tags: productivity
Published: 2021-05-25 11:20:59

### Habit 1 : Lifelong Learner

To Succeed in life you need two things. Ignorance and Confidence. – Mark Twain
One thing you never stop doing is learning and growing. No matter at which age you are in but never stop learning because learning is part of life like eating and exercising. You will never get old when you keep learning you get old when you stop learning. One you will never stop doing in your whole life is reading books. Reading is like breathing, eating and drinking water for successful people. The Successful people miss their meal but they never miss reading books. Attach your pleasure to [reading books](https://ayushantiwal.com/neem-karoli-baba-miracles/) and pain to never reading books. 
Remember No matter what you become and what happens in your life just never stop reading books. 

### Habit 2 : Stay Persistent

We are here to put a dent in the universe. – Steve Jobs
The people who give up are the ones who regret it in their whole life. Failure are part of  life when you do new things in life chances are you will meet temporary failure but it never means you give up on it. Learn from your every failure, failure has something to teach you take the lessons from your failure and let it go. The people usually give up when they don't have strong why behind what they are doing. Give yourself strong reason in what you are going when you have purpose behind your work you will become unstoppable in your calling. 

### Habit 3 : Courage

Happiness is an inside job. Don’t assign anyone else that much power over your life. - Unknown
Courage what takes you towards the life you are afraid to going. Courage is what kept you going when there is no behind you, courage is what kepts you going when no one believes in your dreams. Courage what makes start working on your calling. When you do something new which is never done before there some people who always trying to push you down the time when you need courage to keep working on what you believe. 

### Habit 4 : Long term mindset

No struggle, no progress and no success. – Maxime Lagace
Be clear what you want and what you want 10 years from now. Long term thinking mindset is what gives you clarity about what you wan 10 years from now. Be better person than you were yesterday the mindset you need to achieve your long term goals. Live your in way that will takes you towards your long term goals do something every day which takes you towards your long term goals and dreams.
Hacking Academy - Help me out!
Tags: webdev, security, programming, cybersecurity
Published: 2021-05-25 11:07:58

Hey guys,

I'm building an online e-learning platform for hackers (you can see some screenshots/videos [here](https://mailchi.mp/05ead1118c6b/hacking-academy)), and two of the demographics I'm trying to reach are: 

1. Experienced developers who already know how to create backend or full-stack applications but don't necessarily know about all of the security hazards or how to exploit them as an attacker.

2. Beginner developers who know what a variable or a function is but don't yet understand how the HTTP protocol or browsers or web applications in general really work.

Because it's difficult to really put oneself in someone else's shoes, I humbly ask for your help. If you belong to either of the two demographics, and are interested in the topic, what would be most important to you in an e-learning platform that aims to teach about hacking and defending against the attacks?

Feel free to suggest specific content, features, or anything at all. The page I linked above should give a pretty good overview of the current idea that I have about what it could look like.

Thanks in advance! And sorry I know this is a bit of a plug but there is no better place to ask (:
Linear Search .Net
Tags: csharp, beginners, programming, dotnet
Published: 2021-05-25 11:05:31

Searches particular value within a data structure.

### Background

Linear search checks each element in the list until a match is found or until it reaches the end.

#### Linear Search Function

Consider the linear function as “**LinearSearch(arr,value)”**

* where arr is the array to search inside of
* where value is the element, we are searching for in array “arr.”

#### Output

* Returns -1, if element not found
* Returns the index of an array element, where arr[index]=value

#### Pseudo Code

* Set answer to -1
* For each index from index=1 to n (where n is the last index of arr)
* If arr[index]=value, then set the answer to the index value
* Return the value of the answer as output

### Getting Started

The article demonstrates the use of linear search inside an integer array in a console application.

Firstly, let's write code for linear function as per pseudo code. Iterate over an integer array and returns array index where `a[i]==x` and -1 if not found.

{% gist https://gist.github.com/ssukhpinder/5c0619eaaadbfb4b157be67734254739 %}

Finally, let’s write code to utilize the linear function.

{% gist https://gist.github.com/ssukhpinder/830b1dc07ad738a853b7bca7990b91da %}

1.  Prepare an integer array with the following elements. `1, 4, 5, 7, 9, 22` 
1.  Display all elements on the console window.
1.  Take user input from the console which element to search in an array.
1.  Call `LinearSearch `function created with both array and element to search.
1.  If `index!=-1` then output “Element {value} found at index {index}.”
1.  Else then output “Element not found.”

#### Case 1 Output
```
    Current rray Elements 1 , 4 , 5 , 7 , 9 , 22
    Enter the element to be searched
    5
    Element 5 found at index 2
```
#### Case 2 Output
```
    Current rray Elements 1 , 4 , 5 , 7 , 9 , 22
    Enter the element to be searched
    100
    Element not found
```
### Github Repo

Please find below the GitHub repository demonstrate linear search using the .Net 5 console application.
[Linear Search](https://github.com/ssukhpinder/LinearSearch)

*****

Thank you for reading, and I hope you liked the article. Please provide your
feedback in the comment section.

#### Follow me on [C# Publication](https://medium.com/c-sharp-progarmming),
[LinkedIn](https://www.linkedin.com/in/sukhpinder-singh-532284a2/),[Instagram](https://www.instagram.com/sukhpindersukh/),[Twitter](https://twitter.com/sukhsukhpinder),[Dev.to](https://dev.to/ssukhpinder),[Pinterest](https://in.pinterest.com/ssukhpinder/_created/),[Substack](https://sukhpinder.substack.com/),[Wix](https://www.csharp-dotnet.com/).
Real time guessing game with react and socket
Tags: react, node, webdev, socket
Published: 2021-05-25 10:39:35

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1yc6wczujcb4hpvh3huo.jpg)
Hi everyone, I hope you're doing well. I want to share with you a real time guessing game web app that I built with **React**, **NodeJS** and **Socket**. It is a multiplayer game (02). You just need to share a generated token on the home page with your friend to allow him to join you and start the game. At turn of each player, the player revert two cards and try to find the cards with the same emoji to earn points. You can view instantly your score on the board and a green circle position indicate each player turn. 
You can try at: [guessing game](https://guessing-game-mc.herokuapp.com/)  or get the source code on my github repositories: [source code](https://github.com/TawalMc/GuessingGame).
I use **React** + **grommet** + **socket** client for the client side and **nodejs** + **express** + **socket** server for the server part.
Hope you will like it. Thanks.
From your local server (Xampp) to Google Cloud VM
Tags: googlecloud, php
Published: 2021-05-25 10:33:44

My university friend needed help on deploying to GCP, however, it made me such all over the internet until I found a solution. Have decided to share it so it can be of help to some else out there. This is a brief one but will update it with screenshots when I settle down.

In case you have a website or web app developed using HTML template, PHP, and MSQL database, you can freely host it on google cloud with the same setup as your local computer in a few minutes. Let's break down the steps:

1. Deploy a LAMP Stack VM from the marketplace using Deployment Manager
2. Navigate into the ```/var/www/html``` folder, delete the default *index.html* file
3. Using SSH connection, connect your VM to your local machine
4. Copy all files in Xampp into VM ```/var/www/html``` folder
5. Access phpmyadmin of the VM by adding ```/phpmyadmin``` after its External IP
6. Export local database content to VM database