teleren/devto huggingface dataset:
Auto Add Git Commit Message
Tags: git, hooks, automation, vcs
Published: 2020-09-07 14:16:38

---
title: Auto Add Git Commit Message
published: true
date: 2020-04-29 00:00:00 UTC
tags: git, hooks, automation, vcs
canonical_url: https://tech.serhatteker.com/post/2020-04/auto-add-git-commit-message/
---

## Add to One Commit

If you want to append the actual date to your commits you can use below script:

```bash
$ git commit -m "modified <branch> files on `date`"
```

Your commit message will be like:

```
modified <branch> files on Tue Apr 29 17:23:02 +03 2020
```

You can modify the date _format_ as well as you like:

```bash
$ git commit -m "generated files on `date +'%Y-%m-%d %H:%M:%S'`"
```

which will give:

```
modified <branch> files on 2020-04-29 17:23:02
```

## Add to All Commits

If you want to append the actual date to all your commits of a specific repository it is better to use [Git Hooks]:

### Git Hooks

Git hooks are `scripts` that __Git__ executes __before__ or __after__ events like:
`commit`, `push`, `rebase` etc.

They are a built-in feature.

Git hooks run locally.

Every __Git__ repository has a `.git/hooks` repo and __.samples__ you can use:

```
.git/
├── COMMIT_EDITMSG
├── config
├── description
├── FETCH_HEAD
├── HEAD
├── hooks
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
│   ├── fsmonitor-watchman.sample
│   ├── post-update.sample
│   ├── pre-applypatch.sample
│   ├── pre-commit.sample
│   ├── prepare-commit-msg.sample
│   ├── pre-push.sample
│   ├── pre-rebase.sample
│   ├── pre-receive.sample
│   └── update.sample
```

### Using Hooks
The __hook__ we are going to use for our purpose is `prepare-commit-msg`.

1. Make a copy of the file:

    ```bash
    $ cp .git/hooks/prepare-commit-msg.sample ./git/hooks/prepare-commit-message
    ```

2. Delete the template content and add the script:

    ```bash
    #!/bin/bash
    #
    # Append current `date` to commit messages

    echo "`date +'%Y-%m-%d %H:%M:%S'`" >> $1
    ```

    where `$1` is the _commit message file_.

3. Make it executable:

    ```bash
    $ chmod +x prepare-commit-message
    ```

After every `git commit` run the __date__ is going to be added automatically:

```git
Update post "auto-add-git-commit-message"
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch <feature>
# Your branch is ahead of 'origin/<feature>' by 2 commits.
#   (use "git push" to publish your local commits)
#
# Changes to be committed:
#	new file:   content/post/2020-04/auto-add-git-commit-message.md
#
# Changes not staged for commit:
#	modified:   content/post/2020-04/auto-add-git-commit-message.md
#
2020-04-29 17:23:02
```

## Further
Adding _date_ to a commit would be unnecessary since __Git__ already logging date and you can see them with `git log`, however sometimes it would be useful.

After all of that you can use this post as an inspiration for your __workflow automation__.

All done!


<!-- References -->
[Git Hooks]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Signing in with Github
Published: 2020-07-12 12:37:04

...is a real PITA if you have a bunch of GitHub accounts, *one* of which you use here but you always forget which. This is not my normal Dev.to profile. If I sign out from here, and click "sign in with github" it doesn't get me to sign in again with username & password, it just signs me in. There needs to be a "log me out fully so I can actually log in using the right account this time" option. I have 4 GitHubs. I don't need this rigmarole every time.
Observables - Cold, Hot or Warm?
Tags: rxjs, observables, tutorial
Published: 2020-07-12 14:34:53

---
title: Observables - Cold, Hot or Warm?
published: true
description: 
tags: RxJS, Observables, tutorial
//cover_image: https://direct_url_to_image.jpg
---

The world of observables can be intimidating for beginners. At least it was for me. It certainly took me a while to grasp the difference between cold, hot and warm observables and I would like to share the simple example that lit the light bulb in my head.

Observables are cold by default. In a cold observable, the data producer is created when the observable has a new subscription. Hence in the example below, both subscribers have independent sets of values (1, 2, 3) emitted from the producer. Using the analogy of show streaming, a new subscriber would have to watch the show from the start irregardless if the show was live.

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

