teleren/devto huggingface dataset:
Configurar Token de acesso do GitHub
Tags: github, token, tutorial
Published: 2022-06-15 14:42:19

No seu perfil do GiHub clique em configurações
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xc8fel2o65s4j2pcfstk.png)

Na parte inferior da barra lateral você vai encontrar a opção de desenvolvedor

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

Cligue em **Personal access token** e depois em **Generate new token**

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

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

Escolha as permissões do token conforme a sua necessidade

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

Você pode personalizar a data de expiração do token. O padrão é 30 dias.

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

Apos concluir essa etapa role a página até embaixo e clique em **generate token**

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

:exclamation: Lembre-se de salvar o token em um arquivo ou anote em algum lugar, pois não será possível visualizar o token novamente. :exclamation:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/woq444n6datokfmpb5w5.png)
Admin-panel testing
Tags: adminpanel, admin, react, reactadmin
Published: 2022-06-15 14:35:42

Our team is engaged in outsourcing development. Over the years of our work, we have come across the fact that almost every project needed an admin panel. Yes, of course, there are enough solutions for Laravel, but they have 2 major disadvantages for us:

— ugly interface
— difficult to customize

Therefore, we set out to create our own admin panel so that we don't have to develop it from scratch every time. It should be easy, and customizable. We also didn't want to get attached to any particular backend language. 

We created our CRUD as we intended, beautiful and functional. The table has sorting, pagination, filters, set of components, select, multi-select, etc. Customization is possible – choose any theme, and it will not break after updates.

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

Our admin panel has other advantages:

— the speed of working with the admin panel (it is possible to create a basic CRUD in 10 minutes and 10 lines of code)
— the speed of the admin panel itself (in comparison with competitors)
— lightweight and fast deployment
— the ability to customize (fields, themes, etc.)
— there is no binding to any language
— high-quality UX / UI (in comparison with competitors, in particular - with Chinese)

Despite the fact that the available functionality is not as wide as in React Admin or Nova our product is more lightweight and with a fast entry threshold. 

