teleren/devto huggingface dataset:
Book Review: Building a Second Brain by Tiago Forte
Tags: bookreview, buildingasecondbrain, notetaking, productivity
Published: 2023-08-15 08:12:06

I am a note taking enthusiast, I like to try different note taking apps. Some people upgrade their iPhones every year others buy the latest sneakers. I try to keep up with the shiniest note taking tool. This led to a huge problem, I was great at consuming and collecting information but failed to derive any value from it.  I have documented hundreds of code snippets and solution to unique problems related to my work, however I was not able to retrieve them, if I faced any similar problem. 

**Building a Second Brain by Tiago Forte** is a great book on organising the information we capture and unlock our creative potential.  The author has superbly written effective strategies on note taking and deriving value from the notes we take.  In today's world, we are being bombarded by information. We are able to bookmark important articles, research papers, videos but don't have time to reflect upon them. When we invest in Mutal Funds or Stocks, we are making our money work for us right? That is most common phrase we hear from financial advisors, "Let your money work, while you sleep". In the same manner, the author explains, the information we capture should open us to new ideas, see connections between different areas and help us become more productive. The author also gives motivating examples from his own life and how effective note taking made him the go-to guy at his workplace. 


**CODE: Capture, Organize, Distil, Express.** CODE is an effective note taking strategy in which the author goes in great detail as to what information to capture, how to organise information which can be retrieved later easily, extracting the essence of an article, blog post or a video and expressing our ideas to others. 

I had a great time reading this book and it gave me important insights as to capturing and organizing information. I recommend it to anyone who has a habit of hoarding information but find it difficult to organize and extract real value from them.
"Python Flask Framework Short Notes with Commands"
Tags: python, programming, beginners
Published: 2023-08-15 08:06:13


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


Flask is a lightweight web application framework written in Python.
 Here are some basic commands and notes for Flask:

1.Install Flask: 

```
pip install Flask
```
2.Import Flask in your Python file: 

```
from flask import Flask
```
3.Create a Flask app instance: 

```
app = Flask(__name__)
```
4.Define a route using the @app.route() decorator:

```
@app.route('/')
def home():
    return 'Hello, World!'
```
5.Run the Flask app:

```
if __name__ == '__main__':
    app.run()
```
6.Access the app in your browser at 

```
http://localhost:5000/
```
7.To pass variables in a URL, use angle brackets in the route definition:

```
@app.route('/user/<name>')
def user(name):
    return f'Hello, {name}!'
```

8.To run the app in debug mode, set the debug parameter to True:

```
if __name__ == '__main__':
    app.run(debug=True)
```

These are just the basics of Flask. There are many more features and commands available in the framework.


There is a free Udemy course available for beginners on Python Flask at the following link: 
https://www.udemy.com/course/python-flask-for-beginners/
How to add multiple object and multiple image with nodejs, Mongodb, and react
Tags: javascript, node, react, mongodb
Published: 2023-08-15 08:02:30

Node.js, MongoDB, and React are powerful tools that can be used together to create dynamic and interactive web applications. In this article, we will explore how to add multiple objects and multiple images using these technologies.

Setting up the Environment
--------------------------

Before we dive into the implementation, let's make sure we have everything set up correctly.

1.  Make sure you have Node.js and MongoDB installed on your machine.
2.  Create a new project folder and navigate to it in your terminal or command prompt.
3.  Initialize a new Node.js project by running the command `npm init`.
4.  Install the necessary dependencies by running the following commands:

`npm install express mongoose react react-dom`

Building the Backend
--------------------

First, let's set up the backend using Node.js and MongoDB.

1.  Create a new file called `server.js` and require the necessary modules:

`const express = require('express'); const mongoose = require('mongoose');`

2.  Set up a basic Express server:

