teleren/devto huggingface dataset:
Let's talk about "falsiness"
Tags: beginners, javascript
Published: 2021-07-20 03:57:39

### What is falsiness?

If you write a statement where you are testing if something is true or not--like an `if` statement that uses a logical operator like `||`, `!`, or `&&`--you expect that statement to return a boolean value of `true` or `false`.  Sometimes it doesn't resolve to a boolean value--true or false--yet, nevertheless, it gets *interpreted* like a boolean value. We call those values "truthy" or "falsey".

In Javascript, examples of falsy values are: 
* `null`
* `undefined`
* `NaN` (Not a Number)
* `""` (empty string)
* `false`
* `0`

Every other value--every value that is not one of the above--will evaluate to `true` in a Boolean evaluation in Javascript. 

Let's go through them one by one. First, I'll demonstrate a variable assignment to each falsy value. Next, I'll show how that falsy value is is interpreted as `false` using the `Boolean()` function, which takes a value or expression and always returns either `true` or `false`.

## `null`
A variable that resolves to `null` is a variable that has been deliberately assigned an empty value

```javascript
let foo = null
console.log(foo) // null

```
---

## `undefined`
An `undefined` variable is a variable that has not yet been assigned a value. 

```javascript
let foo
console.log(foo) // undefined
console.log(Boolean(foo)) // false
```
---
##`NaN`
A variable that resolves to `NaN` can be the result of an invalid math operation, such as 0/0 or sqrt(-1). A number is expected from a math operation, but the expression is invalid, so the result is not a (valid) number.

```javascript
let foo = 0/0
console.log(foo) // undefined 
console.log(Boolean(foo)) // false
```
---
## `""` (empty string)
Just what it sounds like: a variable that has been assigned to a string with no content.

```javascript
let foo = ""
console.log(foo) // (actually, nothing shows up)
console.log(Boolean(foo)) // false
```
---
## `false`
Just what it sounds like: a variable that has been assigned to a the boolean value `false`.

```javascript
let foo = false
console.log(foo) // false
console.log(Boolean(foo)) // false
```
---
## `0`
Just what it sounds like: a variable that has been assigned to `0` or that resolves to `0`.

```javascript
let foo = 5 - 5
console.log(foo) // 0
console.log(Boolean(foo)) // false
```
Weekly Check-In #4: Sixth Week
Tags: weeklyretro, python, opensource, gsoc
Published: 2021-07-20 03:52:45


Hi everyone! this weekly post could be quick because I didn't have much information to report, however, it is good to maintain the rhythm in blogging.

<img src="https://media.giphy.com/media/NXp9HM6YeuS0U/giphy.gif" alt"blogging meme" />

## What did you do this week?
This week I didn't do PR's, my activities were focusing on refactoring the graphic interface lesson of the course, in the original course this lesson was implemented using the libraries ``tkinter`` and ``pygame``, but these libraries don't work in ``runestone`` so I was searching the best way  to implement using the new module of ``brython``

## What is coming up next?
I will finish this lesson and after that, focusing on finishing the MVC lesson to finish before the next sprint. 

## Did you get stuck anywhere?
I didn't, but I needed to searched and understood the ``brython`` syntaxis before coding the new lesson structure.
Hello World
Published: 2021-07-20 03:50:31

### Introduction

WordPress is one of the most popular open source content management systems in the world. Although it started out focused on blogging, over the years it has developed into a more flexible platform for websites in general. After almost fifteen years of development it is quite polished and robust, yet issues can still come up.

If you've recently attempted to load your WordPress-powered website and instead saw a message stating "Error Establishing Database Connection", the cause is most often one of the following:

-   The database has crashed, often due to the server running out of memory
-   The database login credentials are incorrect in your WordPress configuration
-   The WordPress database tables have been damaged

Let's walk through these issues one at a time to determine if they affect you, and how to fix them.

Prerequisites
-------------

This tutorial assumes the following:

-   You're running WordPress on a machine that you have command line and `sudo` access to
-   Your database is running on the same server as WordPress (typical of a self-hosted WordPress setup, less typical of a shared WordPress hosting environment)
-   You know your database username, password, and the name of the database created for WordPress. This information should have been created during initial setup of your WordPress install.

Step 1 --- Check the Server Memory Resources
------------------------------------------

A good first step for debugging this problem is to try logging into the server to see if the system is healthy and MySQL is running.

Log into your server via SSH, remembering to replace the highlighted portions below with your own user and server details:

```
ssh sammy@your_server_ip

```

Copy

If you need help logging into your server, please see our article [How To Connect To Your Droplet with SSH](https://www.digitalocean.com/community/tutorials/how-to-connect-to-your-droplet-with-ssh).
Daily React 1 - useState
Tags: react, javascript
Published: 2021-07-20 03:15:04

Today's the day I get a lot of stress. I am jobless for about 4 months since I quit my previous job. Even though I don't have a clear goal when I need to get developer job, it is people around me that start to ask when I will get a job. Even a simple question like 'how are you?' stresses me out. So, I started to vent off that stress by coding. 

```javascript
import React, { useState } from "react";

const data = [
	{ title: "Fuck you!" },
	{ title: "Don't Ask Me When I Am Going to Get a Job!" },
	{ title: "Shut Up!" },
];

const Hookers = () => {
	const [title, setTitle] = useState(data[0].title);
	const handleClick = () => {
		if (title === data[0].title) {
			setTitle(data[1].title);
		} else if (title === data[1].title) {
			setTitle(data[2].title);
		} else {
			setTitle(data[0].title);
		}
	};

	return (
		<>
			<div className="title">
				<h1>{title}</h1>
			</div>
			<button className="btn" onClick={handleClick}>
				SWEAR AT WILL
			</button>
		</>
	);
};

export default Hookers;
```
Here you go! We just set up three different title states to navigate.

![sweetcoding](https://raw.githubusercontent.com/hwangs12/demo-repo/844deb291f2568f39403bea0e31cf804f506e6f5/swear.gif)
Code Smell 84 - Max < Min (Javascript)
Tags: javascript, oop, programming, codenewbie
Published: 2021-07-20 03:05:59

*Some functions do not behave as expected. Sadly, most programmers accept them.*

> TL;DR: Don't trust max() and min() functions. Just ignore them.

# Problems

- Principle of least astonishment

- [Bijection](https://dev.to/mcsee/the-one-and-only-software-design-principle-3086) Violation.

- Unexpected Results

# Solutions

1. Use mature languages.

2. Avoid *max()* and *min()* functions.

3. Model Infinites carefully.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/8440adc57486989468045de4df3c9bef)
```javascript
console.log(Math.max() > Math.min());

//returns false

console.log(Math.max());

//returns -Infinite
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/7f275da71e96bd4050e17c0ec7511c14)
```javascript
console.log(Math.max() > Math.min());
console.log(Math.max());

//returns Exception. Not enough arguments passed.
//Max requires at least one argument
```

# Detection

These functions belong to the standard Math library. Therefore, they are not easy to avoid. 

We can block them on our linters.

# Tags

- Javascript

# Conclusion

We need to be very careful using functions that violate real-world concepts using language tricks.

# Relations

{% post https://dev.to/mcsee/code-smell-69-big-bang-javascript-ridiculous-castings-49ij %}

# More Info

- [Principle of least astonishment](https://en.wikipedia.org/wiki/Principle_of_least_astonishment)

- [Bijection Principle](https://dev.to/mcsee/the-one-and-only-software-design-principle-3086)

- [MAPPER](https://dev.to/mcsee/what-is-wrong-with-software-5pa)

# Credits

Photo by <a href="https://unsplash.com/@cris024">Cris Baron</a> on <a href="https://unsplash.com/s/photos/infinite">Unsplash</a>
  
Inspired by @oliverjumpertz 

{% twitter 1416798870747684864 %}

* * *

> Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

_Rick Cook_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
Hide an element without changing the layout
Tags: css, webdev, frontend, codesandbox
Published: 2021-07-20 02:43:12

## What is visibility css property

`visibility: hidden`

[visibility - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility)

The visibility CSS property shows or hides an element without changing the layout of a document.

## When I found it useful

When I wanted to keep the layout and did NOT want to have a hover effect on the element

## codesanbox
{% codesandbox vjvjw %}
Excluding Dart files from static analysis
Tags: flutter, dart, mobile, tooling
Published: 2021-07-20 02:32:02

I wrote a couple of posts about linting this year, but this one is about excluding files from static analysis. After adding static analysis to most of my Flutter projects I found that sometimes there were files that I didn't want to be warned about.

A good example of this is if you use something like `mockito` or `json_serializable`. When you implement these kinds of packages in your project you run `build_runner` and they generate code for you. Sometimes the analyzer will pick up issues with the generated code. You're not going to edit generated code to squash linting issues(or you shouldn't edit it anyway). 

I got sick of the generated code files in my project showing up in the 'Problems' tab of VSCode so I finally decided to go digging for a solution this week and it was refreshingly straight forward. You just need to make some small changes to your **analysis_options.yaml** file. So for example if your file looks something like this:

```yaml
include: package:flutter_lints/flutter.yaml

linter:
  rules:
    use_key_in_widget_constructors: false
```

You just need to add a key for `analyzer` and add your exclusions below it with `exclude`, like this:

```yaml
include: package:flutter_lints/flutter.yaml

analyzer:
  exclude:
    - 'lib/ui/something/file1.dart'
    - 'lib/data/something/file2.dart'  

linter:
  rules:
    use_key_in_widget_constructors: false
```

You can also use '**' to target specific file patterns, so if you wanted to ignore all the `.mocks.dart` files in a specific test directory you could do something like this:

```yaml
include: package:flutter_lints/flutter.yaml

analyzer:
  exclude:
    - 'lib/ui/something/file1.dart'
    - 'test/data/notifiers/**.mocks.dart'  

linter:
  rules:
    use_key_in_widget_constructors: false
```

You can also target all files with a specific pattern globally too. In my project I wanted to exclude all files with `.mocks.dart` and `.g.dart` so I ended up with these settings:

```yaml
include: package:flutter_lints/flutter.yaml

analyzer:
  exclude:
    - '**.g.dart'  
    - '**.mocks.dart'

linter:
  rules:
    use_key_in_widget_constructors: false
```

The above examples worked for me in a Flutter project with `sdk: ">=2.12.0 <3.0.0"`, and you can find more discussion about the topic [here](https://github.com/dart-lang/sdk/issues/25551). It looks like the are some reports recently about issues with Dart 2.13.0 though 😅. And speaking of linting, if you want to hear my (very brief) thoughts about **flutter_lints** then [check out my post](https://developermemos.com/posts/trying-flutter-lints-package) from the other week.
Github Copilot : Your AI pair programmer
Tags: github, githubcopilot, arjuncodes, programming
Published: 2021-07-20 02:15:11

GitHub Copilot is an AI pair programmer that helps you write code faster and with less work. GitHub Copilot is an artificial intelligence tool developed by GitHub and OpenAI to assist users of Visual Studio Code by autocompleting code. GitHub Copilot uses a modified version of GPT-3, a language model designed to produce human-like text, that is instead programmed to produce valid computer code.
*To know more about github copilot :*
{% youtube fAXTtSrEXFk %}
Senior Developer Roadmap
Tags: career, roadmap, leadership
Published: 2021-07-20 01:36:33

Just wanted to share this Senior Developer Roadmap I made. 🗺️

This is my take on what skills and traits you need to grow into a senior position. Feel free to ask me in the comments if you have questions about the roadmap.

_TIP: middle click on the map to read the hi-res version in a new tab_
[![Senior Developer Roadmap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qpf3jms2tzu4m9t1vsmo.png)](https://raw.githubusercontent.com/glennsantos/senior-developer-roadmap/main/SeniorDeveloperRoadmap.png)

Here's a quick rundown of the content included:

### Prerequisite: Previous Role's Roadmap

You need to have gone through the previous roadmap for your role as outlined in [roadmap.sh](https://roadmap.sh). This is important since your team will look to you for technical guidance in your specific stack.

### Code Quality

As a senior developer, you need to uphold quality not just for your own work, but in the work of your team. This means creating standards, doing reviews and documenting as needed.

### Decision Making

A senior role is characterized by making good decisions. There are many technologies we can use to create products so choosing the right one for the project is important.

### Technical Solutions

Another task of a senior dev is turning ideas into practical solutions. Not only do you build new features, but you also have to fix and improve existing ones with an eye towards reliability and performance.

### Communication

It's a misconception that the senior dev sits behind closed doors coding all day. You also need to be able to convey your ideas well, both to dev teammates and nontechnical colleagues.

### Project Planning

Sure you might think this is a PM's job, but remember that you're also tasked to create solutions, which is part of the project planning process. So know how your company's project planning process works so you can work effectively within it.

### Technical Mentorship

One of the most gratifying tasks of a senior dev is improving the technical capability of the team. This happens through mentorship.

### Leadership

Finally, the best trait of a senior dev is being a good leader of the team. This is also the toughest part of the journey, since you need to cultivate new patterns of thinking that involve raising up others more than yourself.

----

I also put this roadmap up in Github so you can clone it easily: 

- [https://github.com/glennsantos/senior-developer-roadmap/](https://github.com/glennsantos/senior-developer-roadmap/)

There's also a checklist version of the map there, if that's more to your liking.

----

**Stay tuned for the Tech Lead Roadmap coming soon!**
Best NodeJs React Js Redux Project on Github
Tags: node, react, redux, javascript
Published: 2021-07-20 01:33:58

## 1- [IDURAR ERP/CRM](https://github.com/idurar/idurar-erp-crm)
IDURAR is Open Source ERP/CRM (Invoice / Inventory / Accounting / HR) Based on Mern Stack (Node.js / Express.js / MongoDb / React.js ) with Ant Design (AntD) and Redux
GitHub Repository : [https://github.com/idurar/idurar-erp-crm](https://github.com/idurar/idurar-erp-crm)


[![Best 7 Open-source projects built with Node.js / React.js](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ja242ld9m9z1c6ia7lu5.png)](https://github.com/idurar/idurar-erp-crm)


#Starter Antd Admin (Crud & auth) App based on Mern Stack 

![starter-antd-admin-crud-auth-mern-crud-auth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/opp4yj177dizyaosah0o.png)


##CRM Starter Mern Antd Admin App 

I build Starter Crm App based on mern stack (Express.js / MongoDb / React / Redux / AntD) with generic crud and auth , admin management .

**Live App Demo** : [https://antd-admin-yle2f.ondigitalocean.app](https://antd-admin-yle2f.ondigitalocean.app)
`username : admin@demo.com
password : admin123`

**Github Repo** : [https://github.com/idurar/starter-antd-admin-crud-auth-mern](https://github.com/idurar/starter-antd-admin-crud-auth-mern)

##App Features :

### Backend :

* The backend is built with node.js , [express.js Framework](https://expressjs.com/) ,and [MongoDb Database](https://www.digitalocean.com/products/managed-databases-mongodb/)
* Generic Crud Api (Create / Read / Update / Delete)
* Admin (User) Management Api
* Auth by Jwt json web token

### Frontend :

* The Frontend is built with React.js , [Ant Design (Antd)](https://ant.design/), and Redux , Redux-thunk.
* Generic Crud Component (Module) (Create / Read / Update / Delete)
* Admin (User) Management Module
* Auth Component Login / Logout
* Private Route and Public Route
* Not Found Page
* Beautiful UI Dashboard

##Deployment :
Database : [Digitalocean Managed MongoDb](https://www.digitalocean.com/products/managed-databases-mongodb/)

Node.js App : [Digitalocean App Platform](https://www.digitalocean.com/products/app-platform/)

React.js App : [Digitalocean JamStack Platform](https://www.digitalocean.com/products/app-platform/)

## App Built on top of this Starter project [IDURAR ERP/CRM](https://github.com/idurar/idurar-erp-crm)
IDURAR is Open Source ERP/CRM (Invoice / Inventory / Accounting / HR) Based on Mern Stack (Node.js / Express.js / MongoDb / React.js ) with Ant Design (AntD) and Redux
GitHub Repository : [https://github.com/idurar/idurar-erp-crm](https://github.com/idurar/idurar-erp-crm)


![Best 7 Open-source projects built with Node.js / React.js](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ja242ld9m9z1c6ia7lu5.png)
Part-2: 5 HTML Tags That Almost Nobody Knows
Tags: html, webdev, css, javascript
Published: 2021-07-20 00:55:01

Hello, I'm [Aya Bouchiha](https://t.me/AyaBouchiha), today, I'm going to discuss another 5 HTML tags that you're almost don't know.

[part-1:  5 HTML Tags That Almost Nobody Knows](https://dev.to/ayabouchiha/5-html-tags-that-almost-nobody-knows-5p5)

## \<dfn>

**\<dfn>**: used to specify a term that is going to be defined, most browsers display this element with an italic font style.

```html
<p>
	<dfn>Mathematics</dfn>
	is the science of structure, order, and relation that has evolved from
	counting, measuring, and describing the shapes of objects
</p>
```

![HTML tags Aya Bouchiha](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c75qff0qlq99i3yrsjug.PNG)

## \<kbd>

**\<kbd>**: used to define keyboard input, it is displayed with a _monospace_ font

```html
<h1>How to rename a file ?</h1>
<p>
	Select the file with a left click and then press <kbd>F2</kbd> on your
	keyboard.
</p>
```

![HTML tags Aya Bouchiha](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/btlgtnz122whodg3hx22.PNG)


## \<samp>

**\<samp>**: is used to define sample output from a computer program.

```html
<p><samp>File not found.<br />Press <kbd>F1</kbd> to continue</samp></p>
```

![HTML tags Aya Bouchiha](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6wyjkswwnjxhg9hj38o7.PNG)


## \<meter>

**\<meter>**: represents either a scalar value within a known range or a fractional value.
[more details](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter)

```html
<div class="skills">
    <label for="html">HTML</label>
    <meter id="html" value="8" min="0" max="10">2 out of 10</meter><br>
</div>
```

![HTML tags Aya Bouchiha](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nebw45oj9nkcpx57ju8.PNG)

## \<dl>, \<dt> & \<dd>

**\<dl>** : is used wiht **\<dt>** and **\<dd>** to define a description list.

**\<dt>**  defines a term in a description list.

**\<dd>**  describes a term in a description list.

```html
<dl>
    <dt>&lt;dfn&gt;</dt>
    <dd>for specifing a term</dd>
    <dt>&lt;kbd&gt;</dt>
    <dd>defining a keyboard input</dd>
    <dt>&lt;samp&gt;</dt>
    <dd> for defining sample output from a computer program</dd>
    <dt>&lt;meter&gt;</dt>
    <dd>for representing either a scalar value within a known range or a fractional value.</dd>
    <dt>&lt;dl&gt;</dt>
    <dd>for defining a description list</dd>
</dl>
```

![HTML tags Aya Bouchiha](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ec8y0q8c1o0palw7b3qr.PNG)

## Summary

**\<dfn>** : for specifing a term.
**\<kbd>** : for defining a keyboard input.
**\<samp>** : for defining sample output from a computer program.
**\<meter>** : or representing either a scalar value within a known range or a fractional value.
**\<dl>** : for defining a description list.

## References

+ [www.w3schools.com](https://www.w3schools.com/)
+ [www.developer.mozilla.org](https://developer.mozilla.org/en-US/)

Have an amazing day!
Convert a Microsoft Word document to markdown
Published: 2021-07-28 22:04:46

---
title: Convert a Microsoft Word document to markdown
published: true
date: 20/07/2021
tags: 
canonical_url: https://darraghoriordan.com/2021/07/16/converting-word-doc-to-markdown-md/
---

How to convert a Microsoft Word document like `.doc` or `.docx` to markdown.

<!-- end excerpt -->

```
# first install pandoc (use brew for macOS)
brew install pandoc

# then this is the command to convert the file
# the markdown type converts tables and the extract media will put all images in ./media
pandoc -f docx -t markdown my-document.docx -o my-markdown.md --extract-media=./
```

That’s it. Short one. Hope it helps!
How to style HTML elements tags using the id attribute in CSS?
Tags: css
Published: 2021-07-20 00:00:00

---
  title: How to style HTML elements tags using the id attribute in CSS?
  published: true
  tags: CSS
  date: Tue Jul 20 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/style-html-element-tags-using-id-attribute-css
  cover_image: https://melvingeorge.me/_next/static/images/main-45f42f7c054a974302e326279f807f1d.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/style-html-element-tags-using-id-attribute-css)
  
To style an HTML element tag using an `id`, you can use the `id` attribute on the HTML element tag and then assign a unique name as the id to that element.

Since all the `id` names should be unique, you cannot apply one `id` to more than 1 element in the HTML.

For example, consider a `p` (paragraph) tag with an id of `pTag` in HTML like this,

```html
<!-- Paragraph tag-->
<p id="pTag">Hello World!</p>
```

Now in the CSS stylesheet, we can apply the styles to the `p` HTML tag by writing the name of the id.

To denote that we are using an `id` in the CSS stylesheet we need to use the `#` (hash character) before writing the name of the id.

It can be done like this,

```css
/* Use the "pTag" id to set paragrah tag text color as red */
#pTag {
  color: red;
}
```

This will apply a font color of `red` to the text inside the `p` (paragraph) HTML element tag.

See the above code live in [JSBin](https://jsbin.com/xufiruboge/2/edit?html,css,output).

### How is it different from using the `class` attribute?

- When using the `class` attribute to style HTML elements, we can reuse the class names and apply them to more than 1 HTML element tag.

- But when using an `id` attribute, we cannot reuse it more than once.

That's all 😃!

### Feel free to share if you found this useful 😃.

---