teleren/devto huggingface dataset:
Um pouco sobre meu primeiro livro na área de tecnologia
Tags: javascript, python, webdev, beginners
Published: 2022-04-08 00:15:44

A um pouco menos de 4 dias lancei meu primeiro livro 

> Transformando códigos em sonhos

O objetivo do livro é passar um pouco da minha experiência nessa minha caminhada como programador nele eu retrato situações que já aconteceu comigo e dou dicas de como iniciar na área tech

O livro é gratuito você pode encontrar mais informações no [meu site](https://bendevoficial.com/livro)
Permission Denied: Writing to Privileged Locations
Published: 2023-01-06 03:03:04

---
title: Permission Denied: Writing to Privileged Locations
published: true
date: 2022-04-08 00:09:40 UTC
tags: 
canonical_url: https://brandonrozek.com/blog/permission-denied-writing-privileged-locations/
---

Perhaps you’ve tried something like the following:

```
sudo echo "hi" > /etc/test

```

Only to receive back an error

```
bash: /etc/test: Permission denied

```

This is because the `sudo` part only applies to the echo command. Bash which is the process that takes the `"hi"` from the `echo` standard out and writes it to `/etc/test` is still under the unprivileged user.

Instead consider the following:

```
echo "hi" | sudo tee /etc/test

```

The command `tee` takes whatever is in standard in, and writes it to the filename specified. Since we applied `sudo ` to the `tee` command, it now has the necessary permissions to write to a privileged location.
Comparing dates in Elixir
Published: 2022-04-10 05:03:30

---
title: Comparing dates in Elixir
published: true
date: 2022-04-08 00:00:00 UTC
tags: 
canonical_url: https://ulisesavila.com/elixir/comparing-dates
---

## Introduction

Comparing dates is a common procedure in day to day jobs. Whether you need them to trigger future, or past jobs you will need to know how to do it in Elixir.

### Contents

- [Introduction](#introduction)
  - [Contents](#contents)
- [Requirements](#requirements)
- [Comparing Dates](#comparing-dates)
  - [Example 1](#example-1)
  - [Example 2](#example-2)
- [After thoughts](#after-thoughts)

## Requirements

- none

## Comparing Dates

To acomplish this task, you will use the `.compare/2` method. Which exists in both `Date` and `DateTime` structs.

Upon success compare, the method will return any of the next atoms `:lt | :eq | :gt`.

#### Example 1

A `DateTime` utc format comparison where the first element is greater than the second.

```
iex(5)> DateTime.compare(~U[2022-04-10 04:51:27.626455Z], ~U[2022-03-10 04:51:27.626455Z])
:gt

```

#### Example 2

A `Date` comparison where the first element is lesser than the second.

```
iex(2)> Date.compare(~D[2022-04-01], ~D[2022-04-08])
:lt

```

## After thoughts

After using other tools in differents environments like `date-fns` or `moment` in javascript. I find refreshing the method used in this posting, instead of relying on a specific method to assert a question, ie `isAfter` from `date-fns`, here you get exactly the result of the comparison.
Networkx Random Sample Graph
Tags: python
Published: 2023-01-06 03:03:12

---
title: Networkx Random Sample Graph
published: true
date: 2022-04-07 23:48:12 UTC
tags: Python
canonical_url: https://brandonrozek.com/blog/networkx-random-sample-graph/
---

I’ve been working on several algorithms in `networkx`. In order to speed up testing, especially on large graphs, I’ve been randomly sampling portions of the original graph. The best way I’ve found to do this is through the following python snippet:

```
import random
random_sample_edges = random.sample(list(G.edges), SAMPLE_SIZE)
G_sample = nx.Graph()
G_sample.add_edges_from(random_sample_edges)

```

It might be tempting to sample the nodes and then grab the subgraph like the following:

```
import random
random_nodes = random.sample(list(G.nodes), SAMPLE_SIZE)
G_sample = G.subgraph(random_nodes)

```

However, only considering the nodes when sampling makes it highly likely that the subgraph will significantly less edges. This results in a mostly disconnected subgraph and a loss of information. Sampling the edges prevents this issue at the expense of not capturing single nodes not connected to anything else.
Total POS
Tags: flutter, spanish, opensource, totalpos
Published: 2022-04-07 23:31:56

Un punto de venta desarrollado en Flutter.

> En un capitulo más de esta serie llamada:
> "Ingeniero aburrido un fin de semana"
> (Aun que se alargo casi una semana por que no lo quería sacar tan a medias).

## Contexto ✒️

Hace ya un rato que quería desarrollar un punto de venta con alguna tecnología que lo hiciera estético y versátil. Los puntos de venta mas utilizados son desarrollados sin responsive quedando mas como ventanas flotando por ahí, o con algunas partes alargadas.

Desde la salida de Flutter con soporte (Alpha en aquel entonces, hace unos dos años) me decidí hacer uno pero como imaginaras me tope con varios inconvenientes. En primera poco sabia de programación (Bueno, complicada esta parte ya que nuestro conocimiento en este mundo siempre será inversamente proporcional a lo que sabemos que no sabemos. Vaya, Entre mas sabes mas te das cuenta de lo mucho que desconoces).

Ahora con la salida del soporte oficial a Windows y el gran apoyo de Canonical para desarrollo en Desk con Flutter para Ubuntu. Hoy me vuelvo animar, con menos dudas y mas ganas.

## Esto no es un tutorial ✨✨

Esto pretende ser mas una bitácora que un tutorial. Donde iré documentando mi proceso, las dificultades, las soluciones y que decisiones voy tomando al vuelo.

Por ahora las tecnologías son **Flutter + GRPC**. Pero ya veremos dijo el ciego.

## Muchas gracias 🤝

Sin mas por el momento les dejo el [repositorio](https://github.com/ushieru/total_pos). Con acceso a una [versión web](https://total-3r4jyl7qo-ushieru.vercel.app/) para que lo puedan probar sin instalar nada (Tarda un rato la primera carga, unos 5 sec, por el peso del WASM de Flutter). Se vale dar todo tipo de feedback (Sí, hasta el destructivo que nadie quiere, aquí todo suma).

Sin mas por el momento muchas gracias por leerme y Happy Hacking! 🧑‍💻🎉
Use Unicode characters for bullet points in CSS using ::marker
Tags: css, lists, ul
Published: 2022-04-07 23:20:12

---
title: Use Unicode characters for bullet points in CSS using ::marker
published: true
description: If you don't want to use plain bullets, the ::marker psuedo-element is for you!
tags: css, lists, ul
cover_image: https://images.unsplash.com/photo-1580569214296-5cf2bffc5ccd?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1770&q=80
canonical_url: https://cassidoo.co/post/unicode-bullet-points
---

I was playing around with making some `<ul>`s on an HTML page recently, and typically when I want to replace the bullet points with an emoji or an SVG or something, I'll write something like:

```css
ul { list-style-type: none; }
ul li:before { content:"\2713"; }
```

And this works, but for longer lines of text, you get some spacing issues. You can fix it by changing the padding around the list and messing with the positioning, but that's a lot of trial and error.

## Enter, the `::marker` psuedo-element!

This is a really cool, relatively new option to solve our problem! It selects the marker box of a list item (so the bullet, or a number if you're using `ol`), and you can change the font properties, the color, and some other things around it!

Demo:

{% codepen https://codepen.io/cassidoo/pen/yLpjBmK %}

It's not fully compatible with Internet Explorer, and some other older versions of modern browsers. You can check [the compatibility table here](https://caniuse.com/css-marker-pseudo), and[ the documentation for it here](https://developer.mozilla.org/en-US/docs/Web/CSS/::marker)!
👶 DEVOPS-LABS 2022.2 : premiers pas et démo Spring Native
Tags: kubernetes, docker, java, springboot
Published: 2022-04-07 23:18:35

## 👉 A propos

Ci-dessous l'extrait de notre dernier `DEVOPS-LABS 2022.2` :

{% youtube 1UepHh-P4Vg %}

... lequel est en lien direct avec la démo récemment opérée sur Knative : 

{% embed https://dev.to/optnc/knative-the-easy-way-to-serverless-a-java-app-3n36 %}
Testes unitários com ExUnit
Tags: elixir, erlang, testing, elxpro
Published: 2022-04-07 23:12:05

Hoje participei de uma talk muito bacana no #elxpro falando sobre testes unitários utilizando o ExUnit.

{% embed https://www.youtube.com/watch?v=5CdHuQ2ZnUk %}

Slides: https://speakerdeck.com/allefgomes/testes-unitarios-com-exunit
Código: https://github.com/allefgomes/elxpro
A French IA win against eight world champion of bridge
Tags: news
Published: 2022-04-07 23:11:14


# What is the Bridge ?

The bridge, it's a card game (52 cards) played with four people, in a team of two against two.

It's a game based on the communication (because we play at two) and it's a game need a strategic reflexion and it's a random game.

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

# Why this is a real advance

It's a real advance in IA, because of the particular difficulty to play in this game. 

Indeed, this game, it's a random game played with partial information for each players. With this game, the IA makes many choices without knowing the cards of other players.

So we can say the bridge as a really hard game, modelled on the real life.

In real life we make sometimes choices without knowing the result or the consequences of these choices.

It's a really different IA of [AlphaGo](https://en.wikipedia.org/wiki/AlphaGo) (Go) and [Deep blue](https://en.wikipedia.org/wiki/Deep_Blue_(chess_computer)) (Chess). Because unlike of the bridge, in Chess and Go, all information is observable and available for the IA. 

> AlphaGo IA reportage.
{% youtube https://www.youtube.com/watch?v=8dMFJpEGNLQ %}

# Who created this IA ?

That AI is called Nuke, and it was founded by a French start-up named [Nukkai](https://nukk.ai/). This start-up was created to make many searches on IA.

An for [Veronique Ventos](https://www.linkedin.com/in/veronique-ventos-28704190/) (the founder of Nukkai) the bridge was a really good game to explore the potential of IA.

So this IA, was created to explore the many possibilities of IA and try to make a new challenge.

# How Nuke globally work ?

Nuke was trained with the [simulation of "Monte Carlo"](https://en.wikipedia.org/wiki/Monte_Carlo_method).

> This simulation is named ["Monte Carlo"](https://en.wikipedia.org/wiki/Monte_Carlo) (Monaco place)  because of many randomnes games.
{% youtube https://www.youtube.com/watch?v=7ESK5SaP-bc %} 

That's not all, Nuke it's not a "black box" for human. Indeed, he makes decisions and explain all of human in many different levels of comprehension.
This makes a real difference, because here we gonna understand exactly how the IA works unlike of AlphaGo for example who win but we don't know how exactly how he win.

> The redifusion of Nukkai challenge 
{% youtube https://www.youtube.com/watch?v=pKzzIOyHJhQ %}

---

## What do you think about the evolution of AI ?

<a href="https://www.buymeacoffee.com/tykok"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a sushi&emoji=🍣&slug=tykok&button_colour=5F7FFF&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00" /></a>

> A particular thanks to ["Siècle digital" ](https://siecledigital.fr/2022/04/04/une-ia-victorieuse-au-bridge-contre-huit-champions-du-monde/) and ["Monde numérique"](https://www.mondenumerique.info/nukkai-l-ia-explicable-qui-joue-au-bridge-itw-jean-baptiste-fantun/) who giving me information about this news.
Day 554 : Guess Who's Back?
Tags: hiphop, code, coding, lifelongdev
Published: 2022-04-07 23:05:06

_liner notes_:
- Professional : Guess who's back? Today I took it pretty slow. I got home from the airport at like 2am and had a bunch of meetings. Worked on a couple of light things to take it easy like fill out event forms and some documents for upcoming stuff. I need to submit my expenses as well.

- Personal : So, I just came back from like a 2 and a half week tour of Europe. I got to visit London, Paris, Amsterdam and Brussels. It was for work. I did a bunch of workshops, talks, interviews and a meetup. It was a pretty hectic schedule, but I was able to get it all done and with some really good feedback. I was able to chronicle the trip with photos and videos on mt recently revamped site https://doingstuff.in or https://dwane.in The site performed very well. There's a couple features that I think will be pretty handy that I could only have thought of by actually using it. Those things are bulk uploading and being able to read the metadata from photos. Going to investigate and see what it takes to make it work.

![View of a snow-topped mountain range in the distance in Almaty, Kazakhstan with a lake and some trees in the foreground](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ituh5zis4aiz70wz9dvi.jpg)

One thing that I liked doing was to record retrospective videos. Basically going over what happened during the day. Sometimes I wasn't able to do it at the end of day, so I combined multiple days into one video. I took notes so that I wouldn't forget any points and to keep my rambling to a minimum. Once I got a template down, I was able to knock out the videos pretty quickly. Will definitely do more as I travel. Probably catch up to Atlanta and go to bed early tonight.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube WyY-HTpH_lw %}
🕵️ About Java Bytecode, native binaries & security (short Grype benchmark)
Tags: security, serverless, kubernetes, devops
Published: 2022-04-07 22:12:05

## ❔ Intro

We are currently working on the following topics :

- Native Docker images delivery through Github Actions, on various registries (mainly [GHCR.io](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) and [Docker Hub](https://hub.docker.com/u/optnc))
- Java native experience : migration to [Spring Boot Native](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/) & [Quarkus](https://quarkus.io/) experimentations
- Security for our Images Continuous Deployment pipeline

## 🛡️ Security

For our **source code & dependencies**, we are applying security strategy thanks to Dependabot :

{% embed https://dev.to/optnc/dependency-management-automation-with-dependabot-3l62 %}

...and [GitHub Advanced Security](https://docs.github.com/en/enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security) for some repositories.

## 🖕 Controlling Docker images releases

More and more we release and rely on an ever growing set of Docker images.
To make short, as Software Developers and DEVOPS engineers, the ones that interest us currently are :

- The images we rely on
- The image we build ourselves (on top of previous ones)

👉 **What we  ~~want~~ need to be able to do is : to be able to control the security level of the images we are building...**

⚠️ **And not release them if they do not reach the expected level of security, depending of the target service.**

> _As all services do not have the same criticity, vulnerabilities level may have different impacts on runtime security governance._ 

## 👐 Experimentation and solutions

Fortunately [anchore](https://anchore.com/) provides a set of ready to use tools that helps... a lot :

- [grype](https://github.com/anchore/grype) (_vulnerability scanner for container images and filesystems_)
- [syft](https://github.com/anchore/syft) (_CLI tool and library for generating a Software Bill of Materials from container images and filesystems_)
- [`grype` as a Anchore GitHub Action](https://github.com/marketplace/actions/anchore-container-scan) : 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilqrmjadb1ttgfz8vukw.png)
 
👉 So you can easily protect your Continuous Delivery pipeline  thanks to the `severity-cutoff` :

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zf94iv7slu5dvopsevg.png)
 
## 🤔 Bytecode vs. native impact on security

We wanted to give a quick look at if - and so how - native strategy impacts security, discover the `grype` output below:

{% youtube LPrxUb82wCY %}

## 🔖 Resources

- [`grype`](https://github.com/anchore/grype) on GitHub
- [`grype` Feature request : Optional External Data Source Reference for Maven Packages](https://github.com/anchore/grype/issues/711)

{% embed https://github.com/anchore/grype %}
Transforming SVG files into React Components 🖼️ ->🧩
Tags: javascript, react, nextjs
Published: 2022-04-07 21:48:40


## Importing SVG files in React

If you've ever faced an issue where you had no idea how to import an SVG file in React.js or any other Javascript Framework then you've probably been in the same situation that I've been in 😢

## So what's the solution? SVGR!

SVGR is a tool that applies complex transformations to convert an SVG file to JSX/React Component

So basically it converts an SVG file to a React Component automatically! ✨

Let's assume we had our SVG file as the following:

```html
<svg
  width="200px"
  height="200px"
  viewBox="0 0 200 200"
  version="1.1"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
>
........
........
........
</svg>
```

It would simply be converted into this form!

```javascript
import * as React from 'react'

const SvgComponent = (props) => (
  <svg width="1em" height="1em" viewBox="0 0 200 200" {...props}>
    <path d="" fill="#FFF" />
  </svg>
)

export default SvgComponent
```

## I've tried it on Next.js, I've had to do a two step process

First I had to configure my `next.config.js` file by adding the following:

```javascript
module.exports = {
  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/i,
      issuer: /\.[jt]sx?$/,
      use: ['@svgr/webpack'],
    })

    return config
  },
}
```

And after that I simply imported my logo as an SVG but wrote it as a React Component into `Home` by writing the following code:

```javascript
import Logo from './logo.svg'

const Home = () => (
  <div>
    <Logo />
  </div>
)
```

It's as simple as that!

## SVGR Playground

SVGR's website includes an in-browser SVG -> React Component converter which I've personally used on multiple occasions when I didn't need to install SVGR as a package
https://react-svgr.com/playground/

![An image of SVGR Playground](https://i.imgur.com/uCA2BQi.png)

## [The best way of learning is by experimenting! Click here to visit SVGR's website](https://react-svgr.com/)
How to create a landing page for your startup?
Tags: startup, webdev, productivity, showdev
Published: 2022-04-07 21:44:08

I am constantly working on new ideas. And ideas do best when they are shared. For a long time, creating a product website, personal page or a quick landing page was a chore. Sure, I could do it by applying my coding skills but it was neither pleasant, fast nor efficient. In this short article I want to share a gem of a service I've recently found.

First websites for my products were just free templates hosted on GitLab Pages (great free hosting by the way). It was OK but required some work from my side and never really matched my expectations. At the same time I didn't want to put that much effort into designing them. Because of that, I hired a friends’ software house to create a website for my startup. I used it as a base for two other websites but even with all the automation I introduced, after some time I didn’t feel like the design was working for me anymore. 

So I decided to pay up for a subscription and tried WIX. I really tried to make it look good but there weren't really any good templates for my use case. Additionally, the layout editor was so bloated that using it was a pain. The website was looking weird on some devices. I was ashamed to send this website to my clients. The only thing that came out of it was me paying for a yearly subscription for one of my websites. 

I googled, read, watched YouTube and finally somewhere, someone mentioned [carrd.co][1].

It was a revelation.

[Carrd.co][1] has some great looking templates, great SEO optimisation, short page load times, good support and importantly an affordable yearly plan ($19/year Pro is what you're looking for, as it includes custom domains).

As an example, have a look on my startup's website - [sentimatic.io](https://sentimatic.io).

Carrd includes essential features like contact forms, newsletter signup forms for the most popular services and also has many features I haven't tried yet. These include stripe payments, typeforms and others

It isn't all perfect though. I wasn't satisfied with scaling on some resolutions, the subpage implementation is really basic and kind of awkward (but hey, it's there!) and overall features are a bit limited. The last one is actually a benefit for me, as I don't get distracted and avoid *analysis paralysis*. One major issue, however, is a lack of multi language support. I bypassed it by creating another website (or carrd to be exact) and including links to a version in other language in the visible place. It's good enough for me.

I highly recommend Carrd.co if you need to quickly set up a good looking page. It saved me a lot of money, time and was an overall good experience. 

If you like the idea as much as I do, [try carrd using this link][1] or use my referral code at checkout `82DXK6L9`. (I get a small commission from that). Be sure to follow me on twitter [@horosinov](https://twitter.com/horosinov) and check out my blog [horosin.com](https://horosin.com).

*Disclaimer: I am not affiliated with Carrd in any way other than joining the open referral program.*

[1]: https://try.carrd.co/82dxk6l9
I need help!!
Published: 2022-04-07 21:39:50

****When I create an app with `npx react native init ...` and then I start to download all the requerid dependencies od react native. But, suddenly, when I write `yarn add react-native-gesture-handler`, my app crashes


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

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

This is my package.json:

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

**I´M DESPERATE...!! I CAN´T DO NOTHING. ¡¡PLEASE HELP ME!!**