However if we want to emulate the live streaming behaviour of a show, we need to use a hot observable instead. This can be achieved using `publish()` and `connect()`. As seen in the example below, only the value `2` is logged for the second subscriber since the subscription is initialised only after approximately 2 seconds.

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

Finally, as mentioned in this [article](https://medium.com/@benlesh/hot-vs-cold-observables-f8094ed53339), there is a third form of observables known as warm observables. The key difference between a hot and warm observable is that in a warm observable, the data producer only starts emitting values when the first subscription is initialised on the observable. Going back to the live streaming analogy, it means the show only starts when the first subscriber arrives. The `publish()` and `refCount()` operators can be used to create a warm observable. As illustrated below, the value `0` is logged for the first subscriber even though it is initialised after 1 second.

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

Hope these would be useful for anyone getting their feet wet with observables in RxJS!

<u>Readings</u>
[https://softchris.github.io/books/rxjs/hot-n-cold-observables/](https://softchris.github.io/books/rxjs/hot-n-cold-observables/)
Building a Code Editor for the Web - HTML & CSS Structure
Tags: webdev, html, css, javascript
Published: 2020-07-13 01:50:24

In this video, we'll work on the basic overall structure with the HTML and CSS. We'll also load the ACE Code Editor without any configuration.

Find the code for each video here in its own branch: 
https://github.com/luvuong-le/code-editor-tutorial/tree/html-css-structure

Check out the previous part to this video [here!](https://dev.to/coderarchive/building-a-code-editor-for-the-web-project-setup-1m43)

If you'd like to see more of my videos, [head over to Youtube!](https://www.youtube.com/channel/UCWaB4SBBUCvhYb91fz5Vidg) A follow/sub comes a long way to show support

Follow and connect with me on:
----------------------------------
🐦 Twitter: https://twitter.com/coderarchive
📚 Github: https://github.com/luvuong-le
💼 LinkedIn: https://www.linkedin.com/in/lu-vuongle/
📷 Instagram: https://www.instagram.com/coderarchive/
📝 Dev.to: https://dev.to/coderarchive

#coderarchive #webdev #html #css #js
Top 3 Laravel Marketplace Packages
Tags: laravel, marketplace, laraship
Published: 2020-07-12 14:52:29

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

## Introduction:

Marketplace platforms are currently being the trend for new ideas, with COVID-19, many stores are moving their business online due to the lockdowns, and with the marketplace, you remove the burden from site owners to spend a lot of time and cost to build their platform. also gives buyers a variety of products and prices under one hub.

Laravel has been the top-notch PHP platform for 2020 and expected to still the same at least for the next 2~3 years. And it’s a great choice for building a marketplace platform due to the big community which helps in providing off the shelf startup kits and platforms to start with.

In this article we will demonstrate some of off the shelf Multi-Vendor eCommerce platforms that can be a great start for your Marketplace project:

## 1) [Laraship Marketplace](https://www.laraship.com/product/laraship-laravel-marketplace/)

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

Laraship has been in the market since 2015 and is rated as the best Laravel marketplace platform. There are currently hundreds of sites using Laraship Marketplace to handle their vendors. Laraship provides their clients access to the full source code with no encryption and they have the right to modify it according to their business requirements.

Laraship integrates with 10 payment gateways in addition to offline payments.
In addition to that, Laraship has more than 40 modules and themes to expand features like Laraship Directory, Classified, Subscriptions.


## 2) [MadeWithLaravel](https://madewithlaravel.com/marketplace)

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

The marketplace is a fluent system that provides various functionality for the developers to build their e-commerce system rapidly, it ships with Category, Coupon, Sales, Cart and Wishlist system and even more for its first version


## 3) [Webkul](https://store.webkul.com/laravel-multi-vendor-marketplace.html)

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

Laravel Multi-Vendor Marketplace: The Multi-Vendor Extension transforms your Bagisto store into a thriving multi-vendor marketplace. It allows vendors to create, update, track, and manage their products and orders through their dedicated dashboard. The Admin can easily set a global/separate seller commission for all the sellers.

## Conclusion:

Marketplace platforms are now easy to build and deploy, if you’re starting a new project then Laraship Marketplace is your way to go, it comes with one year of support and 4 themes available.
Não surte com o seu home office
Published: 2020-07-13 02:14:48

Quando comecei a fazer home office imaginei que a minha rotina iria ficar mais leve e fácil por conta da flexibilidade que esse formato permite, porém, logo me peguei tendo pequenos surtos e um ritmo bem mais frenético de atividades.

No meu caso o home office começou a se estender, então oque era para ser 15 dias virou 1 mês, 2 meses, 3 meses… e agora me perdi na contagem. Procurei algumas dicas de como enfrento essa jornada.

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

###**Reuniões e mais reuniões**
Agende ao menos 10 minutos de intervalo entre cada reunião, isso te dá tempo para esticar as pernas, pegar um café, comer uma bolachinha (ou biscoito...ou os dois).
É muito comum o número de reuniões aumentar nesse período, sabe aquela conversinha rápida no bebedouro? Então, hoje tem que transformar em uma ligação.

###**Falta de rotina**
As vezes estamos focados em um determinado assunto e esquecemos de fazer aquela pausa para respirar, comer, ir ao banheiro e com isso já foi metade do dia ou, já são 15h e você nem almoçou.
Tenha sempre por perto aquela garrafinha de água que ficava na sua mesa na empresa sabe? Porque além de você se hidratar, irá te ajudar na voz (porque estamos tagarelando mais nas reuniões) e vai te obrigar a ir ao banheiro.
Defina horários para se alimentar se for o caso (aquela maçãzinha no meio da manhã), o chocolate no final do dia. Não se culpe por isso.

###**Seja saudável**
Tente cozinhar sua própria refeição ou pedir algo saudável no ifood. Na noite anterior você pode planejar oque irá cozinhar e no dia seguinte logo que acordar já tira aquela carne para descongelar, pois, assim na hora do almoço, já está tudo no jeito e você irá se alimentar melhor. Cuide do seu corpo.

###**Nossa...a hora passou e eu nem vi.**
Várias vezes perdemos o horário para comer, parar de trabalhar e isso é normal porque não temos noção claramente se estamos trabalhando ou não. Por exemplo, meu apartamento é pequeno então o local onde trabalho fica a minha sala e cozinha, ou seja, os ambientes da casa se misturam com o ambiente de trabalho e dificilmente estava conseguindo me desligar na hora do almoço tentando assistir alguma série.
Defina melhor um cantinho para você trabalhar.

Bom, espero que com essas dicas ajudem você a ter um home office mais saudável e sem nenhum surto ;)
Poker
Tags: beginners, python
Published: 2020-07-13 04:53:41

So after playing poker during all of quarantine, I have decided to create my own poker table using Python. 

<pre>
from poker import *
import eval7
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from IPython.core.display import display, HTML
import random`)
</pre>

These are all of the imports I have used.

<pre>
deck = list(Card)
random.shuffle(deck)
</pre>

This creates the deck and shuffles it.

<pre>
players = input("How many people are playing: ")
</pre>

This creates the number of players playing.

<pre>
flop = [deck.pop() for __ in range(3)]
turn = deck.pop()
river = deck.pop()
</pre>

This sets the table for the flop.

My next steps are to create hands for each of the players to evaluate and to create stack sizes for buy ins.
What's new in Undercut 0.6.0
Tags: javascript, webdev, news, undercutjs
Published: 2020-07-22 08:18:25

---
title: What's new in Undercut 0.6.0
published: true
description: 
tags: javascript, webdev, news, undercutjs 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/sdn9cro37p7ie7xf97mk.jpg
---

✂ We continue to add handy utilities into Undercut with release `0.6.0` while polishing its API. But this time there are also many internal changes making maintenance easier and users happier.

#### Code coverage

Code coverage is back where it should be above `80%` mark, so using Undercut shouldn't be so scary anymore :) In fact, coverage was good from the beginning, but our monorepo structure were interfering with Jest/Istanbul processing. As result, most operation tests weren't considered as hits. 

#### Website

Website have moved to [Netlify](https://www.netlify.com/). In past we were using GitHub Pages for hosting, but it isn't that convenient.

For example, one of the issues with GHP was the requirement to have full write access on CI as it needs to push files to the `gh-pages` branch on build. With Netlify you can continue using read-only keys. On top of that Netlify allows you to have a preview for Pull Requests and even separate deployments for non-main branches.

The setup was as easy as specifying `yarn build` command and a `path` to a directory to deploy.

#### Conventional Commits

Some time ago we started to adopt [Conventional Commits](https://conventionalcommits.org) and `0.6.0` release is the first one having its changelog generated from commit messages. Lerna supports Conventional Commits out of the box, which is nice.

### Release Highlights

* `getObjectType` for retrieving more detailed type name like `AsyncFunction` from Object's `toString` method.
* Classic helpers in a form of `head/tail` utilities for working with Iterables. Unfortunately, the `head` utility have replaced former `peekIterable`, so we have a `breaking change` here.
* A pack of utilities to quickly filter/map/collect object keys and values. You were able to do this with Pull already, but sometimes you only want a short single operation instead of the full power and ceremony of the pipelines.
* A set of randomized functions like `randomDecimal` or `randomIndex` utilities.
* Somehow missing `isPromise` utility.

Lots of other code and documentation improvements. Check out [the list commits from previous version](https://github.com/the-spyke/undercut/compare/v0.5.1...v0.6.0) or view our [full release notes](https://github.com/the-spyke/undercut/releases/tag/v0.6.0).

[![Undercut Demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/undercut-demo-1up46?fontsize=14&hidenavigation=1&moduleview=1&theme=dark&previewwindow=console)

Visit [GitHub](https://github.com/the-spyke/undercut) for code and [undercut.js.org](https://undercut.js.org/) for documentation.

Photo by [Florian Cario](https://unsplash.com/@floriancario?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText) on [Unsplash](https://unsplash.com/t/textures-patterns?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText).
Lista desplegable efecto acordeón con Bootstrap
Tags: spanish, bootstrap, css, beginners
Published: 2020-07-21 15:14:10

En esta ocasión he cambiado el diseño del acordeón por defecto, puedes verlo en la documentación oficial de Bootstrap [aquí](https://getbootstrap.com/docs/4.5/components/collapse/#accordion-example).

#### Componente original
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6lhf0p1cjiwr9nir5oka.png)

Este componente de Bootstrap utiliza a su vez el componente [card](https://getbootstrap.com/docs/4.5/components/card/). Con pocas líneas se ha conseguido un aspecto más llamativo. En este ejemplo he utilizado Pug y Sass.

#### Resultado final
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/akfz3uydaih8mcb4uc8z.gif)

#### Características
- Uso de clases nativas de bootstrap.
- Iconos de Fontawesome.
- Flechas indicadoras de posición abierto/cerrado.

---

📎 Puedes editar o descargar este snippet de Bootstrap en este enlace a [CodePen](https://codepen.io/badiali/full/XWbzJGq).

{% codepen https://codepen.io/badiali/pen/XWbzJGq default-tab=result %}
Publishing the Octopus Handbook
Tags: businessofsoftware, octopus
Published: 2020-08-05 03:44:37

---
title: Publishing the Octopus Handbook
published: true
date: 2020-07-22 01:50:51 UTC
tags: BusinessofSoftware,Octopus
canonical_url: https://paulstovell.com/octopus-handbook/
---

 ![Publishing the Octopus Handbook](https://paulstovell.com/content/images/2020/07/handbook.png)

We're a bit over 70 people at the moment, and plan to hire quite a bit more this year. To try to manage that growth a bit better, I spent the last couple of weeks working on a complete handbook for the company, and decided to make it public. Check it out here:

**[handbook.octopus.com](https://paulstovell.com/octopus-handbook/handbook.octopus.com)**

The handbook covers everything about working here, such as:

- Our vision and what makes us different
- What we look for in the first few months when you join
- How we think about remote work
- Trust, responsibility and communication
- Feedback cycles, career levels, and our compensation philosophy
- Internal programs, like our laptop policy
- How we're structured and who does what

**Why write the handbook?**

Since 2012 we always kept a Confluence wiki full of things people should know, but it wasn't particularly well structured, and as wiki's tend to do, it became a bit overgrown with weeds. I felt almost embarrased to point new people to it, and we couldn't share it with prospective hires. But I also didn't have a clear picture of what a better alternative would be.

**Why make it public?**

I knew I wanted to put a handbook together, but I spun my wheels a lot trying to figure out what it should include and where to stop. I then found [Basecamp's handbook](https://basecamp.com/handbook), GitLab's, and a few others, which really helped to think about structure and what to include/not include.

I really appreciate companies like Basecamp and GitLab for making their handbooks public, so it felt right to do the same, in hopes other companies will benefit from ours. Plus, it makes it easier to share with people who are interviewing with us to get a clearer idea of what it's like here.

**What is it written in?**

I started writing it in Confluence, but it wasn't a good experience and I [tweeted about it](https://twitter.com/paulstovell/status/1279094907575996417). Lots of people responded with suggestions, one of which was GitBook, which turned out to be a really great way to write a book like this.
The Ultimate Guide To Hydroponics Farming In India
Published: 2020-07-23 16:36:26

Are you worried about your outdoor food production because of the changing weather? Are you thinking to produce the food and crops indoors? If yes, then we have something really interesting and beneficial for you.
It is now possible to produce high-quality food in the interiors by using this simple technique called – Hydroponics. Though the technique is new and not much in use, it has all the caliber and benefits to be one popular option to consider.

If you are new with this technique and are looking for some hydroponic farming training in India, then you are at the right place. Let us quickly get through with this very amazing technique of indoor food production.

Read More:- https://pedfire.com/the-ultimate-guide-to-hydroponics-farming-in-india/
Como mover/instalar o WSL 2 do disco C:/ para outro disco
Tags: tech, linux, lxrunoffline, windows
Published: 2020-08-03 19:27:30

---
title: Como mover/instalar o WSL 2 do disco C:/ para outro disco
published: true
date: 2020-07-23 02:24:19 UTC
tags: Tech,linux,lxrunoffline,windows
canonical_url: https://marquesfernandes.com/como-mover-instalar-o-wsl-2-do-disco-c-para-outro-disco/
---

Recentemente fiz um artigo explicando [como instalar e configurar o WSL 2](https://marquesfernandes.com/como-desenvolver-com-docker-no-linux-dentro-do-windows-sem-dual-boot-wsl-2/) para ter um ambiente linux completo de desenvolvimento direto do Windows. Mas como nem tudo são flores, meu computador possui um SSD com pouco armazenamento, o que me limita em instalar muitos programas no disco `C:/` padrão. Em pouco tempo vi a instalação do WSL 2 começando a consumir espaço, com tantas imagens docker e projetos front com node\_modules, meu limite de armazenamento foi acabando. Como meu notebook tem também um HDD de 1TB, comecei a procurar uma maneira de instalar/mover o WSL 2 para outro disco.

## Instalar o LxRunOffline

[LxRunOffline](https://github.com/DDoSolitary/LxRunOffline) é um utilitário completo para gerenciar o Windows Subsystem for Linux (WSL). Esse programa que vai nos permitir mover nossa instalação do disco `C:/` para outro disco, no meu caso `D:/`.

A maneira mais fácil de instalar é usando o utilitário [choco](https://chocolatey.org/):

```
choco install lxrunoffline
```

## Listando as instalações WSL

Agora vamos listar todas as instalações WSL disponíveis, no meu caso estou em busca do Ubuntu 20.04:

```
lxrunoffline list
```

![WSL](https://marquesfernandes.com/wp-content/uploads/2020/07/image-39.png)

## Movendo a instalação do Ubuntu 20.04 WSL para outro disco

Primeiro desligue o WSL com o comando `wsl --shutdown`. Você precisa executar esse comando a partir de um Power Shell com privilégios de administrador.

Agora que encontramos a instalação que desejamos mover para outro disco, é bem simples, vamos passar um comando para mover a instalação do `Ubuntu 20.04` para o disco `D:/` dentro de pasta chamada `WSL`:

```
lxrunoffline move -n Ubuntu-18.04 -d D:\wsl\
```

Aguarde um pouco até o processo terminar, depois disso sua instalação já estará sendo executada a partir do novo disco.

O post [Como mover/instalar o WSL 2 do disco C:/ para outro disco](https://marquesfernandes.com/como-mover-instalar-o-wsl-2-do-disco-c-para-outro-disco/) apareceu primeiro em [Henrique Marques Fernandes](https://marquesfernandes.com).