``const app = express(); const PORT = process.env.PORT || 5000; app.listen(PORT, () => { console.log(\`Server is running on port ${PORT}\`); });``

3.  Connect to your MongoDB database:

`mongoose.connect('mongodb://localhost/mydatabase', { useNewUrlParser: true, useUnifiedTopology: true, });`

Creating the Models
-------------------

Next, let's create the necessary models for our objects and images.

1.  Create a new folder called `models` and inside it, create two files: `Object.js` and `Image.js`.
2.  In `Object.js`, define the schema for your object:

`const mongoose = require('mongoose'); const objectSchema = new mongoose.Schema({ name: { type: String, required: true, }, description: String, }); module.exports = mongoose.model('Object', objectSchema);`

3.  In `Image.js`, define the schema for your image:

`const mongoose = require('mongoose'); const imageSchema = new mongoose.Schema({ url: { type: String, required: true, }, caption: String, }); module.exports = mongoose.model('Image', imageSchema);`

Implementing the Frontend
-------------------------

Finally, let's implement the frontend using React.

1.  Create a new folder called `client` and navigate to it in your terminal.
2.  Initialize a new React project by running the command `npx create-react-app .`.
3.  Replace the contents of `src/App.js` with the following code:

`import React from 'react'; function App() { return (

Hello, World!
=============

); } export default App;`

Conclusion
----------

By following the steps outlined in this article, you should now have a basic understanding of how to add multiple objects and multiple images with Node.js, MongoDB, and React. Feel free to explore and expand upon this foundation to create more complex and feature-rich applications.

References
----------

*   Node.js - [https://nodejs.org/](https://nodejs.org/)
*   MongoDB - [https://www.mongodb.com/](https://www.mongodb.com/)
*   React - [https://reactjs.org/](https://reactjs.org/)
Mastering JavaScript Code Quality: 10 Essential Tips with Examples
Tags: javascript, programming, beginners, productivity
Published: 2023-08-15 08:00:06

**Introduction:**

JavaScript is a powerful language that can be used to create interactive and dynamic web pages. However, it can also be a challenging language to learn, especially for beginners. In this article, we will explore 10 essential tips for writing effective JavaScript code, complete with practical examples that demonstrate their application.

**Tips with Examples:**

**1. Use Descriptive Variable Names:**
Choosing meaningful variable names enhances code readability and makes your intentions clear to both yourself and other developers.

![Descriptive Variable Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1jcqc3zbodef4odw15t.png)

**2. Use Comments:**

Comments provide insights into your code's logic and purpose, aiding understanding and future maintenance.


![Comments Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjikl45e504f97ui2mga.png)

**3.  Break Code into Functions:**

Breaking code into smaller, reusable functions enhances modularity and makes complex logic easier to manage.


![Function Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evznu09dhxoaoqq17x5m.png)

**4. Use Whitespace:**

Properly formatted code with consistent indentation and spacing enhances readability


![Whitespace Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3d39fae81eukehmo9xsx.png)

**5. Use Linters:**

Linters analyze your code for errors and style violations, ensuring consistent and error-free code.


![Linter Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elyy8rivmp6zbyjm3h91.png)

In this code snippet, there's a typo in the console.log function call, where console.lo is used instead of console.log. ESLint would catch this error and report it, helping you identify the mistake in your code.


**6. Regular Testing:**

Regular testing helps catch bugs early and ensures your code functions as expected.


![Testind Code Using Console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9j0nddw5mahs7gw7dm8q.png)


**7. Version Control:**

Utilizing version control like Git tracks changes, facilitates collaboration, and maintains a history of your codebase.


![Git Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mdqaedg1x0h2cipvkz4o.png)


**8. Code Editor with Syntax Highlighting:**


Code editors with syntax highlighting improve code visibility and help identify syntax errors.


**9. Read Others' Code:**

Studying other developers' code exposes you to different styles, patterns, and solutions. Let's analyze a basic AJAX call as an example:


![Code Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4azfxni1heci1627ko4r.png)


**10. Ask for Help:**


Don't hesitate to seek assistance from peers or online communities. Here's an example of asking for help to improve error handling:



![Code For Help Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zusy2xpb0tlxo0pxc0n3.png)
Navigating the Future in an AI-Centric World
Tags: career, ai, productivity
Published: 2023-08-15 07:58:10

This understanding has been derived from my involvement in crafting hundreds of tech articles at DiggerInsights. (www.di
ggerinsights.com)

The significance of critical thinking skills is closely tied to the rise of AI. In a world where information is effortlessly accessible, the demand for adept critical thinking abilities is higher than ever before, poised to reach unprecedented heights. Foundational knowledge remains essential, but memorization is no longer as crucial as the ability to think critically.

As an engineer, I don’t bother memorizing syntax or formulas that lack repetitive application. Instead, I prefer to spend a few seconds using AI to find the specific syntax or formula I need. This is quite different from the days when people were discouraged from asking on platforms like Stack Overflow and searching through heaps of code, often consuming minutes, if not hours, of valuable time.

as a business person, I find that thriving in the modern business world requires more than just memorizing market trends or statistics. Critical thinking is the cornerstone of devising innovative strategies, adapting to changes, and solving intricate problems. Unlike the past, where hours were spent sifting through archives for business insights, today’s AI-driven landscape allows me to swiftly retrieve pertinent information, freeing up time to focus on strategic thinking and decision-making.

It’s a crucial time to reflect on our cognitive abilities and further enhance our critical thinking skills. 💡

How would you navigate in the future of an AI-dominated landscape? The exact timing remains uncertain, but it is inevitable.
Webinar: How to Create Broadcast Extension and Publish iOS Screen with WebRTC
Published: 2023-08-15 07:48:29


Hey tech enthusiasts🔥

We are delighted to announce a community event that will supercharge your knowledge and skills in the world of iOS development.

🗓️ Date: August 17th
⏰ Time: 6:00 PM GMT+3
🎙️ Speaker: Anush B M

- Event Link 👉🏻 https://meet.google.com/psn-tmev-drv

Agenda:
1. Create Broadcasting Extension in iOS
2. Publish iOS Screen with Audio through WebRTC
3. Play the iOS Screen in Real-Time with WebRTC

🎤 Speaker:
Get ready to be inspired by Anush B M, a true maestro in the world of iOS development. With a passion for innovation and a knack for simplifying complexities, Anush will be your guide on this exhilarating journey.

🎉 Why Attend?
-Elevate your iOS development skills with hands-on insights.
-Network with fellow tech enthusiasts and expand your horizons with Ant Media
-Discover the incredible potential of WebRTC for real-time interactions.
-Stay tuned for the win-win opportunities coming from the ecosystem of Ant Media

See you on the virtual stage🔥
Intro to React-native
Tags: reactnative, javascript, beginners, tutorial
Published: 2023-08-15 07:40:51


![Final Look our App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/szafwz51dhh2lug4bkc0.png)

We will be using expo to build our first app


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


1. ###open up App.js clear all the code 

2. ###importing required dependencies

3. ###Defining the Main component of our app

```
`export default function App() {
  return (
    // Outermost container that holds all other components
    <View style={styles.container}>
      {/* Nested View containing a piece of text */}
      <View>
        <Text>Another piece of text!</Text>
      </View>
      {/* Text component displaying "Hello World!" */}
      <Text>Hello World!</Text>
      {/* Button component with title "Tap me!" */}
      <Button title='Tap me!' />
    </View>
  );
}
const styles = StyleSheet.create({
});`
```

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

4.###styling our App

```
const styles = StyleSheet.create({
  // Styles for the outer container
  container: {
    flex: 1, // Take up the available space
    backgroundColor: 'pink', // Set background color to pink
    alignItems: 'center', // Align child components horizontally
    justifyContent: 'center', // Align child components vertically
  },
});
```

5. ###Final code 
```
import { StyleSheet, Text, View, Button } from 'react-native';
export default function App() {
  return (
    <View style={styles.container}>
      <View>
        <Text>Another piece of text!</Text>
      </View>
    <Text>Hello World!</Text>
      <Button title='Tap me!' />
    </View>
  );
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'pink',
    alignItems: 'center',
    justifyContent: 'center',
 },
});
```
🛑 Back to the Basics: WHY FALSE NEVER GETS PRINTED IN PHP ❓❓
Tags: php, webdev, softwaredevelopment
Published: 2023-08-15 07:34:50

❗Boolean in all languages means a data type that can either be **true** or **false**. But in PHP, boolean has a mysterious behavior. Before getting into that, let's talk about **true** and **false** in PHP.

❗In PHP, there are a few values that are by default false. They are:

- false: The defined false value itself
- null: The defined null value in PHP
- 0 and -0: Positive and negative integer values of 0
- 0.00 and -0.00: Positive and negative float values of 0
- "": empty string
- [ ]: Empty array

❗Any other values except these are considered **true** in PHP. For example:

```
# This is an empty string value
$value = "";

# If we check it with is_bool()  
echo is_bool($value);
# we will get 1 or true 

```
❗On the other hand 

```
# This is a string 
$value = "false";

# If we check it with is_bool()
echo is_bool($value);
# we will get no output or false
```
❗Now this brings us to the main  question: **WHY FALSE NEVER GETS PRINTED IN PHP?**

Often, when we try to print a false value with **echo** or **print**, it prints nothing, no output on screen. But why?

     
❗For this, we have to understand **the printing mechanism in PHP**. While printing, both **echo** and **print** converts or typecasts everything into a string. That is why when we try to print an array with any of them, it gives us a conversion error because it can’t convert an array to a string. But for boolean values, they can do this.

❗Both **echo** and **print** type casts a true boolean value into the string value "1" and a false boolean value into the string value "" which is an empty string and then prints the value. Let's test this with an example:

```
$test = true;
# Type casting the value into a string
$typeCasted = (string)$test;

# var_dump() displays the detailed information # about a variable 

var_dump($typeCasted);
# we get string(1) "" : which means 
# this is a string with 1 character
# and the value is "1" 

echo $test 
# this does the type casting 
# to convert into string
# and prints the value "1"

```
On the other hand for false 

```
$test = false;

# Type casting the value into string
$typeCasted = (string)$test;


var_dump($typeCasted);
# we get string(0) "" : which means 
# this is a string with 0 character
# and the value is empty string or ""

echo $test 
# echo does the type casting 
# to convert into string 
# and  prints the value ""

```
❗So this is why printing boolean true gives us a "1" string value, and printing false gives us a "" or empty string value. Thank you for reading.
Fetching Query String Values in JavaScript: A Step-by-Step Guide
Tags: beginners, javascript, webdev
Published: 2023-08-15 07:18:19

When working with web applications, extracting values from the `URL's` query string is a common task. Whether you're building a search feature or passing data between pages, `JavaScript `provides a straightforward way to capture query string values. In this guide, we'll explore the process with clear code examples.

## Step 1: Accessing the Query String

Consider a URL like `https://example.com/page?name=John&age=25`. To extract query string values, follow these steps:

## Step 2: Parse the Query String

In `JavaScript`, you can use the URLSearchParams `API `to parse the query string. Here's how:


![javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f4ej5a7erpl7arlddofb.png)

## Step 3: Use the Extracted Values

Now that you have extracted the query string values, you can use them as needed in your application logic.

## Handling Missing Parameters:

To handle missing parameters or provide default values, you can use conditional statements:

![javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rgxfwp8ayxqtgvxrnp0i.png)

## Conclusion:

Extracting query string values in `JavaScript `is a crucial skill for web developers. By utilizing the `URLSearchParams API`, you can effortlessly retrieve data from the `URL`, enabling dynamic interactions between users and your web application.

`LinkedIn Account` : [LinkedIn](https://www.linkedin.com/in/matthew-odumosu/)
`Twitter Account `: [Twitter](https://twitter.com/iamcymentho)
**Credit**: Graphics sourced from [VeesWorld](https://veesworld.com/jquery/how-to-remove-parameters-in-url-using-javascript)
An Introduction to Stashing in Git
Tags: github, git, webdev, tutorial
Published: 2023-08-15 07:16:01

## Problem

- Imagine a Scenario where you are on the master branch and you make a new branch and switch to it
- You do some new work but don’t make any commits. What happens when you switch back to master?
    1. My changes come with me to the destination branch
    2. Git won't let me switch if it detects potential conflicts so it advises us to either commit or **stash** them

## Stashing

- Git provides an easy way of stashing these uncommitted changes so that we can return to them later, without having to make unnecessary commits.
- `git stash` is super useful command that helps you save changes that you are not yet ready to commit. You can stash changes and then come back to them later. Now that you have stashed my changes, you can switch branches, create new commits, etc.
- Running git stash will take all uncommitted changes (staged and unstaged) and stash them, reverting the changes in your working copy. We don’t see the changes but they are saved.
- Use `git stash pop` to remove the most recently stashed changes in your stash and re-apply them to your working copy.
- You can use `git stash apply` to apply whatever is stashed away, without removing it from the stash. This can be useful if you want to apply stashed changes to multiple branches

## Stashing Multiple Times

- You can add multiple stashes onto the stack of stashes. They will all be stashed in the order you added them.
- Run `git stash list` to view all stashes
- Git assumes you want to apply the most recent stash when you run `git stash apply`, but you can also specify a particular stash like `git stash apply <stash-id>`
- To delete a particular stash, you can use `git stash drop <stash-id>`
- To clear out all stashes, run `git stash clear`
Single Dashboard of multiple Dashboard from Different GitHub repos
Tags: github, project, githubprojects
Published: 2023-08-15 07:09:49

Single Dashboard of Multiple Dashboards from Different GitHub Repos
-------------------------------------------------------------------

As a software developer, you may find yourself working on multiple projects hosted on different GitHub repositories. Keeping track of all these projects and their respective dashboards can be a daunting task. However, there is a solution that can make your life easier - a single dashboard that consolidates information from multiple dashboards across various GitHub repos.

Imagine having a single place where you can view the status, pull requests, and issues of all your projects without the need to switch between different tabs or repositories. This single dashboard acts as a central hub, providing you with a holistic view of your software development activities. It saves you time and effort, allowing you to focus on what really matters - writing code.

One way to achieve this is by leveraging GitHub's API. By using the API, you can fetch information from multiple repositories and aggregate it into a single dashboard. You can display metrics like the number of open pull requests, the number of issues, and even the latest commit activity. This consolidated view gives you a quick overview of the health and progress of your projects.

Setting up this single dashboard is relatively straightforward. Here are the general steps:

1.  Create a new web application or dashboard using your preferred programming language and framework.
2.  Authenticate with GitHub's API using a personal access token.
3.  Fetch the necessary information from the desired repositories using the API.
4.  Aggregate and display the fetched data on your dashboard.

The beauty of this approach is that it is highly customizable. You can choose which information to display and how to present it. For example, you might want to highlight repositories with a high number of open pull requests or prioritize those with recent commit activity. The possibilities are endless, and you can tailor the dashboard to suit your specific needs.

Of course, building a single dashboard for multiple GitHub repos does require some development effort. However, the benefits far outweigh the initial investment. Not only does it simplify your workflow, but it also brings a touch of fun to your development routine. Plus, impressing your colleagues with your fancy dashboard skills might earn you a few extra office laughs!

So why not give it a try? Take control of your GitHub repositories and enjoy the convenience of a single dashboard. With a little bit of coding magic, you can transform your software development experience and streamline your workflow like never before.

### References:

*   [GitHub REST API documentation](https://docs.github.com/en/rest)
*   [GitHub API v3 documentation](https://developer.github.com/v3/)
How Do You Handle Self-Doubt in Coding?
Tags: codenewbie, beginners, discuss, career
Published: 2023-08-15 07:00:00

Imposter syndrome is common among developers. How do you deal with self-doubt and feelings of inadequacy when coding? What advice would you give to others facing similar challenges?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*   

Image by <a href="https://www.freepik.com/free-vector/flat-hand-drawn-web-developers-illustration_12302679.htm#query=new%20coders&position=2&from_view=search&track=ais">Freepik</a>