teleren/devto huggingface dataset:
Conventional Commits
Tags: git, github, productivity, beginners
Published: 2020-03-05 12:24:18

Hello 🙋‍♂️, today I´m going to write about Conventional Commits (as you can see in the title). I've always wondered if there was a standardization with commits. I think this standardization is necessary and it can make our life easier. I asked a colleague if this exists, and it's the topic I'm going to talk to you about.

Git is a very powerful tool that most of us have installed on their machines. The worst part of using git is the no standardization with commits. Many people don´t follow any rules and the commit log, when you have to work with a team, has many possibilities to be chaotic. 

Conventional Commits is a specification for adding human and machine-readable meaning to commit messages. This is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history, which makes it easier to write automated tools on top of. This convention dovetails with [SemVer](https://semver.org), by describing the features, fixes, and breaking changes made in commit messages.

Commits should have the following structure: 

```
<type>[optional scope]: <description>

[optional body]

[optional footer]
```
- - - 

###Types of commit: 

- **feat**:  Add a new feature to the codebase (MINOR in semantic versioning).
- **fix**: Fix a bug (equivalent to a PATCH in Semantic Versioning).
- **docs**: Documentation changes.
- **style**: Code style change (semicolon, indentation...).
- **refactor**: Refactor code without changing public API.
- **perf**: Update code performances.
- **test**: Add test to an existing feature.
- **chore**: Update something without impacting the user (ex: bump a dependency in 
  package.json).


###Some examples: 

####Commit with no body: 

```
feat: allow provided config object to extend other configs

docs: correct spelling of CHANGELOG
```

####Commit message with scope: 
```
feat(lang): add spanish language
```

####Commit message for a fix using an (optional) issue number: 
```
fix: correct minor typos in code

see the issue for details on the typos fixed

closes issue #12
```
- - - 

##Benefits

#####Understandability

Commits are more descriptives and it's easier to understand them. It became also easier to contribute.

#####Changelogs

Automatically generating CHANGELOGs.

#####Revert changes

If you have one action per commit, it´s easier to revert a change or a git conflict

#####Improve your Git skills
Not all repositories have a squash and merge option, you sometimes have to do this operation by yourself. It's important to know what is going on under the machine operations!!

- - -

_Follow me on [Twitter](https://twitter.com/torresc_alvaro) if you want to know about my future articles, projects or whatever_
Thread: Mutex sucks
Published: 2020-03-05 12:17:52


We can syncronize threads with mutex, then what is the need of Condition Variable.
Whenever we start learning multithreading and mutex, we see some examples with mutex and CV. I found most of them does not explain the need of Condition Variable, it was very confusing for me. 
Now I know why it is required, I am trying to simulate the problem. Solution is of course Condition Variable. 
Please go through this article and let me know your suggestions. Critics are most welcome.

https://www.jhadheeraj.com/post/condition-variable-what-is-the-problem-with-mutex-alone
Build a wingman UI for your product
Tags: node, docker
Published: 2020-03-05 12:15:41

Imagine you are a startup trying to pitch your idea with the prototype to potential customers, then there will be several instances where you need to generate data, content, user login sessions etc. With all this simulated data properly sitting in the UI, you can plan and pitch your demo better. In order to do this consistently and repeatedly, a separate monolith UI+scripts totally other than your product interface just to simulate actual use cases would help you to deliver your pitch better and might even save time.

I have been working as full-stack developer with infrastructure based startups for the past several years. The product that gets built in these startups involves state, data, sessions, health checks, multiple user logins from several actual services, infrastructure and cloud resources. In all these products, we built and separate monolith demo UI to bring up and tear-down resources and services on-demand. These services would then push the actual data into the portal’s database and eventually into product portal’s UI. This method has helped us better rather than triggering the simulation using scripts.

For example, lets say you are building a highly scalable and performant video conference app and you would like to demonstrate the scalability of the product by really starting, not just emulating, 100’s of conferences with 10’s of users in each conference. This can be built using a script. Instead built a Demo UI and trigger this script from a UI button. This way you can clearly showcase what you are trying simulate.

**Advantages of building a demo portal**

<b>Repeatability</b>
1. Flexibility to pass dynamic inputs
2. Better clarity on what the simulation script does
3. Your CEO doesn’t have to SSH into a machine and trigger the scripts
4. Extend and scale the portal to show more info like dev metrics, logs, etc
5. Can be easily containerized and used by many

**Demo portal can be really lean**
1. Just one user login with a strong password
2. UI need not be aesthetically pleasing a decent one would do
3. Monolith app. API, microservices based development is not mandatory
4. If code is containerized, hosting in public cloud’s managed container service would help
5. Must have features in Demo UI

In all the demo UI built for infrastructure products there are these common functionalities

1. Tear-down all the resources
2. Reset Configuration
3. As the demo clicks are launching resources , its very important to tear them down and save cloud cost. As you are playing around changing configurations of the services and resources, we will screw up several things in the process and these configurations needs to be reset to some defaults.

**Technologies** I prefer building this portal - nodejs, docker, bootstrap, jquery, keeping it simple.
Creating Pivot Tables in PostgreSQL

Tags: postgres, database, pivot
Published: 2020-03-05 11:44:13

Pivot Table provides an interactive view of your data going significantly beyond the native crosstab function in PostgreSQL. With very little effort (and minimum queries) you can look at the same data from many different perspectives. This functionality comes in dbForge Studio for PostgreSQL along with other useful database management features. Try the tool and enjoy PostgreSQL pivoting without crosstab.

* Extract the significance from a large, detailed data set
* Slice and dice your database without a hitch
* Make your data more comprehensive
* Simplify data representation
* Get all the metrics you need

**Creating a Pivot Table**

To [create a pivot table](https://www.devart.com/dbforge/postgresql/studio/pivot-tables-in-postgresql.html), execute a query to select data you want to analyze and navigate to the query output. Right-click the data grid and select the Pivot table option from the Send to sub-menu. To add fields to the pivot table, simply drag them from the Data Source view to the required pivot table area.

Note:
Not all the data source tables are good for converting into pivot tables. The data source should contain a column with duplicated values, that can be grouped, and a column with numeric data, that can be used to calculate grand totals and custom totals.
Two-minute InfoSec — Shell History Timestamps
Tags: infosec, technology, security, dfir
Published: 2020-03-05 11:38:50

---
title: Two-minute InfoSec — Shell History Timestamps
published: true
date: 2020-03-05 11:31:29 UTC
tags: infosec,technology,security,dfir
canonical_url: https://medium.com/@chapindb/two-minute-infosec-shell-timestamps-8b439e07a7c6
---

### Two-minute InfoSec — Shell History Timestamps

#### A new series with a goal on sharing quick wins that can assist organizational security, forensic investigations, incident response and more that you can implement within two minutes or less.

![](https://cdn-images-1.medium.com/max/1024/0*J20fz0IwdoSD3ayZ)<figcaption>Photo by <a href="https://unsplash.com/@kaitlynbaker?utm_source=medium&amp;utm_medium=referral">Kaitlyn Baker</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

Today’s post is focused on a a feature of nearly any shell — command history. This file is a rich source of evidence for prior user activity, especially on Linux/Unix/macOS systems. One major draw back is that by default, this file does not store timestamps, making analysis of the data difficult and cost a lot of valuable investigative time.

In this post we will cover how to quickly implement timestamps in some common shells including:

- Bash
- Zsh
- Fish

Not all Linux/Unix/macOS platforms are made the same! These are general ways to accomplish this goal, but always test before putting things into production.

### Bash

To add for user accounts, modify the `~/.bashrc` or `~/.bash_profile` files and add the below:

```
export HISTTIMEFORMAT ="%F %T %z "
```

This same line can be placed in /etc/bashrc to load across user profiles.

Source: [https://linux.die.net/man/1/bash](https://linux.die.net/man/1/bash)

### Zsh

For user accounts, add the below line to `~/.zshrc` or `/etc/zshrc` for system wide implementation.

```
setopts EXTENDED_HISTORY
```

This will not only place a timestamp of execution but also the duration of execution — a very handy data point in investigations! Some Z shells, such as csh, though it doesn’t hurt to check!

Source: [http://zsh.sourceforge.net/Doc/Release/Options.html#Options](http://zsh.sourceforge.net/Doc/Release/Options.html#Options)

### Fish

Enabled by default! Though check your history file is located at:

```
~/.local/share/fish/fish_history
```

Have another shell you use and prefer? Or maybe an alternative implementation on a specific OS? Comment and we can add it in to this post for ease of future reference!
What do you know about 1C?
Tags: programming, beginners, opensource, 1c
Published: 2020-03-05 11:29:21

This article for those who are not yet familiar with 1C software products. It describes the capabilities of the 1C technological platform and where this platform fits in among similar software products.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y32wsgppjd4cv2tapp8y.png)

###**What does 1C produce?**

I think the first thing the general public associates with us is the popular game series IL-2 Sturmovik. However, the 1C product range extends far beyond this series.

There's a system of applications called 1C:Enterprise that includes business application development tools and applications created with them. The 1C development tools using to develop some accounting applications, as well as CRM, ERP (tens of thousands of user deployments), and much more.

ERP systems are the most exciting and functionally equipped business applications, so let's explore these to see how 1C:Enterprise technologies compare with competitors'.

###**Existing types of ERP**

What is the most valuable feature of any ERP system (and any business application)? Flexibility, that is, the capability to adapt to end-user business processes with minimal effort.

It is impossible to foresee all types of business processes when programming an ERP system. That's when parametrization is of great help; by enabling the parameters that may be changed by a user (advisor, or administrator) in the system options, we can easily increase its flexibility. The first ERP systems were parameter-driven, i.e. they were configured using parameters.

However, parametrized systems alone are insufficient to accommodate all business cases. When changing system parameters is not enough, you need to change the source code. That's when an ERP supplier needs to decide whether to change the code on its own and to release updates, taking into account the needs of the customer, or to supply the system with the source code for users to be able to rewrite the system as per their needs. The second option does not free the supplier from the need to release updates, as the system needs to develop and support new features in order to be competitive.

Another important question is the choice of a programming language for an ERP system. The major part of an ERP system is the business logic, for which regular programming languages (like C++) don't always fit well. Ideally, the business logic will be programmed in some high-level language to provide maximum comfort to the business application developer during the business logic development process. This allows the developer to move away from low-level details (peculiarities of working with databases, file input/output and print subsystems, tabbed UI subsystem, etc.). Of course, one would need to create a compiler/interpreter for the language and the development environment.

The full version of this article you can find [here](https://1c-dn.com/blog/what-do-you-know-about-1c/)
Decentralized microservice execution economy now enabled on the MESG Engine 
Tags: microservices, blockchain, opensource
Published: 2020-03-05 11:02:41

The MESG framework recently received a huge upgrade that has significant implications for the future of software development. 

Now creators of services, in addition to actors in the network, like block producers, executors, emitters or validators, can receive token payments for their work. 

This means that developers can now delegate decentralized processing power to others on the network to run their open-source services and processes so they don't have to deal with paying for servers. 

Also, service developers can charge a token micropayment for each execution on their services when they are reused by others on the network. All services and processes on the MESG Framework are highly resuable and interopeable, so it opens the opportunity for OSS devs to earn royalties.

There is also no middle men, restrictions or centralized authorities, including the MESG Foundation itself, so payments go directly from those outsourcing work, to the workers themselves. 

I see a bright future for projects like MESG which encourage open-source development and efficiency while providing the opportunity for fair compensation for open-source developers. 

See MESG CEO Anthony Estebe talk about the new execution economy in the decentralized MESG Engine here:  https://blog.mesg.com/community-update-late-february-20/
THE COOLEST THING ABOUT THE REDUX STORE IN REACT
Tags: redux, react, javascript
Published: 2020-03-05 10:58:51

Yeah, React is cool and Redux is cool too but you know what is the coolest thing about these two when they interact? `CombineReducers`!!!.
`CombineReducers` makes it possible to refer to the properties of the store state by the names of the individual reducers that were combined; that way, you are never in doubt about what property you want to access, you just need to name your reducers accordingly. Pretty Cool!!, ain't it?

Let us start by creating the several reducers we intend to have, this is determined by the distinct properties we expect our `state` to possess. For instance, if you want your state which is stored in your redux store to have a `books` property, which when called will produce a list of books, you create a reducer called **books**.

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

There's something fishy about the code above though; Have you figured it out? Yes, you are right!!! Random numbers!!! Id's are meant to be unique, random numbers could end up being the same and hence, generate an error. Do take note!

Back to discussing our state, if we want our state to have another property called `filter`, that returns a boolean value, we create a reducer called `filter` which returns a boolean.

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

It is worthy of note that in this article, I have not added `action types` to the individual reducers but I have gone ahead to return state as default; that is because you are free to add whatever action types are required by your app, it is not the focus of this article.
All these reducers can be in their `.js` files and stored in the reducers folder. The most important thing is creating the `rootReducer` which will be connected to the store and combining the above-mentioned reducers in it. How do we do this? We import `combineReducers` from `redux` and apply its magic.

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

Having combined the reducers in our rootReducer, we can now create our store and link it to the rootReducer.

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

As the name implies, the Provider makes the store available to any children or grandchildren nested inside it. I would tell us how we can access this store in a later article, as a result, you can ignore lines 11 through 16 of the code above.

Well, as simple as that, everything is set and if we run a console.log of `store.getState().books`, we would get the **list of books** and if we run  `store.getState().filter`, we would get the boolean value of **true**.
Introduction to useState
Tags: javascript, react, todayilearned, beginners
Published: 2020-03-05 10:22:53

I've been working with React Hooks for some time now and I thought about writing a quick and simple post on how to use `useState`.

---

## Let us get started

First of all, we need to import `useState` from `react`

```jsx
import React, { useState } from 'react'
```

Take into account the following function:

```jsx
import React, { useState } from 'react'

function Steps() {
  return (
    <div>
      Today I've walked 0 steps.
    </div>
  )
}
```

Alright, we want to control the amount of steps we've walked today, for that we can use the `useState` method, let us take a look:

```jsx
import React, { useState } from 'react'
```

Take into account the following function:

```jsx
import React, { useState } from 'react'

function Steps() {
  const [steps] = useState(0)

  return (
    <div>
      Today I've walked {steps} steps.
    </div>
  )
}
```

What are we doing here?

- Creating a new state called `steps` and its default value is `0`
- We're printing our `steps` value in our function

---

## Control

Now we want to control the value of `steps`, with `useState` you can destructure another prop, so, currently we have `const [steps]`, we will get another method from there, let us change that to `const [steps, setSteps]`.


Now we've introduced `setSteps`, with this we can control the value of `steps`, let us create a button to handle an `onClick` function to set the steps to `10`, try it out

```jsx
import React, { useState } from 'react'

function Steps() {
  const [steps, setSteps] = useState(0)
  const increaseSteps = () => setSteps(10)

  return (
    <div>
      Today I've walked {steps} steps.

      <button onClick={() => increaseSteps()}>
        Increase steps
      </button>
    </div>
  )
}
```

When you click on our new `button` the steps should increase to `10`, great.

---

## We can do better

We might want to increase the steps by `1`, not `10`. You might be thinking it's as simple as changing `10` with `1`, give it a try, I'll wait.

![](https://media.giphy.com/media/QBd2kLB5qDmysEXre9/giphy.gif)

It only goes to `1` right? 🤷‍♂️

Nothing to worry, we'll fix it right now, change the `increaseSteps()` function:

```js
const increaseSteps = () => setSteps(steps + 1)
```

What are we doing? We're getting the value of `steps` and increasing it by one.

You can also create another button to decrease the value, similar function but using `-1`:

```js
const decreaseSteps = () => setSteps(steps - 1)
```

---

## Result

I've spiced things a little bit with styling and an emoji 🙂

![](https://img.onl/ivDHCX)

You can check the final code in this [Codesandbox](https://codesandbox.io/s/thirsty-chatelet-76cyl)

---

If you liked this post consider following me on [Twitter](https://twitter.com/telmo), appreciate it 🙂
Add Element to Beginning/First, End/Last of Array JavaScript
Tags: javascript
Published: 2020-03-05 09:55:38


#JavaScript add Element first and last of array

1. JavaScript Add Element to Array First

 array.unshift(element1, element2, ..., elementX)

2. JavaScript Add Element to Array Last

 array.push( element1, element2, ..., elementX )

With example https://www.tutsmake.com/javascript-add-element-to-array-first-and-last/
Learning Jam: Hands-on with SCSS
Tags: scss, css, webdevelopers, meetups
Published: 2020-03-05 09:47:00

---
title: Learning Jam: Hands-on with SCSS
published: true
description: Learning Jam: Hands-on with SCSS meetups and code labs by Proagte and JSLovers
tags: SCSS , CSS,  web developers, meetups
---

Last week, I gave a [workshop](https://www.meetup.com/jslovers-bengaluru/events/268851360/) on SASS at WeWork, Bangalore. This was the learning Jam organized by the [Progate](https://progate.com) in collaboration with [JSLovers](http://jslovers.com) for beginners in SASS.

This was a hands-on workshop where the focus was on creating real-world examples and mapping them with the SASS features as solutions.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mvokvo11st1ya3bpetwy.jpg)

Apart from the SASS features I also discuss:

- Best Practises of CSS and SASS
- ParcelJS
- CSS and SASS Architecture
- When not to use SASS
- BEM

Github link for the slides and code: https://github.com/Neha/SASS-workshop

I enjoyed doing hands-on code-lab for the focused developers who wanted to know about all the fuss on SASS. I also explained that though CSS3 and new features are here yet there are places where we should go with SASS. SASS eases development efforts, maintenance, and scalability.

Thanks to [Yashraj](https://twitter.com/yashrajnayak), India community Manager -Progate for organizing the Learning Jam.  110 devs RSVPd on the event page. The process to get the invitation to Learning Jam was to only finish the web fundamentals module. 25 folks finished it and were in the Learning Jam. 

As Yashraj summarized precisely - "Learning never stops. What made these 25 devs stand apart from the rest of the devs who RSVPd is they went ahead and finished the web fundamentals module to get the invite and learn more."

Feedbacks <3

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3nqp25so25ch61vyu18l.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4qa002l299sobsd14dhw.png)


Happy Learning!!
Amadeus GDS
Tags: gdssystems, amadeus
Published: 2020-03-05 09:39:50

Amadeus GDS is one of the most preferred GDS systems today. Global travel management companies are either using Amadeus gds to access online travel contents including airline, hotels, transfers, sightseeing, cars and other value added services. Amadeus GDS processes the highest number of transactions on a day to day basis. In the last 18 years, Amadeus GDS has become the largest gds system and the biggest travel content aggregator around the world.