teleren/devto huggingface dataset:
100 Bytes Of Wisdom: Day 10
Tags: career, journey, advice
Published: 2021-02-23 21:52:06

---
title: 100 Bytes Of Wisdom: Day 10
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6zv2slfmmazv0532r6v.png
---


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

Keeping methods short by doing one thing means that you're able to write more maintainable, composable and readable code. This relieves stress in yourself and others and will lead to a happier, healthier life. There are a lot more resources for clean code out there - have a google some time. "Clean Code" and "Code Complete" are some of my favourites.

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/
Love Erlang if you love Elixir
Tags: erlang, elixir, programming
Published: 2021-02-23 21:42:48

Today I was reading messages on the [Erlang Ecosystem Foundation](https://erlef.org/) (are you already a member? It's free!) Slack and a member wrote something like:

> Erlang is at a much greater risk of not receiving new developers. And when the Erlang community dies, Elixir will die soon after.


The [entry about Erlang in Wikipedia] (https://en.wikipedia.org/wiki/Erlang_(programming_language)) is a quite good introduction to why it is worth it to study this programming language created in 1986. According to Wikipedia, its runtime system, the BEAM, "is designed for systems with these traits:

- Distributed
- Fault-tolerant
- Soft real-time
- Highly available, non-stop applications
- Hot swapping, where code can be changed without stopping a system."

On the [language page] (https://www.erlang.org/) you will find how to install Erlang. But if you already have Elixir installed, then you already have Erlang installed.

To open an Erlang *shell*, just type, in your operating system terminal:
`- erl`

You should see something like this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p754gnf0qh6bse1iqg6s.jpeg)


One important thing is that, unlike Elixir, you have to type a DOT (.) at the end of each command.

In addition, variable names must start with a capital letter. And you cannot assign a new value to a variable.

For example, suppose I want to create an Age variable and assign it an integer value 18.

I must, in erl, type:

`Age = 18.`

To see the value of the Age variable I type:

`Age.`

If I try to assign a new value to the Age variable, typing:

`Age = 19.`


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ad8t6ram6d03elflx1ad.jpeg)


the following error happens: "** exception error: no match of right hand side value 19"

Join the Erlang Slack channel or other [community communication channels](https://www.erlang.org/community) for more immediate feedback.

Did you find it interesting? Do you want me to continue writing about Erlang? Like, share or comment below.

Bonus: listen to [this episode of the Mostly Erlang podcast](https://anchor.fm/adolfo-neto/embed/episodes/Mostly-Erlang-019-Elixir-With-Jos-Valim-elo8h6/a-a3mjeit) with the creator of Elixir and two of the creators of Erlang.
AMA about accessibility, load speed, Google Lighthouse, Page Speed Insights or Web Vitals
Tags: ama, a11y, performance
Published: 2021-02-23 20:58:13

Hi everyone

I am still quite new to the community and looking to get some inspiration for posts while hopefully helping some people along the way with their burning questions (and make some new friends along the way as well 😊)!

So I thought I would do a "Ask Me Anything" post on subjects I know well and turn some of the answers into full posts. 

## So what can I help with?
Well there are two main areas I can help:

### Accessibility
I know a lot about accessibility (shortened to a11y....which ironically is not very accessible!), helping to make sure your website is usable by people with disabilities and compliant with the law. Not so much on Apps from a technical perspective but can still offer general guidance on WCAG etc. there.

So if you have technical questions about WAI-ARIA attributes, semantics, colour contrast, WCAG 2.1 (or WCAG 2.2 coming in June and the new criteria there, or the complete rewrite and rethinking of WCAG 3.0 (silver) coming in a couple of years!) etc. etc. fire away!

The other thing I am good at is helping people put the business case for accessibility to their managers / clients. So if you want help explaining the legal implications of not being accessible (UK and USA for specific advice, but I can offer general advice) with a big "I am not a lawyer" disclaimer then I can help there. 

Or if you want to know the market sizes, spending power etc. etc. I can rattle that off too!

This is my passion so feel free to ask some real tough ones, I will do my best to answer them!

### Performance (including Lighthouse, Page Speed Insights and Web Vitals)
Specifically website load speed. 

So if you are looking for how best to optimise an algorithm I am probably not your man, but if you want to know about page load speed I can certainly help there.

With the massive Google update coming in a few months to switch the focus onto web vitals you may also want to ask me about specific problems you are having there so you don't suffer a SEO nightmare!

Critical CSS, optimising images, avoid layout shifts etc.

## I look forward to (trying) to help!
I hope this gets well received, honestly ask me anything you want but only expect good answers around accessibility and load performance 🤣🤣🤣

Cheers

Graham
New Laptop
Tags: linux
Published: 2021-02-23 20:42:06

I convinced my employer to buy me a new souped up laptop. It finally arrived last week and I've been setting it up. I went from an Intel Core i5 2.3GHz 2 core processor to a Core i7 1.8GHz 4 core processor, from 16GiB of memory to 32, and 64/64/522 KiB of CPU cache to 256/1024/8192 KiB. I really needed the memory, and the extra CPU is nice. I was not, however, expecting such a jump in the CPU caches. Holy cow. But I'll take it.

I was running RHEL 7 before, because we run CentOS at work and it was convenient, but I wanted to break out a little so I went with Fedora Workstation. Last time I ran Fedora was... 2006 or so? I didn't like it, and I ended up running Gentoo instead. But Fedora has come a long way and is really slick now. The biggest plus for me will be the greater availability of packages in the repos. I didn't mind RHEL at first because I don't need much beyond vim and the common utilities that come with any desktop Linux distro. But I'll admit that it's nice to have some of those things that make life easier at the ready with a 'dnf install', including some tools that I was manually building on my own, or downloading binaries for.

Here's my setup routine:

1. Install OS
2. Run 'dnf update', first thing
3. Enable extra repos:
```
dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
```
4. Install from dnf stuff that's in the repos
```
dnf groupupdate core multimedia sound-and-video
dnf install gnome-tweak-tool gnome-extensions-app gnome-tweaks
dnf install https://github.com/TheAssassin/AppImageLauncher/releases/download/v2.2.0/appimagelauncher-2.2.0-travis995.0f91801.x86_64.rpm
dnf install tlp tlp-rdw # Never heard of this before last week!
dnf install tree htop parallel whois ascii tmpwatch help2man pcre-tools fping dos2unix fuse-sshfs xsel socat nmap nmap-ncat ncrack rpmdevtools sysstat strace fatrace ltrace # Some essentials
dnf install podman buildah skopeo podman-compose podman-docker # Container stuff
dnf install vlc vlc-extras gramps gparted lastpass-cli lynis openldap-clients
dnf install mosh tmux tmux-powerline starship mediainfo ffmpeg rdfind fdupes
dnf install pass pass-otp oathtool jq task rclone rclone-browser jc tidy direnv subversion remmina # Stuff I'd have gotten elsewhere before
```
5. Install from flatpak what's there
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub chat.rocket.RocketChat org.signal.Signal com.discordapp.Discord com.notepadqq.Notepadqq
```
6. Manually install some other stuff: Zettlr, Bitwarden, powershell, cht.sh, hostess, httpie, legit
7. Customize Gnome theme, settings, behaviors, etc
8. Wrestle with openvpn because NetworkManager *still* doesn't properly do what I need it to do
9. Copy over a bunch of files from the old laptop
10. Get back to work!

With respect to Python development, I've used pipenv for a long time for installing pypi packages. I might give poetry a try, though, to at least be familiar with it.
Crypto News Cryptogemtokens.com 
Tags: crypto, bitcoin
Published: 2022-02-23 21:47:41

---
title: Crypto News Cryptogemtokens.com 
published: true
date: 2021-02-23 20:07:22 UTC
tags: Crypto ,bitcoin
canonical_url: https://cryptogemtokens.com/?1
---

CryptoGem provides cryptocurrency news, information, and trading platforms. CryptoGem is a cryptocurrency news, information, and trading platform. We provide expert analysis, data from the exchanges, and live reports from events. This started in 2018 with Crypto Gem, a YouTube channel that focuses on cryptocurrency. It is one of few channels that offers reliable, impartial information. Crypto Gem started as a single-person show. However, as the channel grew, I and my team realized that there was more to it than making videos.
Our focus has expanded to include cryptocurrency news, exchange rates, and expert opinion about top crypto coins such as Bitcoin, Ethereum, and XRP. CryptoGem is now a platform that covers events so you are always up-to-date with all the happenings in this exciting new world.
Environment Scoped Secrets for GitHub Action Workflows
Tags: github, devops
Published: 2021-02-23 20:07:06

Secrets are encrypted environment variables that you create in an organization, repository, or environment. These secrets are also available to use in GitHub Actions workflows. 

GitHub uses the open-source libsodium encryption library to ensure that secrets are encrypted before reaching GitHub and remaining encrypted until you use them in a workflow.

{% github https://github.com/jedisct1/libsodium no-readme %}

## Organization-level Secrets
For secrets stored at the organization-level, you can use access policies to control which repositories can use organization secrets. Organization-level secrets let you share secrets between multiple repositories, which reduces the need for creating duplicating secrets. Updating an organization secret in one location also ensures that the change takes effect in all repository workflows that use that secret.

![select org level repo secrets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05q8ra2y7f0r97nn7504.png)

## Repository Environment Secrets
For secrets stored at the environment level, you can enable required reviewers to control access to the secrets. A workflow job cannot access environment secrets until the required approvers approve.

![environment based secrets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ws5yce0a2n4euum7zfoe.png)

In my examples, I have a **DATABASE_URL** secret specifically for my staging environment. 

If you want to see, this live in an action. Check out this GitHub Universe talk from Chris Patterson (GitHub Action PM).

{% youtube 36hY0-O4STg %}

_This is part of my 28 days of Actions series. To get notified of more GitHub Action tips, follow the GitHub organization right here on Dev. Learn how to build action with Node.js_

{% link https://dev.to/github/bring-your-own-environment-for-github-action-workflows-4b1o %}
TIL: Add your git repo to a tarball
Tags: todayilearned, programming, git
Published: 2021-02-23 20:04:41

Today I learned that you can neatly pack all of the files in your git repository into a tarball:

```sh
git archive --format=tar -o my_repo.tar -v HEAD
```

The best thing about this is it will automatically honour your `.gitignore` file, so won't include any files you don't care about.

## Other formats

It also works with zip files:

```sh
git archive --format=zip -o my_repo.zip -v HEAD
```

## Excluding files

In order to exclude files from the archive, you can specify them in a [`.gitattributes`](https://git-scm.com/docs/gitattributes) file. Here's an example that excludes the `README.md` file from the export:

```sh
README.md export-ignore
```

## Including the git repo itself

It doesn't include the git repository itself (the `.git` directory). If you'd like to include it, you can run:

```sh
git archive --format=tar -o my_repo.tar -v HEAD
tar -rf my_repo.tar .git
```

## Sources

- https://stackoverflow.com/a/3069593/1688034
- https://stackoverflow.com/a/11621730/1688034
Introducing Bricks, a new WordPress starter theme
Tags: wordpress, bootstrap, news, showdev
Published: 2021-02-23 19:59:55

A few years ago I rebooted my life ad started a new career as a web developer, mainly focusing on WordPress websites built with custom themes <small>_(Since then I aimed to acquire more solid Front-End skills, and during last year I took advatage of COVID-19 lockdowns to study many Jamstack techs, namely Vue, Nuxt, Tailwind, Netlify, and related stuff)._</small>

I tried many existing starter themes, from the most famous to the less-known projects, but for one reason or another I always felt that they missed something, and I decided to build one myself, keeping in mind some requirements:
- it had to be a fast and easy way to start a new project based on Bootstrap, by integrating it in the templates and providing the means to customize its theme variables;
- it had to include all basic WordPress features required in every project, without having to code them everytime;
- it had to have a modular nature, leveraging `get_template_part()` whenever possible, to have a component-like structure;
- it had to take into account SEO and performance, thus being lightweight and optimized in these respects;
- it had to automate some common tasks, like compiling CSS and JS, providing support for custom fonts, localizations, etc;
- it had to provide support for some optional Javascript libraries useful for the Front-End;

So, [Bricks](https://github.com/stefanobartoletti/bricks) was born. I started working on it in the beginning of 2019, and now, two years later and after having extensively tested and tweaked it, I decided to release it as an open-source project, that you can access from its GitHub repository:

{% github stefanobartoletti/bricks no-readme %}

---

A short list of some of **Bricks**' interesting features:
- [Bootstrap 4](https://getbootstrap.com/) (support for custom theme compiled from source Sass files, and JavaScript from [Bootstrap Native](https://github.com/thednp/bootstrap.native/)).
- [WP Bootstrap Navwalker](https://github.com/wp-bootstrap/wp-bootstrap-navwalker).
- [Font Awesome 5](https://fontawesome.com/) (_SVG with JavaScript_ version, parsed and minified by [gulp-fa-minify](https://github.com/FA-Minify/gulp-fa-minify)).
- [Autoprefixer](https://autoprefixer.github.io/).
- [PurgeCSS](https://purgecss.com/).
- [Rollup](https://www.rollupjs.org/) and [Babel](https://babeljs.io/).
- [BrowserSync](https://www.browsersync.io/).
- Automatic conversion of custom fonts into *woff2* web formats.
- Support for localization, with a task that creates a _.pot_ [template file](https://developer.wordpress.org/themes/functionality/internationalization/).
- Support for integration of some optional JavaScript libraries such as ([aos](https://michalsnik.github.io/aos/), [lightgallery.js] and [swiper](https://swiperjs.com/)).

---

Feel free to try it and test it! Contributions and suggestions are welcome!
First step of statistical analysis
Tags: datascience, machinelearning, python
Published: 2021-02-23 19:40:14

__First step of statistical analysis__

Before performing the first step of statistical analysis, the first step is to determine whether the data you are dealing with is population or sample data.

__Population__ includes all the elements from a dataset. It is an entire group that you want to draw conclusions about. It is __denoted by N__.

__Sample__ is a subset of the population. It is __denoted by n__.

To summarize, __sample is the group of individuals who participate in your study__, and __population__ is a broader group of people to whom your results will apply. In research population does not refer to people. 

Example: Let's take an example of average weight of human beings. Let's say we have an estimated amount of 8 billion human beings in the world. Finding the average is very simple, so as to add all the weights of the people and divide it by the count, but __how to get the weight of 8 billion people ?__

For the above problem, probability is used and the concept of Population and Sample will help. 

In our case, it is the weight of all people in the world is the population. The sample here is picked up randomly like 10 from India, 10 from the USA, 10 from Europe etc.. in equal proportion. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7qy63l8bxzepj2m1n3uu.png)

We can pick any number of elements from the population to the sample, in fact choosing more number of elements make the results more relevant and approximately same to the population and this makes a model __statistically significant__

The most important thing to consider here is, while taking samples from different countries, we have to take samples in __equal proportions__. The process of splitting samples are called sampling.

__Types of sampling techniques__

__1. Simple Random Sampling__
__2. Stratified Sampling__

__Simple Random Sampling__ (BIASED SAMPLE)

In this method, every data is picked in a random manner and every data has equal chances of getting selected. Selection of one data point will not affect the selection of any other point in the population.

__Stratified Sampling__ (UNBIASED SAMPLE)

In this method, we may have different groups, for example different countries. In our above example, we have weight of human beings in different countries, we have to select in such a way that we select 10 from India, 10 from the USA, 10 from Europe etc... i.e exactly in equal proportions.

To summarize, if there are no sub-groups in a population, it is good to go for Simple random sampling. If there are sub-groups, it is good to go for Stratified sampling. __Using Stratified sampling leads to more accurate output__.
Enviando e-mails en ambientes de desarrollo
Tags: tip, development
Published: 2021-02-23 19:39:13

---
title: 'Enviando e-mails en ambientes de desarrollo'
published: true
tags: ["tip", "development"]
canonical_url: https://marceloandrader.github.io/blog/2021/02/23/enviando-e-mails-en-ambientes-de-desarrollo/
---

Cuando se ejecuta un proyecto localmente, muchas veces se requiere poder enviar e-mails
a los usuarios de prueba, en un ambiente de desarrollo **NO es recomendable** enviar e-mails reales ya que
si no se es cuidadoso podemos llegar a usar datos de producción y enviar e-mails de prueba a usuarios reales
causando confusión.

Existen algunas herramientas que permiten configurar la forma de enviar e-mails, [mailtrap](https://mailtrap.io/)
es una opción SAAS, es gratuito para uso personal, pero si tu equipo crece tiene un costo mensual.

Una opción que me gusta es usar [MailHog](https://github.com/mailhog/MailHog) es solo un ejecutable
que no tiene dependencias, está escrito en go, y permite configurar tu proyecto para que envíe
como SMTP y en un browser tienes el despliegue de los e-mails que el proyecto envíe.

La configuración de cada proyecto depende de su estructura, este es un ejemplo en laravel 8, en el archivo `.env`

```bash
MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=noreply@example.com
MAIL_FROM_NAME="Proyecto"
```

Una vez que `mailhog` este ejecutandose, abre http://localhost:8025/ prueba enviando un email desde la aplicación
y se mostrará en esa url como se vería desde un cliente de correo.

Los e-mails enviados hacia mailhog son solo almacenados en memoria, así que si reinician mailhog, se perderán.


![MailHog Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/si2fx2mlxekhxlhsoz3s.png)
Diagrama de Classe na IDE Eclipse
Tags: java, tutorial, braziliandevs
Published: 2021-02-23 19:37:54

Olá pessoal, tudo bem?

Hoje irei mostrar como instalar uma ferramenta na **IDE Eclipse**, para visualizar o **diagrama de classe** do seu projeto.

Primeiro vamos até o site [ObjectAid](http://objectaid.com/).

![Página principal do ObjectAid](https://franciscochaves.com.br/assets/img/blog/2017/maio/objectaid.png)

Clique em "Download".

![Página principal do ObjectAid menu opção download](https://franciscochaves.com.br/assets/img/blog/2017/maio/objectaid-download.png)

Vamos utilizar o "Name" e "URL", para realizar a instalação no **Eclipse**.

![Página Download do ObjectAid](https://franciscochaves.com.br/assets/img/blog/2017/maio/dowload-objectaid.png)

Inicialize  sua **[IDE](https://pt.wikipedia.org/wiki/Ambiente_de_desenvolvimento_integrado)** Eclipse, selecione a guia _Help > Install New Software_.

![IDE Eclipse opção para instalar plugin](https://franciscochaves.com.br/assets/img/blog/2017/maio/instalar_plugin.png)

Clique em "Add…", insira o "Name" e "URL" nos campos que aparece, clique em "OK".

![IDE Eclipse informação para instalar plugin](https://franciscochaves.com.br/assets/img/blog/2017/maio/instalar_plugin_inserir_info.png)

Selecione "ObjectAid Class Diagram", e clique em "Next" após clique em "Finish" para finalizar a instalação da ferramenta.

![IDE Eclipse finalizando instalação do plugin](https://franciscochaves.com.br/assets/img/blog/2017/maio/finalizando_instalacao.png)

Vamos criar um projeto **Java**, para observar como a ferramenta funciona, dentro do projeto iremos criar três classe Java com relação de herança.

1 – Classe Animal

```java
public abstract class Animal {
  public abstract void falar();
}
```

2 – Classe Gato

```java
public class Gato extends Animal {
  @Override
  public void falar() {
    System.out.println("Miau, miau, miau ...");
  }
}
```

3 – Classe Cachorro

```java
public class Cachorro extends Animal{
  @Override
  public void falar() {
    System.out.println("Au, au, au ...");
  }
}
```

No projeto pressione as teclas Ctrl+N , e procure por "Object UML Diagram", selecione "Class Diagram" e clique em "Next", atribua um nome e clique em "Finish"

![IDE Eclipse arquivo para diagrama](https://franciscochaves.com.br/assets/img/blog/2017/maio/objectaid_selecionado.png)

No projeto selecione as classes e arraste para o arquivo criado, com isso o  seu diagrama de classe já será exibido.

![IDE Eclipse criando diagrama](https://franciscochaves.com.br/assets/img/blog/2017/maio/objectaid_selecionado_criado.png)

A ferramenta possui a opção de salvar o **diagrama** em imagem, clique com o botão direito do mouse e selecione "Save As Image.."

![IDE Eclipse salvando diagrama](https://franciscochaves.com.br/assets/img/blog/2017/maio/objectaid_salvando_diagrama_imagem.png)

Valeu pessoal e boa codificação :)