teleren/devto huggingface dataset:
[Prize Discussion] Plato Talk #2

Tags: beginners, devops, discuss, privacy
Published: 2021-12-28 02:59:13

## PLATO TALK #2

### TOPIC：**Tell about your understanding of decentralization**

“What is decentralization, why is it important, what opportunities and challenges does decentralization face, and what are your expectations and recommendations for PlatON decentralization?” 

REWARD:  **4000 LAT**

Topic Deadline:  **2021/12/30 12:00 UTC**

**Online Events-Discord（plato-talk）: https://discord.gg/CGz3cSfn9J**

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




Event details：
https://letuscompute.hashnode.dev/discord-eventplato-talk-share-views-ideas-suggestions-based-on-the-talk-topic





----
**About PlatON：**

PlatON Website：https://platon.network/en

Alaya Website：https://www.alaya.network/en

PlatON Privacy-Preserving Computation WhitePaper: https://link.medium.com/hHaZHcz9Djb 

PlatON 2.0 WhitePaper：https://link.medium.com/KCbkhaG9Djb

PlatON 2.0 PPT：https://www.slideshare.net/ShiHeng1/privacypreserving-ai-network-platon-20-249734241


**Developer Program：**

Hackathon：https://github.com/AlayaNetwork/Alaya-Season-Hackathon 

Grants: https://latticex.foundation/grants

Dev-Bounty：https://github.com/LatticeX-Foundation/dev-bounties


**Contact：**
Twitter：https://twitter.com/PlatON_Network

Discord：https://discord.gg/jAjFzJ3Cff

Dev-Telegram：https://t.me/joinchat/LhO63AsZ_iozZGNl
Enable Buzzer in Klipper For Creality Boards 4.2.2 4.2.7
Tags: klipper, creality, ender3, m300
Published: 2021-12-28 02:44:59

