teleren/devto huggingface dataset:
PHP fopen() function
Tags: php, programming, tutorial
Published: 2021-07-31 19:17:54

Before we can read, modify or delete the contents of the files, we need to `open` them in PHP. This opening process should not be understood in the sense of reading. Before starting the necessary operations, it means to open the file in the sense of providing the first access and connection.

We will do this access with the `fopen()` function. This function works with `two parameters`. In the first parameter, we enter the file path that we will access, and in the second parameter, we enter the mode that will indicate what we are accessing the file for.

There are 8 modes to specify what we want to enter the files for. Let's write in the table with their explanations:

| Mode |                                                 Description                                                 |
|:----:|:-----------------------------------------------------------------------------------------------------------:|
|   r  | Opens the file for reading. (read)                                                                          |
|  r+  | Opens the file for both reading and writing. (read)                                                         |
|   w  | Opens the file for writing. Deletes existing content (write)                                                |
|  w+  | Opens the file for both writing and reading. Deletes existing content, rewrites it. (write)                 |
|   a  | Opens the file for writing. Does not delete existing content, adds it to the end. (append)                  |
|  a+  | Opens the file for both writing and reading. Does not delete existing content, adds it to the end. (append) |
|   x  | Creates the file and opens it for writing. Returns `FALSE` if the file already exists.                      |
|  x+  | Creates the file, opens it for writing and reading. Returns `FALSE` if the file already exists.             |

Now, with these above file modes, we can treat how we want for the file.

After performing the necessary operations with the files, we must not forget to close them. If we do not close it, we may encounter problems accessing the next file. We will use the `fclose()` function to close the files.

This function works with a parameter and `closes the file` we opened. We write the variable of the file we opened with `fopen` in its parameter.

```php
<?php
$file = fopen('hello.txt', 'r');
fclose($file);
```

In the above example, we opened the `hello.txt` file for reading and provided the first access, and then closed it immediately. Do not think that we reach the content just by providing access. After providing the connection, we will perform the necessary operations using other read and write functions.

