teleren/devto huggingface dataset:
Simple Environmental Variable Setup in React and Node Applications
Tags: javascript, react, node, productivity
Published: 2022-02-28 12:35:00

[env-cmd](https://www.npmjs.com/package/env-cmd) provides a simple and efficient method for configuring environmental variables.

## Install
```bash
npm install env-cmd 
or 
npm install -g env-cmd
``` 
## Usage
There are two methods of usage.
### Method 1
It involves using different `.env` files e.g `.env.development`, `.env.staging`, `.env.production`.

**- For an enviroment file `.env` at the root directory.**
```env
./env

# This is a comment

REACT_APP_APPLICATION_NAME=TodoApp
REACT_APP_API_BASEURL=http://api.test.com
```
`Package.json`
```json
{
  "scripts": {
    "start": "env-cmd react-scripts start"
  }
}
```

**- Using custom env file `.env.development` or file path `./abc/def/.env`**
```env
./env.development

# This is a comment

REACT_APP_APPLICATION_NAME=TodoApp
REACT_APP_API_BASEURL=http://api.test.com
```
`Package.json`
```json
{
  "scripts": {
    "start": "env-cmd -f ./env.development react-scripts start"
  }
}
```

### Method 2
Like me, if you like to put all your environments in one file.
Create `.env-cmdrc.json` at the root directory.
```json
./env-cmdrc.json

{
  "development": {
    "REACT_APP_APPLICATION_NAME": "TodoApp",
    "REACT_APP_API_BASEURL": "http://api.test.com"
  },
  "staging": {
    "REACT_APP_APPLICATION_NAME": "TodoApp",
    "REACT_APP_API_BASEURL": "http://staging.test.com"
  },
  "production": {
    "REACT_APP_APPLICATION_NAME": "TodoApp",
    "REACT_APP_API_BASEURL": "http://production.test.com"
  }
}
```
`Package.json`
```json
{
  "scripts": {
    "start": "env-cmd -e development react-scripts start"
  }
}

or

{
  "scripts": {
    "start": "env-cmd -e production react-scripts start"
  }
}
```
Hope you find this helpful !
🚀 Quick Tips: Globally Registering Vue Components
Tags: vue, javascript, webdev, tutorial
Published: 2022-02-28 12:22:14

When we use vue, it's common to register a component within another component. In this tutorial, we're going to look at how you can globally register a component in Vue, so you never have to reference is in your component again - instead you can use it straight in your `<template>` tag.

[If you are new to Vue, check out our guide on creating your first Vue application before starting.
](https://fjolt.com/article/vue-create-your-first-app)

## Registering components in Vue
It's normal in Vue to see something like this, where a component is registered within another component, for use inside the <template> tag:

```vue
<template>
    <MyComponent />
</template>
<script>
import MyComponent from '../components/MyComponent.vue';

export default {
    name: "ParentComponent",
    components: {
        MyComponent
    }
}
</script>
```
This is useful for components that may not be needed everywhere in the app, but it is quite normal to have a component which is used almost everywhere in your app. To save yourself referencing it in every file, you can globally register it instead.

## How to Globally Register a Component in Vue
To globally register a component in vue, open your main.js file. You should see something like this:

```javascript
import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')
```
When we want to globally register a component in Vue, we need to do it in this file. All you have to do is import your component, as you usually would, and then register it using app.component.

```javascript
import { createApp } from 'vue'
import App from './App.vue'

// Import your component
import MyComponent from '../components/MyComponent.vue';

// Your app
const app = createApp(App);

// Globally register your component
app.component('MyComponent', MyComponent);

// Mount your app
app.mount('#app');
```
Now we can reference our `<MyComponent />` component from anywhere within our Vue app. `app.component()` has two arguments - the first is the name we are giving to our component, and the second is the imported component.

As such, we can now simplify our original code to just this:

```javascript
<template>
    <MyComponent />
</template>
<script>
export default {
    name: "ParentComponent"
}
</script>
```
Running white library desktop automation in windows based server
Tags: whitelibrary, jenkin, automation, testing
Published: 2022-02-28 12:04:42

In jenkins CI-CD jobs, the linux machines are available to trigger our automation code. So if our automation code consists of selenium library and other libraries, the job will perform without errors and automation report will be generated.
But one issue arises here, when we do the automation for desktop based application using white library. The white library interacts with desktop elements and not capable of running those automation code in the linux agents which are present in the jenkins. There is a challenge to add windows agent in the jenkins and complex
solution - get a dedicated windows based virtual machine which will do the job for you, executing a desktop based automation without fail. The linux agent will not be required for the same and it wont work anyhow.
setup up the application in the Virtual machine in prior for which you have written a automation code. Add the config files in the jenkins file and give the correct project and absolute file path of the project.
Once you trigger the freestyle job pipeline, it will start the execution in the dedicated machine. 
Set the env variables in the jenkins files like username, password and the required fields.
🎉 Fireboard - A work tracker for software developers
Tags: showdev, webdev, productivity
Published: 2022-02-28 11:59:00

🎉 Launching my side project ‘Fireboard’ - A work tracker for software developers.
Track daily & pending work right using Google chrome extension or web app.

Features:
➕  Add & View daily tasks
🕖  Assign deadlines to tasks
✅  Mark tasks as completed
✨  Group tasks by feature
📅  Add date to start/end a feature
🗒️  View daily work done
⏪  View complete work timeline


![Preview 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lurzden2oo2adciad9hn.png)


![Preview 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aaqwy2p6phus2t99b0zw.png)

[Demo](https://www.youtube.com/watch?v=NvD6Cv4PiTc&t=6s) • [Product hunt](https://www.producthunt.com/posts/fireboard)

Visit [www.fireboardapp.com](https://www.fireboardapp.com) for more
DM for feedback/collaboration
Hope you like it
SQL date 1900-01-01 appearing out of nowhere
Tags: programming, mssql, database
Published: 2022-02-28 11:57:05

---
title: SQL date 1900-01-01 appearing out of nowhere
published: true
date: 2022-02-28 11:55:57 UTC
tags: programming,mssql,database
canonical_url: https://siderite.dev/blog/sql-date-1900-01-01-appearing-out-of-nowhere/
---

Original post at: https://siderite.dev/blog/sql-date-1900-01-01-appearing-out-of-nowhere/

 So I got assigned this bug where date 1900-01-01 was displayed on the screen so, as I am lazy, I started to look into the code without reproducing the issue. The SQL stored procedure looked fine, it was returning:

```
SELECT
  CASE SpecialCase=1 THEN ''
  ELSE SomeDate
  END as DateFilteredBySpecialCase
```

Then the value was being passed around through various application layers, but it wasn't transformed into anything, then it was displayed. So where did this magical value come from? I was expecting some kind of _ISNULL(SomeDate,'1900-01-01')_ or some change in the mapping code or maybe SomeDate was 1900-01-01 in some records, but I couldn't find anything like that.

Well, at second glance, the selected column has to have a returning type, so what is it? The [Microsoft documentation](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/case-transact-sql "CASE (Transact-SQL)") explains:

> Returns the highest precedence type from the set of types in result\_expressions and the optional else\_result\_expression. For more information, see [Data Type Precedence](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-precedence-transact-sql "Data type precedence (Transact-SQL)").

If you follow that link you will see that strings are at the very bottom, while dates are close to the top. In other words, a CASE statement that returns strings and dates will always have the return type a date!

```
SELECT CAST('' as DATETIME) -- selects 1900-01-01
```

Just a quickie. Hope it helps.
Dart basics - part 2
Tags: dart, basics, flutter, functions
Published: 2022-02-28 11:35:47


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


in the [first](https://dev.to/kururu95/dart-basics-part-1-238l) post we covered some basics like variable and control structure
 in to days lesson we are going to focus on **Functions**


**Functions in Dart**


generally ,  there are two type of functions in dart like other languages: 
     - function return a value
     - function not return any value(  void )



> function form:
>     [type]  function_name(  [variables] ) {
>     [return    ]
> }





for example ,  function  accepts two params and show the sum of them:

`
void sumTwoValues(int x, int y){
   var sum =  x+y;
print(sum);

}`


**note**: the return type is optional as dart can inferred the type:)




an example of the function with return  type , let's create a function the accept a text and return a length of that text

   `int   textLngthGenerator(Stirng txt){

    return txt.length;
  }`


 to invoke this function:

`
   var text= 'i love Sudan';
  var textLength = textLngthGenerator(text);
print(textLength);`
   


**You** noticed that you can use single quotes to represent a string 



we stop here  , and in the next post will discuss some topics related to functions like:
    - higher-order functions
    - callback functions
    -  extension functions


thanks for reading :)
Check the Latest Lunchtime Result sTips 
Published: 2022-02-28 11:34:44

[49's](https://uklunchtimeresults.com/) - The Original Live Drawhttps://49s.co.uk › 49s
Teatime Draw 9:49 AM. Bonus. 1. 5. 6. 28. 36. 40. 41. The 3 hottest and coldest numbers for 49's are based on results over the last 56 draws
TODOiXo - To never forget your tasks
Tags: internship, javascript, webdev, beginners
Published: 2022-02-28 11:26:15

I got selected for [LetsGrowMore](https://letsgrowmore.in/) a venture by Aman Kesarwani, where I have to submit web projects before deadline.
The journey was amazing, but what is more amazing than that is the community support I get through Linkedin groups. The active community helps me to grasp things clearly.
I have completed 2 task followed by [Todoixo](https://todoixo.netlify.app/) a simple todo app in vanila js, and Calculator with React js named as Calsio.
Both projects are joyful.
I wish everyone can join LetsgrowMore. they offer wide range of internship for all students.
8 GitHub resources for becoming a developer in 2022
Tags: javascript, webdev, beginners, programming
Published: 2022-02-28 11:19:22

Learning how to become a developer can be an extremely daunting process for beginners. I have put together a list of resources which is useful for both beginners and people who are already familiar with programming.

This list covers:

- Roadmaps
- Study Plans
- Books
- App Ideas
- Design Resources
- Free Public API's

Here are 8 great resources on GitHub to help you with your programming journey.

1) [Roadmap to becoming a developer in 2022](https://github.com/kamranahmedse/developer-roadmap)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806411/2022_roadmap_rj6zil.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806411/2022_roadmap_rj6zil.png)

2) [A complete computer science study plan to become a software engineer](https://github.com/jwasham/coding-interview-university)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/computer_science_study_plan_wgr5v5.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/computer_science_study_plan_wgr5v5.png)

3) [Freely available programming books](https://github.com/EbookFoundation/free-programming-books)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/freely_available_programming_books_kwjg36.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/freely_available_programming_books_kwjg36.png)

4) [You Don't Know JS (book series) - 1st Edition](https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/README.md)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/you_dont_js_book_series_1_lx3jvj.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/you_dont_js_book_series_1_lx3jvj.png)

5) [You Don't Know JS Yet (book series) - 2nd Edition](https://github.com/getify/You-Dont-Know-JS)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/you_dont_js_book_series_2_obytiz.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/you_dont_js_book_series_2_obytiz.png)

6) [A Collection of application ideas which can be used to improve your coding skills](https://github.com/florinpop17/app-ideas)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806411/a_collection_of_app_ideas_p5cczp.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806411/a_collection_of_app_ideas_p5cczp.png)

7) [Design resources for developers](https://github.com/bradtraversy/design-resources-for-developers)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806411/design_resources_for_developers_jw9gho.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806411/design_resources_for_developers_jw9gho.png)

8) [A collective list of free APIs](https://github.com/public-apis/public-apis)

![https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/a_collective_list_of_free_apis_cwuphm.png](https://res.cloudinary.com/d74fh3kw/image/upload/v1645806412/a_collective_list_of_free_apis_cwuphm.png)
Backend Development at Factorial
Tags: php, drupal, symfony, laravel
Published: 2022-02-28 11:17:21

What challenges do we face in backend development at Factorial? And what role does Drupal play in our work as an agency? In our latest video, Shibin, Senior Backend Developer at Factorial, gives an overview of our projects and how we develop digital solutions for our clients. 

He also mentions our technology stack we work with and the importance of open-source of us as a company.

Find the clip here:
[See Video](https://www.youtube.com/watch?v=oRLrnhYAlSY&t=8s)
Why Choose Mean Stack Development for Your Business?
Tags: meanstackdevelopment, meanstack
Published: 2022-02-28 11:16:58

With the recent years witnessing an exponential expansion in terms of digital transition and online presence for the businesses, [mean-stack development](https://www.silvertouch.com/enterprise-software-services/min-stack-development/) has seen a great demand too. Most businesses have made a global presence breaking the boundaries of the nooks and corners where they had been surviving for years. 

With technological advancement in the picture, the solutions are turning out to be not just user-friendly but technologically advanced and interesting. Mean-stack development services have survived the test of time and made it quite easier for developers and businesses to enter the market with solutions that are bound to reflect well. 

Understanding Mean Stack Development 
Mean-stack development entails both front-end and back-end development, making it very simple for developers to bring an entertaining and technically sound solution to the screen. Web applications and web pages are both possible projects for the developers here. They have experience with the product's frontend, backend, database, and troubleshooting.

Any mean Stack Development Company's MEAN and MERN stack developers have the ability to revolutionize the way things are done. Various businesses have recognized them as valuable assets, and they are in high demand.
My 3 favourites Windows Apps from the Store (free)
Tags: windows, free, tooling
Published: 2022-02-28 11:16:02

Since 10 years (more or less) Microsoft has a store for the Apps.
The latest version in Windows 11 is really cool and more user-friendly.
One of the benefits to use the Microsoft Store is the applications updates automatically where an update is available from the store.

# PowerToys 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ma1uyipufxcfabdxl3jo.png)
 
Powertoys is a set of utilities created by Microsoft and it contains a lot of useful features for your desktop and a lot of "shortcuts" for productivity.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/93diq6re6sf2kim8rjrc.png)
 
My favourites tool inside PowerToys are:
- Fancy Zones: you are allow to create custom window layouts and arrange all the windows very easily on them
- Run: it's like the macOS Spotlight with a lot of utilities inside like searching file, a calculator, system tasks and much more.

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

You can find additional information about PowerToys [here](https://docs.microsoft.com/en-us/windows/powertoys/).

# Files

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

Are you annoyed about your File Explorer and you need a powerful one?
Files it's for you.

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

The best feature is: tabs.
You can have multiple explorer windows in one window but organized in tabs.
It also looks nicer than the normal File Explorer and more fluid.
It's open source and it's written in WPF.

# Journal

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

I discovered this application only a few weeks ago and it became one of the best app for me.
I am an handwriting notes fan and this app solves my problem to take notes on my pc.
Especially with my Surface Book 3.
I can use my Surface Pen and takes note on the fly on it.
Very often I use my Book 3 without the keyboard close to my main PC just for taking notes.

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

It's still a Microsoft Garage project but it works very well.
Of course, it's free but it has a lot of features that you can find only inside professional applications.
Data Science & Algorithms: Insertion Sort
Tags: algorithms, javascript, python, datascience
Published: 2022-02-28 11:07:28

Recently, I decided to start blogging on this website. And I don't have any ideas for a blog. Well, I don't know what the meta is here.

So, I thought I'd do a series where I explain different algorithms in different languages( Python, JavaScript).

Now, that we got the intro out of the way, let's start with the first algorithm :). **Insertion Sort**

To understand the theory behind Insertion Sort I'll give you an analogy:

Imagine that you have a list of cards( let's say 4) in no particular order on the table. And you have to sort those cards on your left hand.

So what do you do? 
Well, you're going to get a card with your right hand, examine that card, look at the left hand. 

If you don't have any cards on your left hand you will put the right-hand card on your left hand, if you have a card on your left hand you'll compare the card on your left hand and right hand. If the right-hand card has a higher value you will insert that card after the previous one( it's a little confusing I know) otherwise you'll push the card on your left hand further to make room for the right-hand card.



**Sorry for the big chunk of text** :(

Now that we understand how Insertion Sort works on a theoretical level, let's look at how we can do this in code:

Here Is The **Python** Code:

```
# Python Code
def insertion_sort(arr):
    # Loop Through Array
    for i in range(len(arr)):
        # Store Selected Element Value In A Variable
        key = arr[i]
        # Store Previous Array Index In A Variable
        j = i - 1
        
        # Check If There Are Any Other Previous Elements
        # Compare Previous Array Element With Current Element
        while j >= 0 and key < arr[j]:
            # If Previous Element Has A Higher Value Than Current Element, "push it" one index further to "make space" for the current element
            arr[j + 1] = arr[j]
            j -= 1
        
        # Store Current Element In The Position Where It Belongs
        arr[j + 1] = key

arr = [2, -4, 0, 1, 69] # Random Array
insertion_sort(arr)
print(arr)

# Output:
# [-4, 0, 1, 2, 69]
```

Here Is The **JavaScript** Code:

```
function insertionSort(arr) {
  let i, key, j;
  for (i = 1; i < arr.length; i++) {
    key = arr[i];
    j = i - 1;

    while (j >= 0 && arr[j] > key) {
      arr[j + 1] = arr[j];
      j = j - 1;
    }

    arr[j + 1] = key;
  }
}

let arr = [2, -4, 0, 1, 69];
insertionSort(arr);

console.log(arr);

// Output:
// [ -4, 0, 1, 2, 69 ]
```


And that's the end of this one! Hope you enjoyed it! Don't forget to like!!!
How can I start learning Kubernetes
Tags: kubernetes, devops
Published: 2022-02-28 10:39:38

This is a video for those who wants to learn Kubernetes and don't know where to start. You need internet and a simple laptop or desktop to start. No need to install the Kubernetes cluster. You can also use browser to use Katacoda cluster.

https://youtu.be/_DgeMDe0D2g
{% youtube _DgeMDe0D2g %}
Exciting web 3.0 startup
Published: 2022-02-28 10:36:48

We are an exciting Web 3.0 start-up who are closing a funding round and are excited to move to the next stage of our development supported by a strong suite of investors.

We are well funded and believe we are creating a market leading NFT Exchange with clearly defined USP's. 

We are looking for passionate and driven individuals to join our team. Initially, a mid-tier/senior frontend developer, a mid-tier/senior backend developer and a talented designer.

For the Backend we require the following as a minimum; Python, DjangoRestFramework, GraphQL, Postgres, Restapi integration, Devops.

For the Frontend we require the following as a minimum; React.js, Javascript, Mobile friendly development, Rest api integration, GraphQL integration.

If you are interested in being part of an early stage company with a strong cap table and have an interest in Web 3.0/NFT sector. 

Please email us a careers@thebrookesproject.com
Giving power back to the Client!
Tags: strapi, cms, react, frontend
Published: 2022-02-28 08:39:54

While working on web application (especially those whose content is dynamic), we will often want to add or change some content on the website, so in our best interest is to ensure that those changes would not mean any additional developer work. To achieve that, we can use CMS system, my favorite one so far is Strapi CMS.

The client usually does not want to be dependent on a software developer. He would like to independently control the content of his application, for example in a blog, add new posts, change pictures, etc. In turn, the developer does not want to correct typos in the client's text or change the picture on the post again.

By determining together with the client, the developer or client can define all the fields in the strapi that are needed by the client to manage the content. For example, when building a post section - they can define fields: title, description, picture /video, etc. after which content of those fields can be fully managed by client.

Independence will bring benefits to each of the parties (developer and client) and this is how it should work.

Below short video of strapi CMS, where the client manages the content himself and the view how it is then displayed on the website.


![strapi example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ua51lyldotd22zgchv7.gif)