---
title: Enable Buzzer in Klipper For Creality Boards 4.2.2 4.2.7
published: true
description: 
tags: Klipper, Creality, Ender3, M300
cover_image: https://res.cloudinary.com/djorborn/image/upload/v1640659426/beeper_fd3o4z.png
---
![creality_board_screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4yyo32n9e3d8ze0vc6pb.png)
I have an Ender 3 with a 4.2.7 Board running Klipper firmware and wanted to enable the Buzzer. After some looking around I found the [sample-macros.cfg](https://github.com/Klipper3d/klipper/blob/master/config/generic-creality-v4.2.7.cfg) and [PDF schematics for both 4.2.2 and 4.2.7](https://github.com/Jyers/Marlin/discussions/814). Using these two things I was able to make the M300 gcode command trigger the Buzzer in the LCD panel.

```sh
######################################################################
# Beeper
######################################################################
# M300 : Play tone. Beeper support, as commonly found on usual LCD
# displays (i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount
# 12864 Full Graphic). This defines a custom I/O pin and a custom
# GCODE macro.  Usage:
#   M300 [P<ms>] [S<Hz>]
#   P is the tone duration, S the tone frequency.
# The frequency won't be pitch perfect.
[output_pin BEEPER_pin]
pin: PC6
#   Beeper pin. This parameter must be provided.
#   ar37 is the default RAMPS/MKS pin.
pwm: True
#   A piezo beeper needs a PWM signal, a DC buzzer doesn't.
value: 0
#   Silent at power on, set to 1 if active low.
shutdown_value: 0
#   Disable at emergency shutdown (no PWM would be available anyway).
cycle_time: 0.001
#   Default PWM frequency : 0.001 = 1ms will give a tone of 1kHz
#   Although not pitch perfect.
[gcode_macro M300]
gcode:
    # Use a default 1kHz tone if S is omitted.
    {% set S = params.S|default(1000)|int %}
    # Use a 10ms duration is P is omitted.
    {% set P = params.P|default(100)|int %}
    SET_PIN PIN=BEEPER_pin VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
    G4 P{P}
    SET_PIN PIN=BEEPER_pin VALUE=0
```

To check that it is working, send `M300 S440 P200` to your printer and it should beep. You can learn more [here](https://marlinfw.org/docs/gcode/M300.html).


The only thing you need to change from the sample-macros.cfg section is the pin. Under `[output_pin BEEPER_pin]` you set `pin:PC6`. That is it. 
Seems simple but I couldn't find anything online about it so I thought I would share. Hope this helps someone or me in the future at least.
Ruby - Diferença entre %w e %W
Tags: ruby, braziliandevs, rails
Published: 2021-12-28 02:05:18

## Qual a diferença entre %w e %W em Ruby?

Quando em maiúsculas `%W`, o array é construído a partir de strings que são interpoladas, como aconteceria em uma string entre aspas duplas.

Quando em minúsculas `%w`, é construído a partir de strings que não são interpoladas, como aconteceria em uma string entre aspas simples.

Exemplo:

```Ruby
irb(main):001:0> foo = "bar"
=> "bar"

irb(main):002:0> %w(#{foo} bar baz)
=> ["\#{foo}", "bar", "baz"]

irb(main):002:0> %w("#{foo}" bar baz)
=> ["\"\#{foo}\"", "bar", "baz"]

#(Capital W)
irb(main):003:0> %W(#{foo} bar baz)
=> ["bar", "bar", "baz"]
```

**Contato:**
Email: contato@diegonovais.com.br
LinkedIn: https://www.linkedin.com/in/diegonovais/
Github: https://github.com/dnovais
Goals. Why do you want to code?
Tags: 100daysofcode, webdev
Published: 2021-12-28 01:59:24

Day#25
I ask myself what and why am I doing this.   I am doing fine in the Cybersecurity and InfoSec space...  why would I want to change things up and go down a new path.

I couple thoughts came up:

- **Possible side gigs...**  some extra funds doing something I enjoy.

- **Frontend WebDEV is creative** (in my mind)... I can build stuff!

- I can do this **work from anywhere**...  vs most of my work in Cyber and InfoSec must be done on-site.  These days working remote is more and more appealing to me.

- For a **better understanding (in the weeds)** of HTML, CSS, JavaScript and other "web" of things...  I have worked with raw HTML, SharePoint, WordPress and content management systems before... This is a deeper dive.

- Lastly...  **why not!?**   I hope... I don't want to stop.  I want to get into programming mobile apps.

All of these are what drives me.

**What drives you? ** What are your reasons?

**Initial career path?  A change**?
Differences between “==” and “===”
Published: 2021-12-28 01:30:35

> Differences between “==” and “===”
**==** and **===** Both are known as conditional equal operators. **== (double equal)** check the only value if the value is the same then return true else return false. On the other hand **=== (triple equal)** check both value and data type if the value and data type are the same then return true else return false. It also can use as conditional not equal like **!== .**

```
var num = 30;
var num2 = "30";
if(num == num2){
console.log("both are same.");
}
output: both are same.
```


```
var num = 30;
var num2 = "30";
if(num === num2){
console.log("both are same.");
}
else if(num !== num2){
console.log("both are not the same.");
}
output: both are not the same.
```
Data Persistence in MongoDB
Tags: mongodb, architecture, database
Published: 2021-12-28 01:23:45

We have talked about the data persistence in Redis in [my previous article](https://lazypro.medium.com/data-persistence-in-redis-2780c11d1623), and we had come out a conclusion.

> There is no way to ensure no data loss in the **single instance** Redis even the strictest setting is turned on. 

Because Redis is designed as a in-memory data storage handling the high-throughput user scenarios, aka a cache not a database. Hence, the persistence only needs to be usable not reliable.

On the other hand, MongoDB as a NoSQL database is designed to deal with high-volume data and can be scaled out as needed. How about the data persistence in MongoDB?

## WiredTiger

We are going to talk about MongoDB with the most popular storage engine, WiredTiger. First, I have to tell that MongoDB is able to persist data. However, if you don't use MongoDB correctly, data would still be lost.

The story starts from the [journaling](https://docs.mongodb.com/manual/core/journaling/). By default, MongoDB stores its data into the memory to improve the performance. After reaching the criteria, MongoDB flushes data to the disk. Until then, the data is finally persisted. The criteria is:
1. At every 100 milliseconds (can be adjusted by `storage.journal.commitIntervalMs`)
2. Every 100 MB of data

The journaling is like Redis AOF, it uses WAL to write data to the disk.

## Write Concern

If the behavior of MongoDB is storing data in the memory first, how should I make sure the data is durable? Fortunately, MongoDB provides the write concern to accomplish the data persistence. You can set the write concern to "{j: true}" to make MongoDB acknowledge clients **after** the data is stored on the disk. Or, you can use "{w: majority}", this implies "{j: true}" as well as replicates data to most slaves.

The connect string also supports the journaling, `journal=true`. This provides some convenience if you don’t want to assign the write concern every time.

## Conclusion

The data persistence plays a very important role in the system design. In fact, many NoSQL databases have some tricks in them. When you are using them, you should not only use them carefully but also understand the implementations behind them.

MongoDB provides the data persistence as long as the write concern is used properly. In my opinion, "{w: majority}" is the best choice when you are considering the write concern. Because, we usually would like our data can be persisted in addition to persist to replicas.
Live Virtual Career Prep Events to Help You Get Your First Dev Job
Tags: career, beginners, android, tutorial
Published: 2021-12-28 01:13:55

Over on the Qvault community Discord server we're starting a new initiative; we're doing *free live events* focused on getting you your first dev job!

For background, I've been running [Qvault.io](https://qvault.io) for over a year now, and while people are loving the courses, we've started offering more personalized help surrounding "first job" challenges, and our attendees are loving it.

## I'm hosting these free educational events on a weekly basis now, and I'd love to see you at them!

Tomorrow (Dec 28th), we'll be talking about how to write cleaner code through variable naming techniques. We've already done two resume workshops where you bring your resume and I help you improve it. I plan to do more events of both kinds in the coming weeks.

Anyhow, like I mentioned, these events are totally free, so take advantage of this resource!

A bit about me - I'm the head of engineering at a Bay Area startup, and have a passion for helping new devs find their first opportunities!

Link to the event: https://discord.gg/bkxvQ4Ct?event=923213296948113409
Use Pipe Operations in Python for More Readable and Faster Coding.
Tags: programming, python, tutorial, productivity
Published: 2021-12-28 00:19:21

Python is already an elegant language to code. But it doesn't mean there's no room for improvement. 

A great way to improve readability and coding speed is to use pipe operators in Python programs. They help chain several operations one after the other using shell-styled pipe operators. 

This post discusses how to use pipes to perform everyday data manipulation tasks. Besides the built-in pipes, we can also create a custom one. 

Give it a try and share your thoughts on using pipe operations in Python. 

[Use Pipe Operations in Python: Write Clean Codes Faster](https://www.the-analytics.club/pipe-operations-in-python)
10 websites to look for a remote web dev jobs in 2022.👇
Tags: webdev, programming, career, performance
Published: 2021-12-28 00:07:29



1. [remotive](https://remotive.io/)
2. [remoteleads](remoteleads.io)
3. [remoteok](remoteok.io)
4. [angel](angel.co/jobs)
5. [justremote](justremote.co)
6. [weworkremotely](weworkremotely.com)
7. [javascriptjob](javascriptjob.xyz)
8. [flexjobs](flexjobs.com)
9. [solidgigs](solidgigs.com)
10. [dynamitejobs](ynamitejobs.com)

Conclusion ⌛
I hope you found these tips helpful. If you need any help please let me know in the comment section.

👋 Thanks for reading, See you next time
Capturando erros no React Native utilizando o Sentry.io
Published: 2021-12-27 20:39:27


**O Que é o Sentry?**

Basicamente, o [sentry](sentry.io) é uma ferramenta que nos auxilia na captura de erros que acontecem nas nossas aplicações em modo debug e também em produção.

é só isso mesmo!!!

**Bora ver como isso funciona?**


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



1. Crie uma conta no [sentry](sentry.io)

2. Vai em *Criar um projeto* e selecione a plataforma ( no nosso caso, REACT NATIVE ) e clica em Criar projeto.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9bdugtpk5o85tlqt9ic6.png)


## Agora no nosso projeto React Native

1 - Instalar a biblioteca de integração do Sentry com o React Native.

```
npm install --save @sentry/react-native
# or
yarn add @sentry/react-native
```


2 - Adicionar o Sentry no nosso aplicativo

Você pode adicionar a chamada do sentry no seu app.js ou app.ts da seguinte maneira:

```
import * as Sentry from "@sentry/react-native";

Sentry.init({
  dsn: SUA_DSN_AQUI
});
```

*Sua DSN aparece logo após você criar o seu projeto React Native na plataforma do Sentry*


3 - Faça o build da sua aplicação novamente
```
 yarn android 
 ou
 yarn ios
```

E pronto, sua aplicação agora está sendo monitorada pelo sentry, e qualquer erro ele vai te mostrar em uma dashboard da plataforma.

Você também consegue ver algumas métricas do dispositivo do usuário, como:

Nível de bateria, network que estava sendo utilizada no momento do crash, IP e etc...



É isso galera, qualquer dúvida deixe nos comentários :D
Unable to use Fastlane on macOS Monterey 12.1
Tags: reactnative, android, fastlane
Published: 2021-12-27 22:51:15

## TL;DR
These are the steps that solved it for me:
1. Install rvm using `curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable`
2. Reload terminal
3. Upgrade xcode to latest version
4. Run `rvm install ruby-2.7`
5. Run `rvm use ruby-2.7.5`
6. Run `bundle update`
7. Fastlane should work as expected

## Steps explained
Below I noted detailed error messages and solutions:

We use Fastlane to help Android build on our React Native project. After upgrading my macOS to Monterey 12.1, my `bundle exec fastlane` commands no longer work, and I was prompted to update my bundler. But when I ran `bundle update`, I got this error: 
```
An error occurred while installing unf_ext (0.0.7.7), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.7' --source 'https://rubygems.org/'` succeeds before bundling.
```
However, running the suggested command didn't work. After digging around, I found that I needed to upgrade my ruby version to v2.7, for which I ended up using rvm. Note that after installing rvm, the `rvm` commands won't be available until the terminal has been restarted.

Then, when I first used `rvm install ruby-2.7`, it wasn't successful due to this error `Error running '__rvm_make -j16'`. After checking the 'make.log' file, I found this error, `use of undeclared identifier RUBY_FUNCTION_NAME_STRING`. Updating my xcode to the latest version ended up getting rid of the error.

Finally, I was able to use ruby v2.7.5 with `rvm use ruby-2.7.5`. (You can check that your ruby version is successfully updated using `ruby -v`). And `bundle update` ran successfully and my Fastlane commands started working as expected.

Hopefully this post can be of help to people who're searching for solutions to make Fastlane work with macOS Monterey!
Modificando o comportamento padrão do ciclo de vida de recursos do Terraform
Published: 2021-12-27 22:33:49

Nesse post, vou tentar abordar um pouco sobre o ciclo de vida de recursos do Terraform e falar um pouco sobre um bloco de meta-argumento bem especial.

## O que acontece quando eu executo um `terraform apply?`

De forma resumida, quando você executa um `apply`, o comportamento padrão do Terraform é tentar realizar uma (ou mais de uma) das seguintes tarefas:

* Criar recursos que existem no seu código mas não estão associados a um objeto da infraestrutura real no *state*.
* Atualizar em execução recursos que tiveram alguma mudança na sua configuração em código.
* Destruir recursos que existem no *state* mas não existem mais no seu código.
* Destruir e recriar recursos que tiveram alguma mudança na sua configuração mas não podem ser atualizados em execução por limitações da API do provider.

Como deu pra ver, o `apply` não vai só criar ou atualizar recursos em execução, em certos casos vai ser preciso destruir o recurso.

## O bloco de meta-argumento `lifecycle`

Pensando em casos onde por algum motivo você não quer que o Terraform tenha esse comportamento padrão em um `apply`, existe um bloco de meta-argumento bem especial chamado `lifecycle`:
```
  lifecycle {
   
  }
```
Esse bloco pode ser adicionado no corpo de um `resource` e tem os seguintes argumentos:

* `create_before_destroy (booleano)`: Caso seja `true` vai alterar o comportamento para casos onde a atualização precise destruir e recriar o recurso, nesse caso vai primeiro criar o novo recurso e só depois destruir.

* `prevent_destroy (booleano)`: Caso seja `true` o Terraform vai retornar um erro em **qualquer** `plan` que tenha a destruição de algum recurso.

* `ignore_changes (lista de nomes de atributos)`: Para a lista de atributos recebida, o Terraform vai ignorar mudanças nesses atributos. Um caso especial desse argumento é que caso seja uma lista com a *keyword* `all` o Terraform nunca vai verificar por mudanças.

Abaixo um exemplo com todos os argumentos:
```
resource "aws_instance" "my_instance" {

....
  lifecycle {
    prevent_destroy = true 
    create_before_destroy = true # esse caso vai ser desnecessário porque já existe o prevent_destroy habilitado.
    ignore_changes = [
      tags,
    ]
  }
}
```


## Referências
* https://www.terraform.io/language/resources/behavior
* https://www.terraform.io/language/meta-arguments/lifecycle
(PART 2) Make the Disney.com Landing Page in 90 minutes
Tags: css, webdev, tutorial, html
Published: 2021-12-27 22:25:29

## How to make the disney.com landing page in 90 minutes(turned out to be 100 minutes after editing) - part 2

**[Checkout part 1 ](https://sebcodestheweb.hashnode.dev/make-the-disneycom-landing-page-in-90-minutes-youtube-tutorial)**

**Hello, and welcome to my awesome blog! 😊**

Today we are going to finnish the disney.com landing page clone.

This blog is part 2, of my YouTube tutorial where I am going to show you how you can copy the disney.com landing page only using vanilla html and css. This project also focuses heavily on flexbox, so if you want to get some practice with that then this is the perfect tutorial!

## Watch the tutorial on YouTube:

{% youtube nyLoau6u794 %}

In the first part, we got a lot of practice with mobile-first design, and in this second part the focus is on turning this website into a responsive beast! Working of super small, and super big screens.

I have made a git repository that you can clone to follow along the tutorial (which I recommend)  
https://github.com/SebCodesTheWeb/disneyclone


## --About me--

Hello! My name is Sebastian, and I'm a high-school student from Sweden. I have dabbled with some front-end development for the past few months. And since christmas brake finally arrived, I've decided to start a challenge for myself! I'm going to code for the coming 20 days.

I'm following the front-end career path at Scrimba and I'm currently at module 8 (Flexbox, Grid and Fetch). I started this project to get some practice with css flexbox.

By the end of the 20 days I'm hoping to have finished the front-end career path and have started with some backend Node.js development. I will be documenting my progress for the coming days, and filming myself and making tutorials on my 
 [YouTube-channel](https://www.youtube.com/channel/UCikWIcChAOSwoc2qpbZ6iIA) .

It would be awesome if you would follow along me on my journey and learn with me. You can follow my  [blog ](https://sebcodestheweb.hashnode.dev) and subscribe to my  [YouTube channel](https://www.youtube.com/channel/UCikWIcChAOSwoc2qpbZ6iIA). And if you liked the YouTube video then it would really make my day if you left a comment or liked this post.

![subscribe](https://cliply.co/wp-content/uploads/2020/01/372001730_SUBSCRIBE_BUTTON_400px.gif)

Subscribe.
Road to ecommerce via Gumroad :) 
Tags: gameart, gamedev, ecommerce, gumroad
Published: 2021-12-27 22:11:34

---
title: Road to ecommerce via Gumroad :) 
published: true
description: selling my game arts and complete games with discounts
tags: gameart,gamedev,ecommerce,gumroad
//cover_image: https://direct_url_to_image.jpg
---

Hi everyone!

I've just started to sell of my game arts and complete games based on Unity engine that it could be useful for someone. I decided to focus on building the new games and one more coming the next month for testing the audience in TD style.

But for now I need to capture some budget for the marketing the new game. Hope it will be possible to do it with wonderful platform Gumroad. I've just discovered how easy to create the products pages and start selling it.

Products:
- [Complete Game - Don't Fall](https://balconygames.gumroad.com/l/game-dont-fall/happycoding?_gl=1*2dery6*_ga*MTg3ODY3OTMxNS4xNjM3MTgzMjQw*_ga_6LJN6D94N6*MTY0MDY0Mjc2MC4xMy4xLjE2NDA2NDI5MjUuMA..)

Examples:
https://play.google.com/store/apps/details?id=com.balconygames.dontfall
https://apps.apple.com/es/app/dont-fall-by-balcony-games/id1460842492

- [Game Art - Don't Fall, older version](https://balconygames.gumroad.com/l/dont-fall-art/bsfr4ww?_gl=1*1k5lihx*_ga*MTg3ODY3OTMxNS4xNjM3MTgzMjQw*_ga_6LJN6D94N6*MTY0MDY0Mjc2MC4xMy4xLjE2NDA2NDI5OTQuMA..)

- [Game Art - Snake](https://balconygames.gumroad.com/l/snake-game-art/bsfr4ww?_gl=1*1jr3fd8*_ga*MTg3ODY3OTMxNS4xNjM3MTgzMjQw*_ga_6LJN6D94N6*MTY0MDY0Mjc2MC4xMy4xLjE2NDA2NDMwMTIuMA..)

Examples:
https://play.google.com/store/apps/details?id=com.balconygames.snake

- [Game Art - Paint Swipe](https://balconygames.gumroad.com/l/paiint-swipe-game/bsfr4ww?_gl=1*o9b1hp*_ga*MTg3ODY3OTMxNS4xNjM3MTgzMjQw*_ga_6LJN6D94N6*MTY0MDY0Mjc2MC4xMy4xLjE2NDA2NDMwMzIuMA..) - this game I didn't finish it but I will polish and share the source code later as well. 


Enjoy!

Thank you!

Alex.
Opinionated guide to writing the best code humanly possible

Tags: javascript, productivity, testing, webdev
Published: 2021-12-27 21:37:42

Here are the main lessons I have learnt writing code for 12 years to achieve a scalable architecture and a workflow that is a delight.

I have written and I maintain tens of thousands of lines of code (with no duplication), mainly for two apps as part of my own small software startup over the years.

Though it all, I have made plenty of terrible architecture decisions, and a few good ones.

Today I want to share how I write code nowadays, using examples from my latest product Mealplana, to achieve the following:
* Zero logical bugs*
* Zero code duplication
* 100% unit test code coverage
* Extremely simple files
* Extreme ease of feature expansion
* Pleasure to write code every day for an ever-growing project

[Interested to find out more? Please read my article on Medium](https://diego-os.medium.com/opinionated-guide-to-writing-the-best-code-humanly-possible-f2a8022694da)