Very soon we will finish the first stage of work and arrange a closed test. Do you want to be the first who will see and try our product? Fill out the [form](https://airtable.com/shrI6E87E8dVD3SM9) and we will send you access as soon as we complete the work.
TEST2
Published: 2022-06-15 14:30:41

**wdawawdadadsdaadsadsdas_dawwaddawawdwadwad_**
`aawddwaawdawdawdwadawdawdawd

> dawawdawdawdawdawdaw

## awdawdawdawdwadawwawadawd
`awwdawadwawad

## wdawadwaddwawdawadwadwad

waddwawaddwaawdawawdwadwad

1. adwadwadwadwadwadwadwadwadawd
awwa
d
wadwad
wadwad[](awdwadwadwadwdawdawadawdwad

```
wadawdwadwdawdawdawadwadwad
```
)
Counting Bits
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 14:30:39

Given an integer `n`, return _an array_ `ans` _of length_ `n + 1` _such that for each_ `i` (`0 <= i <= n`)_,_ `ans[i]` _is the **number of**_ `1`_**'s** in the binary representation of_ `i`.

**Example 1:**

**Input:** n = 2
**Output:** \[0,1,1\]
**Explanation:**
0 --> 0
1 --> 1
2 --> 10

**Example 2:**

**Input:** n = 5
**Output:** \[0,1,1,2,1,2\]
**Explanation:**
0 --> 0
1 --> 1
2 --> 10
3 --> 11
4 --> 100
5 --> 101

**Constraints:**

*   `0 <= n <= 105`

**Follow up:**

*   It is very easy to come up with a solution with a runtime of `O(n log n)`. Can you do it in linear time `O(n)` and possibly in a single pass?
*   Can you do it without using any built-in function (i.e., like `__builtin_popcount` in C++)?

**SOLUTION:**

    class Solution:
        def countBits(self, n: int) -> List[int]:
            ans = [0]
            for i in range(1, n + 1):
                ans.append(ans[i >> 1] + i % 2)
            return ans
Using Absolute Paths in React Native
Tags: reactnative, javascript, beginners, react
Published: 2022-06-15 14:30:04

## **Expectation**

```js
// Hmmm
import {add} from '../../../../../../../utils';

// Awesome!
import {add} from 'utils';
```

## How ?

**Step 1:** Install `babel-plugin-module-resolver`

```bash
npm install --save-dev babel-plugin-module-resolver
// or
yarn add --dev babel-plugin-module-resolver
```

**Step 2:** Add the following code to `babel.config.js` file.

```js
module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    [
      require.resolve('babel-plugin-module-resolver'),
      {
        root: ["./src"],
      }
    ],
  ]
};
```

**Step 3:** Create file `jsconfig.json`

```json
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "*": ["src/*"],
    }
  }
} 
```
5 ways to increase app valuation and score a beautiful EXIT webinar
Tags: mobile, tutorial, discuss, management
Published: 2022-06-15 13:52:56

Hello team 😊

On June 21, 2:00 p.m CEST, we will hold a webinar together with Alon Waller from Bluethrone, an app acquisition company. 

**Join this webinar to learn more about:**

- How to measure and optimize the metrics that affect investors’ decisions
- Why ASA is a must-have tool for those who want to sell an app
- App Quoting Engine: how do investors determine what is the real value & growth potential of each app
- Investors’ insights: what will make investors want to pay more?

Hurry up to save your spot! We’re waiting for you :

[https://qonversion.io/webinar-five-ways-to-increase-app-valuation](https://qonversion.io/webinar-five-ways-to-increase-app-valuation)
Anatomy of a Go Program
Tags: go, beginners, tutorial, programming
Published: 2022-06-15 13:51:34

I recently started learning Go after going through a lot of articles talking about all the awesome features it has. Here, I will try to break down a simple Go program that prints a line to understand the anatomy of a Go program.

```go
package main

import "fmt"

func main(){
	fmt.Println("Hi there!")
}
```

First, let's understand how to run this program. The simple command below will run the program(Assuming the file is named main.go).

```sh
go run main.go
```

The Go CLI has a lot of other options as well. Let's just have a look at a few frequently used ones.

| Command    | Function                                   |
|------------|--------------------------------------------|
| go build   | Compiles go source code                    |
| go run     | Compiles and executes the go source code   |
| go fmt     | Formats all code in the current directory  |
| go install | Compiles and installs a package            |
| go get     | Downloads source code of other package     |
| go test    | Run test cases associated with the project |

## Go Packages

So, lets start with *package main*.

A package is a collection of common source code files. A package can have many related files. The only requirement is that every file should declare the package it belongs to in the first line.

### But, why to call our package main?
 
There are 2 types of packages in Go, they are 

1. Executable - Generates a executable file
2. Reusable - Generates Libraries, reusable code

The name of the package *main* makes it an executable package. If we had used any other name, it wouldn't have been an executable package. An executable package automatically executes the main function inside it. *main* here is a key word. Main package should have a main function. Also, if we build other packages, it wouldn't result in a executable file.

## Import

Now, let's look at *import "fmt"*

**import** is used to make the functionality available in the library package to the current program we are executing.

**fmt** is a standard library package available with Go. It implements formatted I/O functions similar to C's printf and scanf. 

We can get a list of all the packages available in Go at (https://pkg.go.dev/std).

## Go Functions

Functions are declared with the key word *func*. The syntax is as follows,

```go
func <name of function> (<comma seperated arguments>) {
	<body of the function>
}
```

## Structure of a Go program

All Go files follow the same pattern.

* Package Declaration
* Import statements
* Function definitions

Along this article, I hope you got a grip on the basics of Go. I will write a few more articles and will get into Go routines and all the powerful features in Go. Happy Coding!
Screenbean - Pimp your screenshots 💅
Tags: webdev, javascript, react, showdev
Published: 2022-06-15 13:46:42


[Demo](https://screenbean.brunnerliv.io/) | [Github](https://github.com/BrunnerLivio/screenbean.brunnerliv.io)

---

[✨ScreenBean✨](https://screenbean.brunnerliv.io/) is a tool to add colorful backgrounds to screenshots. This idea came to me when browsing Dribbble. I've realized a lot of promo pictures have the same pattern:

- Rounded corners of the product
- Drop shadow around the product
- Background using the primary, accent or other complementary colors
- Sometimes additional complementary shapes in the background

Here is an example of the current Dribbble startpage and you can see what I mean.

![Example of Dribbble promo pictures](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qufy21xatks150ru3rjf.PNG)



## 💡 Motivation

I often have to pitch new websites or pages to colleagues at work. Since I wanna leave a good impression, I wanna spice up my screenshots to make them stand out more. Though whenever I tried to promote my website it never looked as good as the ones on Dribbble. Probably because I am not a designer -- but I have recognized that adding things like rounded corners make a huge difference. 

After a while I wanted to automate this process. So on a boring Friday evening I wrote ScreenBean just for the fun of it.

## 📝 Technical Decisions

First and foremost I wanted to keep the app alive and "don't worry about it ever again". I don't have any interest in generating revenue with ScreenBean -- but I also don't wanna loose money. So I tried to implement everything client-side. For sure it would be the better technical decision to use a Serverless function to, for instance, generate the images. Though in my context I just didn't want to spend a dime.

## 👨‍💻 Tech Stack

At the heart of ScreenBeans implementation are two libraries from NPM:

- [html-to-image](https://www.npmjs.com/package/html-to-image): Generate images from DOM elements client-side 
- [node-vibrant](https://www.npmjs.com/package/node-vibrant): Extract prominent colors from an image

So with these two libraries all I had to do was essentially creating the images using normal HTML/CSS dynamically. Then I can just generate the *.png graphic using html-to-image. Thanks to node-vibrant I can take prominent colors of the image so it usually looks complementary.

I have used React to help me with building the different preview images, the upload mechanism and saving the images. 

Since the application is client-side only I could just use free-tier of Netlify for my deployment.

I am a huge fan of TypeScript, though for this project I have decided not to use it. Since I don't need to handle a lot of data throughout the application there did not seem to be a huge benefit of using it. 

---

[Demo](https://screenbean.brunnerliv.io/) | [Github](https://github.com/BrunnerLivio/screenbean.brunnerliv.io)
Rust Explorer: A playground that has over 10,000 most downloaded crates
Tags: rust, programming, beginners, productivity
Published: 2022-06-15 13:34:47

TLDR: [Rust Explorer](https://www.rustexplorer.com/b/adnq56)


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

A few months ago, I began working on a Rust project that uses a few large dependencies. The compilation took a few minutes on my slow laptop. Every time I make small changes, I had to wait for a few minutes.

My workaround at the time was by creating smaller repl packages. Once they worked I'd copy/paste them into the main package. This is clearly not ideal. Navigating between many packages and copy/paste-ing codes was cumbersome, especially when working on NeoVim.

So I decided to put aside my main project for awhile to build Rust Explorer.

## What you can do with it?

- Use the top 10,000 most downloaded crates in the last 90 days.
- Set `[profile.dev]` for benchmarking.
- Access the internet.
- Save files and read them on subsequent runs.

Other notable features:

- Real-time output, useful for working with async code.
- ASCII color support to spot error easily.
- Save bins and group them into collections.
- Revisit execution history.

## How it works?

This project is highly inspired by the official playground. In early iterations, I tried to compile the 10,000 crates all at once. But they failed on the first few crates because of issues like version conflict, platform not supported, and system library not found.

I then tried to compile them one by one with all features enabled and skipped crates that failed to compile. Many did fail. The compilation output took so much space that I only managed to compile 1000 crates.

I wasn't happy with the container startup time which (again, on my slow laptop) could take 5s.

I tried to compile to wasm. The startup time was much better, under 1s. But many crates couldn't be compiled to wasm, e.g. rand. Wasm was very limited, so I abandoned it.

After some experiments I arrived at the current version. Each user has a compiler and executor running continuously. This way we don't need to recompile the same dependencies. Plus, we avoid running a new container on every run.

With collections, we can use Rust Explorer like a jupyter notebook. For example one bin is used for downloading and writing csv files. And other bins are used to query the data.

Here are some examples:

- [actix-web](https://www.rustexplorer.com/b/q76rqj)
- [axum](https://www.rustexplorer.com/b/adnq56)
- [bencher](https://www.rustexplorer.com/b/r9f76b)
- [rustqlite](https://www.rustexplorer.com/b/bu11ee)
- [scraper](https://www.rustexplorer.com/b/8dnnba)

I hope this project could be useful for some Rust devs too.
What is Web5 and does it already exist?
Tags: web5, web3, blockchain, decentralization
Published: 2022-06-15 13:31:56

In this video, I introduce **Web 1, 2, 2.5, and 3** and explain in simple terms what **Web5** is and how it differs from **Web3**.

I also mention the platform [DeSo](https://deso.org) which may already have done what [Jack Dorsey](https://en.wikipedia.org/wiki/Jack_Dorsey) is trying to achieve.

{% embed https://www.youtube.com/watch?v=1AdRRpvBpf8 %}

## CHAPTERS
- [00:00](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=0s) - Agenda
- [00:32](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=32s) - What is Web 1? (The Read-only Web)
- [01:29](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=89s) - Examples of Web 1 pages
- [02:59](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=179s) - What is Web2? (The Participative Social Web)
- [05:06](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=306s) - What is Web3? (The Semantic Web)
- [07:50](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=470s) - What is Web5? (The True Decentralized Web)
- [12:28](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=748s) - What are DIDs? (Decentralized Identifiers)
- [13:57](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=837s) - What are VCs? (Verified Credentials)
- [15:20](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=920s) - What are DWNs? (Decentralized Web Nodes)
- [18:22](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=1102s) - What are DWAs? (Decentralized Web Apps)
- [19:25](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=1165s) - Web5 vs Web 2.5
- [20:48](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=1248s) - Examples of Web 2.5 applications ([Entre](https://joinentre.com/), [Metability](https://metability.io/))
- [23:51](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=1431s) - Web5 kind of exists already ([The DeSo Blockchain](https://deso.org/))
- [27:40](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=1660s) - Is the DeSo Marketing team taking action?
- [29:05](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=1745s) - Saud Muzaffar voices his concerns about the Bitcoin Lightning Network
- [34:11](https://www.youtube.com/watch?v=1AdRRpvBpf8&t=2051s) - A current problem with DeSo and an opportunity for it to be Web5

## REFERENCE LINKS
- [TBD Web5 Landing Page](https://developer.tbd.website/projects/web5)
- [Metability](https://metability.io/)
- [DeSo](https://deso.org/)
- [Entre](https://joinentre.com/)
- [DeSocialWorld](https://desocialworld.com/)
- [Overclout](https://overclout.com/)

## SUPPORT WEB3 SIMPLIFIED
- Join the [Web3 Simplified DAO](https://daodao.io/d/Web3Simplified)
- Subscribe to the [Web3 Simplified YouTube Channel](https://www.youtube.com/web3simplified)
Single Element in a Sorted Array
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 13:30:41

You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once.

Return _the single element that appears only once_.

Your solution must run in `O(log n)` time and `O(1)` space.

**Example 1:**

**Input:** nums = \[1,1,2,3,3,4,4,8,8\]
**Output:** 2

**Example 2:**

**Input:** nums = \[3,3,7,7,10,11,11\]
**Output:** 10

**Constraints:**

*   `1 <= nums.length <= 105`
*   `0 <= nums[i] <= 105`

**SOLUTION:**

    class Solution:
        def singleNonDuplicate(self, arr: List[int]) -> int:
            n = len(arr)
            beg = 0
            end = n
            while beg <= end:
                mid = (beg + end) // 2
                if mid < n - 1 and arr[mid] == arr[mid + 1]:
                    i = mid
                    j = mid + 1
                elif mid >  0 and arr[mid] == arr[mid - 1]:
                    i = mid - 1
                    j = mid
                else:
                    return arr[mid]
                if i % 2 == 0:
                    beg = i + 1
                else:
                    end = i
People rarely use complicated git commands on the weekend, and I have the data to prove it.
Tags: git
Published: 2022-06-15 13:28:52

Preamble: We've been running an experimental project to catalog good evergreen guides on DEV. Some initial work [is available here](https://dev.to/guides) if you're curious. It's a low-key experiment so don't read too much into what's currently there. But that's an aside to the topic of this post.

In tracking the project, I've been keeping an eye on traffic coming to these guides based on how we organize things — and by starting with CSS and Git topics, I noticed something pretty stark: **Weekend git traffic falls off _wayyyyy_ more than CSS.**

CSS traffic falls by about 40-50% on weekends. **Git search traffic falls by about 80%. 🤯**

This isn't exactly surprising — it's just interesting to see. On the weekend, work is most likely to be solo — and use of git, if at all, is most likely in a pretty straightforward way with minimal branching.

Remember, this is not _overall development_, it is git relative to another pretty ubiquitous tool. I think it's unlikely people who have git as part of their flow at all don't use it on their weekend projects — but I expect that they are way more likely to stay within their comfort zone and routine, and do not have to look up git commands nearly as often as in a collaborative work environment.

{% embed https://twitter.com/thepracticaldev/status/762709515133485056 %}

**Happy branching ❤️**
How to create a Woocommerce Rest endpoint to Add all items to cart
Tags: woocommerce, wordpress
Published: 2022-09-05 08:43:48

---
title: How to create a Woocommerce Rest endpoint to Add all items to cart
published: true
date: 2022-06-15 13:28:15 UTC
tags: woocommerce,Wordpress
canonical_url: https://daniele.tech/2022/06/how-to-create-a-woocommerce-rest-endpoint-to-add-all-items-to-cart/
---

Some snippets to achieve something that Woocommerce still doesn't after years of REST api in the plugin itself...

The post [How to create a Woocommerce Rest endpoint to Add all items to cart](https://daniele.tech/2022/06/how-to-create-a-woocommerce-rest-endpoint-to-add-all-items-to-cart/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
Configurar usuario e senha global no github
Tags: github, git, tutorial, config
Published: 2022-06-15 13:21:07

Configure o nome de usuário e o email de acordo com a sua conta do GitHub.
```
git config --global user.name "fname lname" 
git config --global user.email "example@gmail.com" 
```

A senha deve ser o seu token de acesso gerado no GitHub: https://dev.to/jvmartyns/configurar-token-de-acesso-do-github-5eep
```
git config --global user.password "github_access_token" 
```

Para ver as configurações existentes use o comando
```
git config --list --show-origin
```
social networking for programmers. lets connect Globally
Tags: discuss, programming, productivity, devops
Published: 2022-06-15 13:18:23

lets grow together buddies
follow me on 
Twitter[](https://twitter.com/Ngwasidaniel)
sololearn[](https://www.sololearn.com/profile/16988141)
github[](https://github.com/stars/dan3266/lists/pythonista)
linkeln[](https://www.linkedin.com/in/daniel-n-29924a69/)
facebook[](https://web.facebook.com/daniel.ngwasi.9/)
`print(hello world)

```
lets grow together
```
`
Internet Explorer is dead and we killed it
Tags: webdev, opensource, showdev
Published: 2022-06-15 13:11:43

Today is June 15th 2022 and Internet Explorer 11 is dead. For those who don’t know, I built [Death to IE11](https://death-to-ie11.com/) in 2019 out of frustration and desperation. Now I know that it is only technically dead on Windows 10 and onward, but it is great news nonetheless, the common developer won’t have to support it anymore.


Some stats about my silly little project:

Website analytics (since September 2020):
- total of 148.1K unique visitors (and counting)
- total of 285.6K page views (and counting)
- ~7k Monthly unique visitors
- ~13.6k Monthly page views

Github (repo created in March of 2019):
- 187 commits
- 67 pull requests (including dependabots)
- 26 contributors

These numbers might not seem super big to most people, but it's still impressive to me that a project that I built out of frustration got as much attention as it did.

Thank you for all the contributors and thank you Microsoft for finally pulling the plug on Internet Explorer 11.