Follow my blog for more [baransel.dev](https://baransel.dev/).
Día 1 de Proyecto.
Published: 2021-07-31 18:59:27

Nos reunimos con el grupo asignado para poner las tareas que se pueden realizar en este momento para avanzar en el proyecto. Entre las tareas principales, se encuentran tasks que se pueden resolver en la gramática.

Un reto, considero yo, es que vamos a considerar la interfaz gráfica en este primer sprint también. Entiendo por qué, pero no creo que sea la mejor idea hacer algo muy elegante, quizás realizar un CLI de momento.

El [repositorio](https://github.com/RodrigoZea/Lab00DDC) de momento será el mismo que el laboratorio 0, ya que tiene la base del proyecto. 

---

De momento, ya se cuenta con precedencia de operadores y se arreglaron las excepciones que se presentaban con algunos programas de prueba que el catedrático subió a Canvas.
Ezcli - Minimal Package for Creating CLI apps.
Tags: go, cli, package
Published: 2021-07-31 18:48:55

## What is Ezcli?

Ezcli is a Go package for building CLI tools easily.

## Installation

- Initialize your project with `go mod init <name>`
- Get Ezcli with `go get github.com/5elenay/ezcli`

## API Reference

Click [here](https://pkg.go.dev/github.com/5elenay/ezcli) for API reference. (pkg.go.dev sometime does not update package version, so use `https://pkg.go.dev/github.com/5elenay/ezcli@<latest version>` for get the API reference for latest version.)

## Source Code
Click [here](https://github.com/5elenay/ezcli) for source code.

## Example

Simple example for Ezcli.

```go
package main

import (
    "fmt"

    "github.com/5elenay/ezcli"
)

func main() {
    handler := ezcli.CreateHandler() // Create handle function also gives built-in help command. So you dont need to write a help command yourself.

    // Adding a new command.
    handler.AddCommand(&ezcli.Command{
        Name:        "hello", // Command name.
        Description: "Say hello world!", // Command description.
        Options: []*ezcli.CommandOption{ // Command options (example: -force, -confirm etc...).
            {
                Name:        "test", // Option name.
                Description: "A test command", // Option description.
            },
        },
        Execute: func(c *ezcli.Command) { // The function will run.
            fmt.Println("Hello Command!")
        },
    })

    handler.Handle() // Handle commands.
}

```

Now lets compile our app with `go build .`

Time to test our app! Run the compiled app with `./<name> help`

You should get the following result:

```bash
List of all commands. For more information, add a command name parameter to command.
  help | Built-in help command for application.
  hello | Say hello world!
```

Lets test our `hello` command with `./<name> hello`:

```
Hello Command!
```

Congrats, you created your first app with Ezcli!

## Contribution
Found Bug? Issue? Please report at [here](https://github.com/5elenay/ezcli/issues). Or if you want to improve ezcli:
- Fork the project from GitHub.
- Make commits.
- Open a pull-request and wait.
Gnome Boxes
Published: 2021-07-31 18:37:27

Gnome Boxes

I have been using the oracle virtualbox since a long time it was slow and had to configure heavily.
I just found out i had the Gnome boxes on my host computer fedora .
Gnome boxes is simple fast, minimalistic.
![Boxes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ct3r1oev34cvnan18zt4.png)
I have installed Antix linux as one of the boxes and after using it for a while it simple fast and responsive 
But in Boxes i cannot find options about increasing the display size that was the disadvantage.

![Boxes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76trbex9amlur4rre91i.png)
Add Social Login in Laravel With Socialite
Tags: laravel, php, mysql
Published: 2021-07-31 18:26:35

Social login is now an essential part of any site which performs user authentication. It saves the users a lot of time, as they won't need to fill the whole form. They just sign up with their social account and next time they can log into the website with a single click.

Using social media accounts to sign up for websites is common nowadays and preferred by users because they don't have to remember a password every time they log in to a website. Even though social signup is easy, you can also inadvertently end up with a bunch of very confused users in an app.

Login with social accounts is a straightforward process and simultaneously enhances the user experience; nowadays, everybody knows a better user experience is the key to any digital product's success.

### What is Laravel Socialite?
Laravel Socialite  is a package developed to abstract away any social authentication complexities and boilerplate code into a fluent and expressive interface.

Socialite only supports Google, Facebook, Twitter, Linked In, Github, and Bitbucket as OAuth providers. They won't be adding any others to the list, however, there's a community-driven collection called  Socialite Providers , which contains plenty of unofficial providers for Socialite.

In this tutorial, we are going to add Social Authentication to a Laravel app through  Socialite , an official Laravel package that makes adding social authentication to a Laravel app.

If you want to manage your VPS / VM Server without touching command line go and [Checkout this link](app.serveravatar.com/?affiliate_code=techvblogs&key=dCy9DLa6). ServerAvatar allows you to quickly set up WordPress or Custom PHP websites on VPS / VM in  matter of minutes.  You can host multiple websites on a single VPS / VM, configure SSL certificates, and monitor the health of your server  without ever touching the command line interface .

[Read More](https://techvblogs.com/blog/social-login-laravel-socialite)
How to write a Simple Proxy Server in Python With Just 17 Lines of Code

Published: 2021-07-31 18:22:34

It’s super easy to build a rudimentary proxy server with Python. The trick lies in using the right modules.

Today we will use the SocketServer and the SimpleHTTPServer modules to listen for incoming requests and the URL lib module to fetch the target web pages.

https://youtu.be/kqtBfP3NneM
Disable Page Pulling
Tags: javascript, css, webdev
Published: 2021-07-31 18:18:56

In case anyone else finds the ability to "pull" your page down or right exposing whitespace that is not actually there...

https://developers.google.com/web/updates/2017/11/overscroll-behavior

Hope this helps someone else from having to search around for a solution!
 
```javascript
* {
   overscroll-behavior: none;
}
```
🔥 Learning with the code of other devs 🔥
Tags: webdesign, uidesign, coders, developers
Published: 2021-07-31 17:53:57

Let's go, understand the code watching other dev [Codepen.io.](https://www.codepen.io)


Is a collaborative platform for programmers and developers, this programmers your code for public access and other devs have access to the code.


These devs with access to code, understand how its works, and reuse all features it has the code block that runs certain functionality, generally the code focus is a web design, web interactions, animations that can inspire you to learn new methods of build code.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8gxzq27149tlyiqn7m0f.PNG)


You can also post your codes for other people to find and looking code and testing these codes and run them on your websites

At this moment, the people talk, WOW, like this code and your code it's going to be for everyone, your collaborate with a person that probably  its start but does not understand how to work with the language, specifically CSS, JS, HTML

There form differences to work whit the language as it the utilization of preprocessors for automatically code generate or include work with frameworks as react with the JSX syntax. Now is compatible with the codepen online editor and are add frequently new functionalities.

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

 

An online code editor is a great option for Jr. Developers because they don't need to install a tool in their local computer, only need an internet connection and foundation in the language to start coding.

Remember, don't copy and paste code if you don't understand the main functionality.

(I learning English, sorry for my grammar)
Começando o Projeto Atlas
Published: 2021-07-31 17:44:18

A vida tem desses revés que jogam a gente no chapisco, então eu resolvi que preciso encontrar novamente meu caminho, então vou (re)começar usando as redes sociais, incentivada por colegas e amigos.
Resolvi começar pela rede mais nova que tem poucos profissionais falando este tipo de conteúdo que eu trabalho durante 8 anos, a Twitch, pra até ter um progresso das ideias e também conseguir montar um bom portifólio.

Montando o esquema para as primeiras lives, o primeiro quadro nesta rede será uma expansão do famoso "Atlas Geográfico Escolar" que a gente vê na escola, pois vejo que fica só por aí o conhecimento do uso de mapas, embora já esteja mais difundido o uso de mapas para aplicativos.

Como eu preciso de um conjunto de coordenadas e de materiais, escolhi por sorteio offline, usando o arquivo gerado da tabela do SIDRA-IBGE 1552, adaptado só com os códigos de Município https://sidra.ibge.gov.br/tabela/1552.

Usei este código em Python, usando ambiente Jupyter no Anaconda:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random

arquivo = open('tabela15.csv','r')

for linha in arquivo:
    valores = linha.split(',')        
    escolhido =random.choice(valores)
    print (escolhido)
arquivo.close()

E o escolhido foi 2208007 - Picos (PI) https://t.co/I8jCodGKsf?amp=1. Caso não se tenha muitas informações sobre este Município na Internet, a intenção é ir montando materiais com o que se tem, pra ter uma base para outros Municípios.

É um começo, só.
Introduction of Snowflake data warehouse for cloud | Many Data Workloads, One Platform
Tags: bigdata, snowflake, cloudcomputing, database
Published: 2021-07-31 17:41:43

Available on all three major clouds, Snowflake supports a wide range of workloads, such as data warehousing, data lakes, and data science. Snowflake delivers: One platform, one copy of data, many workloads. Secure and governed access to all data.

Learn more about snowflake architecture


{% youtube PyAx0K1KLGE%}
Create an Array with the Keys of an Interface
Tags: typescript, keyof, cleancode, typesafety
Published: 2021-07-31 17:35:25

[The `keyof` Type operator](https://www.typescriptlang.org/docs/handbook/2/keyof-types.html) is a pretty straight forward to to so. It kind of like does to an `interface` the what [`Object.keys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) does to an object.

In the example below, `P` can be either `'x'` or `'y'`. 
```typescript
type Point = { x: number; y: number };
type P = keyof Point;
```

The example below will throw an error because `'prop4'` is not a property of `MyObject`. [Try it here](https://www.typescriptlang.org/play?ssl=11&ssc=1&pln=10&pc=2#code/JYOwLgpgTgZghgYwgAgLIE8DyAjAVhBMZAbwFgAoZK5ABygHsaBGALmQGcwpQBzAbgrVaDGgCY2nbiH6DqdRgGYA-BK68B5AL4UKCeiE7IAtljwEwbDDnyFkAXhKyq85mwDkLpgDU4AGwCuEG4ANE7CjOLIHiKiPgFBoVo65GDoNCgA0vbIABQA1hDo9DBopjZgAJQauvqG7PRGEJgwVmaEGYXsbBkA2gC62T3RjEwhUS4KY8M0ACxufdXkQA).
```typescript
interface MyObject {
    prop1: string;
    prop2: string;
    prop3?: string;
}

const myObject: MyObject = {
    prop1: 'prop1Value',
    prop2: 'prop2Value',
}

type K = keyof MyObject;

const someOfMyObjectKeys: K[] = ['prop1', 'prop3', 'prop4'];
```
If you don't want to explicitly create a type just for that, you can use parenthesis. It's going to look like this:
```typescript
const someOfMyObjectKeys: (keyof MyObject)[] = ['prop1', 'prop3', 'prop4'];
```
That's it. I hope that helps!
Absurd Job Listings pls
Tags: help, jokes, podcast, hiring
Published: 2021-07-31 17:16:23

On Council Of The Wise Developers, we play a game in some episodes where given a quote, we try to guess its origins.

In the past we've done:

- Quote from a Tech Entrepreneur or Cult leader
- Quote from a Tech Leader or Cult Leader

We'll soon release:

- Pitch from a Coding School or Real Estate Investing Program?

In a future episode, we'll play a game where some of the quotes will be from RIDICULOUS JOB DESCRIPTIONS. 

So could you help us out? Can you link to absurd language or ridiculous requirements in a tech job listing? If your link is indeed absurd, it will likely be part of a future episode!

Podcast page ->

https://rss.com/podcasts/councilofthewisedevelopers/
Release 1.56 of perl-workflow, a bug fix release
Tags: perl, opensource, release
Published: 2021-07-29 17:50:24

---
title: Release 1.56 of perl-workflow, a bug fix release
published: true
description: the last bug fix release of 1.X?
tags: perl, opensource, release
//cover_image: https://direct_url_to_image.jpg
---
With release 1.55 we unfortunately introduced a minor bug as observed by the [OpenXPKI](https://www.openxpki.org/) project.

A _workaround_ was implemented and due to fast feedback we where able to get the issue pin-pointed for correction. The only issue delaying this important bug fix release was summer holidays, but we have just shipped and we are now focusing our attention to our upcoming 2.0 release.

This change in focus will mean that we will only be making bug fix releases to the 1.X branch. Since we are doing _trunk_ based development, the _master_ branch is currently considered unstable, installations and use should be based on official releases.

We still have some way to go before the first pre-release of 2.0 will be uploaded to CPAN, but I am confident that it will be completed within the next weeks, since holiday season is good to open source.

- The [2.0 milestone is documented here](https://github.com/jonasbn/perl-workflow/milestone/14), as in a list of PRs and issues
- And the [2.0 projected road map is documented here](https://github.com/jonasbn/perl-workflow/projects/1) as a set of notes and issues.

Here follows the change log of release 1.56.

## Change Log

The original is [available on GitHub](https://github.com/jonasbn/perl-workflow/releases/tag/1.56)

## 1.56 2021-07-28 Bug fix release, update recommended

- PR [#139](https://github.com/jonasbn/perl-workflow/pull/139) addresses an issue introduced in 1.55, where action configurations would contain unnecessary information

- Elimination of global state, with improved abstraction the complexity could be removed via PR [#140](https://github.com/jonasbn/perl-workflow/pull/140)

- PR [#141](https://github.com/jonasbn/perl-workflow/pull/141) improves test suite, following up on PR [#131](https://github.com/jonasbn/perl-workflow/pull/131)

- PR [#132](https://github.com/jonasbn/perl-workflow/pull/132) follows up on issue [#129](https://github.com/jonasbn/perl-workflow/issues/129) by improving documentation on group property of Workflow::Action

- Elimination of warning about undefined value, which surfaced with release 1.55, adressed with PR [#135](https://github.com/jonasbn/perl-workflow/pull/135)

- PR [#131](https://github.com/jonasbn/perl-workflow/pull/131) documents the importance of overriding `init` for processing of parameters and not using `new`

- PR [#130](https://github.com/jonasbn/perl-workflow/pull/130) addresses issue [#129](https://github.com/jonasbn/perl-workflow/issues/129), respects encapsulation by adhering to the API

- Improves some error and log messages via PR [#128](https://github.com/jonasbn/perl-workflow/pull/128)
PASS GENNY - Design/dev challenge #1
Tags: showdev, watercooler
Published: 2021-07-31 15:41:40

### Hey there!!

I'm starting to learn a bit more about design, and wanted to do some challenges to put into practice what I'm learning.

In the first challenge I had to design and code a password generator.

You can check it [here](https://pass-genny.vercel.app/)

**Or take a look on github:**

{% github nombrekeff/pass-genny %}

## Challenge description

Make a password generator **Design + Code** in 2 days or less.

### Design
Design was made in 4-6h in Figma, did not track the time very well.

You can check the Figma file [here](https://www.figma.com/file/UqKfdepVu3H9cD9EYRuNNJ/pass-genny?node-id=0%3A1)

### Code
Code related stuff was done in around 4h, code + setting up repo, deploying to vercel.

### Tech
For the website I used:
* [Svelte](https://svelte.dev/), + [svelte-routing](https://github.com/EmilTholin/svelte-routing)
* [Tilt.js](https://github.com/gijsroge/tilt.js)

Otherwise everything else is done by me :)

### I will be glad if you critique it, give me advice or overwall feedback! :smile:

Have a nice day!
How to get Tailwind Intellisense anywhere
Tags: tailwindcss, vscode, webdev, css
Published: 2021-07-31 15:28:28

As I was evaluating tailwind I there was one thing that pushed me over the edge -- **intellisense**.
The speed that I can go writing styles for my components, it was bliss. Though once I used other libraries like
[clsx](https://github.com/lukeed/clsx) or [HeadlessUI](https://headlessui.dev/) I kinda got annoyed by the lack of intellisense. It wasn't _that_ bad, but enough to bug me.

For example HeadlessUI's Transition component:

![HeadlessUI Without Intellisense](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7oi0bxgcl2q3gspjunqa.png)

Or the clsx library:

![clsx Without Intellisense](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3mkinhfs2f9j63ct7fy.png)

so the question is:

## How to get intellisense?

Luckily after some searching I found out how.

First go open your workspace settings.

![Command Palette](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/meu4gzj2x9q94vbiig2m.png)

This will create a `settings.json` file under a `.vscode` folder if you don't already have one. You can define rules within it. The one we're interested about is `tailwindCSS.experimental.classRegex`.

In this we define an array of arrays containing regex to match a pattern.

For example using the clsx library:

```json
{
  "tailwindCSS.experimental.classRegex": [
    ["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
  ]
}
```

Let's review what happened there.

The first item in the array is an expression to the match **container**, and the second expression is to match the **class lists**.

![Container and Class Lists](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0ffefpx39m82783b3yh.png)

**NOTE: Both expressions must contain only one capture group.**

---

If you only have a single class list like the HeadlessUI example, you can specify a single regular expression.

```json
{
  "tailwindCSS.experimental.classRegex": [
    "(?:enter|leave)(?:From|To)?=\\s*(?:\"|')([^(?:\"|')]*)"
  ]
}
```

You can also use multiple expressions for different contexts

```json
{
  "tailwindCSS.experimental.classRegex": [
    ["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"],
    "(?:enter|leave)(?:From|To)?=\\s*(?:\"|')([^(?:\"|')]*)"
  ]
}
```

---

I know, **regex is hard**, so heres a repo containing multiple use cases.
https://github.com/paolotiu/tailwind-regex-list

I encourage you to contribute if there are any other use cases that haven't been listed.
Thank you :)

---

### Links:

- [Regex List Repo](https://github.com/paolotiu/tailwind-regex-list)
- [Related Issue](https://github.com/tailwindlabs/tailwindcss-intellisense/issues/129)

---
DML : Document Makeup Library has all the potential to become the next JQuery
Tags: dml
Published: 2021-07-31 15:25:19

If we don't need JQuery anymore, which library could be as useful as JQuery in Front End development ?

I think [DML](https://efpage.de/DML/DML_homepage/index.html) could be this one. In fact, even DML is not a framework, it could replace some famous among them.

Here a post : [DML - "one language to rule them all"](https://dev.to/efpage/introduction-to-the-document-makeup-library-dml-1aak) from the author Eckehard a very nice guy :-)

I have posted several articles on Dev to, you can seem them here [DML-Devto](https://dev.to/search?q=dml%20%2B%20artydev)

Give it a try, and tell what you think :-)