teleren/devto huggingface dataset:
Laravel 10 new features
Tags: php, laravel, testing, webdev
Published: 2023-02-15 17:00:17

Finally Laravel 10 is released. It requires PHP >= 8.1. Most of the features are added by the core Laravel team and not the other contributors and it seems that there is not a big changes compared previous version releases. Lets have a glance. 


## New Type Hinting Model

Nuno Maduro, creator of [Pest](https://github.com/pestphp/pest) has added new PHP style of type hinting and removed old way of dock-block in all stubs and maybe codebase. It seems that the change has not a sensible different for end-users :)
```
/**
* Display a listing of the resource.
*/
public function index(): Response
{
    // ...
}
```

## Features with Pennant

Another core member of Laravel, named [Tim MacDonald](https://github.com/timacdonald) has developed a new package named Pennant that makes it easy to publish specific features for specific users. consider a situation that you have added a new feature and you want to test it on a small chunk of users. the package has introduced a convenient way for that.

```
use Laravel\Pennant\Feature;
use Illuminate\Support\Lottery;
 
Feature::define('new-onboarding-flow', function () {
    return Lottery::odds(1, 10);
});
```

## Process Interaction in a simple way

This feature is a little bit funny. I have experience working with the commands line `exec` which we can run a program in OS's shell with PHP like `ls -a`. With this new feature, you can run this kind of command with a better coding interface:
```
use Illuminate\Support\Facades\Process;
 
$result = Process::run('ls -la');
 
return $result->output();
```

## Profile tests

If your tests take too much to be ended (like me:)) try this feature. It profiles your tests and reports the execution time which makes it easy to find slow tests.
```
php artisan test --profile
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e72gtpr9744qtjne6gw3.png)

## Use Pest for testing
If you prefer the Pest PHP testing format for writing your tests, Now it is built in on Laravel and you can use it easily.

## Command CLI prompts
This feature prompts the user to complete the command if it was not complete. For example, if you run a command like this:
```
php artisan make:controller
```
It asks you the name of controller. We can accept it from [Jess](https://github.com/jessarcher) :)

## Better Horizon and Telescope
Finally if you are a fan of one of the above tools, there is a little bit face lift on them. 

Overall, I think the changes were not big but that is the open-source world and we have to thank the contributors for their efforts. If you want a new thing, go and write it :) Have a good time.
I wrote a book about the command line!
Tags: commandline, cli, linux
Published: 2023-02-15 17:00:00

---
title: I wrote a book about the command line!
published: true
description: 
tags: commandline,cli,linux
cover_image: https://gcdnb.pbrd.co/images/ZVxtfQxtkJRs.png?o=1
# Use a ratio of 100:42 for best results.
published_at: 2023-02-15 17:00 +0000
---

The Linux command line and the use of shells like Bash or Zsh can be used to control your operating system, improve your development environment with command-line tools, setup CI pipelines and also to interact with remote machines or Docker containers.

If you are a software developer without knowledge of the command line and the popular shells, you are missing out. I know I was!

That's why I wrote a short and to-the-point ebook on the most essential knowledge that will take your skills to the next level! 

My book Command Line: A Modern Introduction is a culmination of more than two years of research, writing, and rewriting on topics like:

- Shells and terminals
- Bash and Zsh
- Running Commands
- Shell Shortcuts
- Getting Help
- Configuration
- Search
- Text Data Wrangling
- SSH and SCP
- The best command-line tools
- Shell scripts
- and many more!

You will get a beautiful PDF with almost 100 syntax-highlighted and annotated shell sessions and other code examples. If this book doesn't change the way you interact with the command line, nothing will!

[Get the book on Gumroad](https://stribny.gumroad.com/l/moderncommandline)

You can also [start reading](https://drive.google.com/file/d/1ks6uC0J4NpHpA1xP72Gyh2YbAOGApwDC/view) now and decide if it could be for you :)
Scope Visibility of State Variables in Solidity
Tags: web3, blockchain, ethereum, solidity
Published: 2023-02-15 16:59:05

>Public variables can be accessed internally and via messages, while internal variables can only be accessed internally. Private variables are not visible to other contracts

Scope of local variables is limited to the function in which they are defined but State variables can have three types of scopes.

- Public − Public state variables can be accessed internally as well as via messages. For a public state variable, an automatic getter function is generated.

- Internal − Internal state variables can be accessed only internally from the current contract or contract deriving from it without using this.

- Private − Private state variables can be accessed only internally from the current contract; they are defined not in the derived contract from it.

In Solidity, local variables have a scope that is confined to the function in which they are defined, whereas state variables might have three different scopes.

- Public - State variables that are accessible both internally and through messages are known as public state variables. An automatic getter method is built for a public state variable when the variable is declared.

- Internal - Internal state variables can only be accessible internally from the current contract or a contract originating from it, and they cannot be accessed externally from any other contract.

- Private -Private state variables can only be accessed internally from the current contract in which they are defined, not from the contract derived from it. They are not accessible from any other contract.

Global Variables are Special variables that exist in the global namespace used to get certain information about the blockchain.

**Important:**

Solidity is a statically typed programming language, which means that the type of the state or local variable must be defined at the time of declaration. Every defined variable has a default value that is determined by the type of the variable. There is no such thing as a "undefined" or a "null."

##Variables in Solidity:
```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Variables {
    // State variables are stored on the blockchain.
    string public text = "Hello World";
    uint public num = 69;

    function simpleFunc() public {
        // Local variables are not saved to the blockchain.
        uint i = 619;

        // Here are some global variables
        uint timestamp = block.timestamp;//Current block timestamp
        address sender = msg.sender; // address of the caller
    }
} 
```
For more content, follow me at - https://linktr.ee/shlokkumar2303
CodePen Designs - 38 : Exhibition
Tags: codepen, css, design, webdev
Published: 2023-02-15 16:56:00

### We are excited to introduce our new series that will explore the best design ideas from the Codepen community. 

We will be publishing these each day and hope you find them insightful and inspiring as we showcase some of the most talented designers in this space.

---
---

## Video Tutorial

Don't miss the amazing video we've embedded in this post! Click the play button to be inspired

{% youtube  p6t7Iprd-38 %}

---

---

### Codepen Design - 38

<p>Based on a very cool <a href="https://twitter.com/zozuar/status/1621229990267310081">tweet</a>, this shader presents six possible variations of the code presented in it in a kind of digital showroom. Just take a seat and sit back.</p>

{% codepen https://codepen.io/atzedent/pen/GRXKxVL %}



---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

5. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)


---
---
Movies for/about coders and such
Tags: movies, series, tv
Published: 2023-02-15 16:51:56

---
title: Movies for/about coders and such
published: true
description: Some of our favourite movies/series about people like us
tags: movies, series, tv
# cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2ij1kvs6i0jies19wb7.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-02-15 15:40 +0000
---

Hi everyone! 

Let's share our **favourite** movies/series about tech, coders, hackers and such. In other words, people like us. I'll start :) 

Here is my unordered list:

## The Gamechangers
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t1oth849raiw4nevlrv.jpg)
https://www.imdb.com/title/tt4590930/

I'd say it's the best movie of Daniel Radcliffe so far, on par with Guns Akimbo. From a dream to big money and big responsibilities. 

## Mr. Robot
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2ij1kvs6i0jies19wb7.jpg)
https://www.imdb.com/title/tt4158110/?ref_=fn_al_tt_1

What I loved is while being extremely fictionalised and far from reality technically speaking it is very atmospheric and inspiring in a way. Plus the story twist is super good. 

## Silicon Valley 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ch1khit94f57ybmy1tll.jpg)
https://www.imdb.com/title/tt2575988/

This one shows the eternal struggle and ups and downs of a tech startup. As I understand it's a comedy but the main character stress is something any founder can relate. 

## The Billion Dollar Code
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lisn3p9cxiiigug1f8vb.jpg)
https://www.imdb.com/title/tt15392100/?ref_=fn_al_tt_1

A typical story but the ay it is filmed and dramatised makes the characters very relatable, although the story is known and the ending is not a mystery it made me feeling and rooting for them anyway. On top of that the atmosphere of Berlin is shown in it's full glory!

Which one did you *really liked*? Please share 🙌
Auto-colorize Google Docs
Tags: javascript, macros, googledocs, wordprocessing
Published: 2023-02-15 14:20:48

Formatting options in Google Docs are limited. And that's good because formatting can be a lot of manual work (e.g. in Microsoft Word). But sometimes it would be nice to have some fine-grained auto-formatting feature like coloring a certain word if it occurs in the text. 

Luckily there is Google Apps Script. You can apply some JavaScript code to your documents very easily, like for example to color some words selected with a Regular Expression:

```js
function colorText() {
  var doc = DocumentApp.getActiveDocument();
  var body = doc.getBody();
  var paragraphs = body.getParagraphs();

  for (var i = 0; i < paragraphs.length; i++) {
    var searchResult = paragraphs[i].findText('^.*\:');

    if (searchResult) {
      var startIndex = searchResult.getStartOffset();
      var endIndex = searchResult.getEndOffsetInclusive();

      searchResult.getElement().asText().setForegroundColor(
        startIndex, endIndex, '#571f4e'
      );
    }
  }
}
```
Using Components in 'Circle' React template
Tags: react, template, webdev, javascript
Published: 2023-02-15 15:54:03

Using 'Icon Card' component ->

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

[Free Download](https://github.com/Unmaad-Studio/Circle-React-Theme)
[Preview](https://circle-theme-app-unjsb.ondigitalocean.app/)
ChatGPT API Connector: Learn how to integrate OpenAI's GPT-3 API into your workflows.
Tags: chatgpt, api, openai, ipaas
Published: 2023-02-15 15:53:12

The ChatGPT API Connector webinar is right around the corner: **Thursday, February 16th, 5:00 PM CET.** Here's what you can expect:

-The amazing Dave Pemberton will be developing a Generative AI business use case live, using our ChatGPT API Connector!

-We are going to discuss the use of generative AI, such as ChatGPT, and how it can augment human capabilities.

-You are going to have the opportunity to participate in a puzzle challenge and come up with your own innovative solutions using generative AI and much more.

**This event is free and open to everyone**, so book your spot now: https://groups.softwareag.com/e/m8q696/ Once you register, don’t forget to add the event to your calendar.

See you there 😊
Contains Duplicate
Tags: leetcode, beginners, algorithms, javascript
Published: 2023-02-15 15:50:27

Second day posting about [Blind 75 LeetCode Questions.](https://leetcode.com/discuss/general-discussion/460599/blind-75-leetcode-questions)

Today i will be solving the [Contains Duplicate problem](https://leetcode.com/problems/contains-duplicate/).

Let`s set up the problem first.

We are being asked to return true if the value of an array appears at least twice and return false if every element is distinct.

We will start by defining a variable creating a new Map()

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

Next we are going to create a for loop to iterate over the array given.
The next line we are going to check in the if statement if the array has "nums[i]" which is the array given when looping over it and it will return true if it is true the statement given.
And then an else statement that will set to the "arr", "nums[i]" and "true" as follows.
And Finally return a "false" in case of otherwise.

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

Thanks, i will be uploading every day.
Hope someone found it useful.

Lautaro.
Getting started with graphQL subscriptions
Published: 2023-06-12 17:15:01

---
title: Getting started with graphQL subscriptions
published: true
date: 2023-02-15 14:15:39 UTC
tags: 
canonical_url: 
---

GraphQL is a powerful and flexible query language for APIs that allows clients to specify exactly what data they need. One of the lesser-known features of GraphQL is subscriptions, which allow for real-time updates to be pushed from the server to the client.

Here's an example of how you can set up a GraphQL subscription using the `subscription` type in your schema:

```
type Subscription {
  newMessage(roomId: ID!): Message!
    @resolve(fn: "newMessageResolver")
}

type Message {
  id: ID!
  text: String!
  room: Room!
}

type Room {
  id: ID!
  name: String!
}

```

In this example, the `newMessage` subscription is defined as a field on the `Subscription` type. It takes a single argument, `roomId`, and returns a `Message` type. The `@resolve` directive is used to specify the function that will be used to resolve the subscription.

To actually subscribe to the `newMessage` subscription, you can use a GraphQL client library, such as Apollo Client or Relay, to open a websocket connection to the server and send a subscription query. Here's an example using Apollo Client:

```
const subscription = gql`
  subscription newMessage($roomId: ID!) {
    newMessage(roomId: $roomId) {
      id
      text
      room {
        id
        name
      }
    }
  }
`;

const observer = client.subscribe({
  query: subscription,
  variables: { roomId: "123" }
});

observer.subscribe({
  next: data => console.log(data)
});

```

With this code, the client will open a websocket connection to the server and subscribe to the `newMessage` subscription, passing the `roomId` variable as an argument. The server will push new messages to the client in real-time as they become available, and the `next` callback will be called with the updated data.

In conclusion, GraphQL subscriptions allow for real-time updates to be pushed from the server to the client, making it easy to build dynamic and responsive web applications. Whether you're building a chat app, a real-time dashboard, or any other type of application that requires real-time updates, GraphQL subscriptions are a great tool to have in your toolbox.
How Developers should take advantage of MindsDB's Integration with OpenAI Chat GPT-3
Tags: mindsdb, nlp, openai, gpt3
Published: 2023-02-15 15:22:28

As a developer, you look for new ways to minimize the amount of work you have to do in order to get your desired results. Traditional ML development pipelines and methods can be helpful, but you are searching for faster ways to subsume NLP capabilities that require less manual development work. So how do you harness the full capabilities of NLP? By using MindsDB's integration with OpenAI Chat GPT-3 which allows you as a developer to unlock the power of the large pre-trained language models from OpenAI effectively.

Developers face the challenge of creating models that can answer questions with or without context and completing general prompts, and with the capacity of the NLP models it can be done smoothly.MindsDB's integration with OpenAI Chat GPT-3 and databases allows you to use the power of SQL to effortlessly extract insights from text data.

Here are a few ways you can leverage the NLP Capabilities with MindsDB:

- You will now be able to create models that can help your clients in the e-commerce,social media,customer service industry by using sentiment analysis to detect the emotion behind their customers’ reviews or requests for a product or service easily.

- Being able to create models that can answer questions can help alleviate the heavy workload the customer service industry experiences and assist e-commerce companies' websites to have a point of communication where their customers could ask questions and immediately receive answers. You can also create models for educational purposes that allow users to ask questions about learning material and receive an answer without having to engage with a teacher/lecturer.

- Using text summarization cuts down the time spent trying to read paragraphs of information and provides the main points that are important and relevant to the person who needs to receive the information.

>*MindsDB was ranked 2nd Product of the Day on Product Hunt for their product launch for the MindsDB- OpenAI Chat GPT-3 integration*

With the In-Database and NLP capabilities,MindsDB provides a great opportunity for developers to simplify their own workload in delivering services to their clients. You can check out the MindsDB integration with OpenAI Chat GPT-3's documentation about NLP [here](https://docs.mindsdb.com/nlp/text-summarization-inside-mysql-with-openai) and check out their examples.

If you would like to find out more about MindsDB, you can visit their [website](https://mindsdb.com/).Feel free to bookmark MindsDB's [Github repository](https://github.com/mindsdb/mindsdb) and give them a star.Engage with the MindsDB community on [Slack](https://mindsdb.com/joincommunity) or [GitHub](https://github.com/mindsdb/mindsdb) to ask questions and share your ideas and thoughts.

*Twitter* : [Chandre Van Der Westhuizen](https://twitter.com/Chan_vdw)
*Github page* : [Chandrevdw31](https://github.com/chandrevdw31)
Paracetamol.ts💊| #12: Explica este código TypeScript
Tags: typescript, webdev, spanish, programming
Published: 2023-02-15 15:20:50

## **<center>Explica este código TypeScript</center>**
#### <center>**Dificultad:** <mark>Básico</mark> </center>


```ts
function stringify123(callback: (num: number) => string):string {
  return callback(123);
}

console.log(stringify123(String));
```

- A. `"123"`
- B. `123`
- C. `ReferenceError`
- D. `Ninguna de las anteriores`

Respuesta en el primer comentario.

---
Book review: For the Love of Go by John Arundel
Tags: go, books, beginners
Published: 2023-02-15 15:17:51

Just in time for Valentine's Day, I'm reviewing, "For the Love of Go" by John Arundel. For the absolute beginner to programming, this book will get you started on the right foot.

{% youtube https://youtu.be/LDU4b5dc6qs %}
All Freelance Platforms
Tags: remot, job, hiring, freelance
Published: 2023-02-15 15:13:32

A year ago, while I was trying to find a remote job that would allow me to work from anywhere, I signed up for as many freelance platforms as I could find and, Today, I want to share the fruits of my labor with you.

These platforms helped me to find the right remote job from a third-world country and I hope they can help you too.

You can find all of them in my [Github repository](https://rebrand.ly/hz4y98p) but here are some of the sneak peaks

[4dayweek.io](http://4dayweek.io)
The place to find jobs with a better work-life balance

[Hired.com](http://Hired.com)
Vetted companies compete for you, reaching out with salary & equity upfront

[Arc.dev](Arc.dev)
No job applications. Speak directly to hiring managers

[Braintrust](usebraintrust.com)
Keep 100% of what you earn, control the network, and do the work you love

And many more can be found at https://rebrand.ly/hz4y98p
Difference between printenv and env
Tags: shell, beginners, bash, tutorial
Published: 2023-02-15 15:07:51

`printenv` and `env` are both commands in Linux shell that deal with environment variables, but they have different functionalities.

`printenv`is used to display the values of environment variables. When you run `printenv` followed by an environment variable name, it will display the value of that variable. For example, `printenv PATH` will display the value of the `PATH` environment variable.

On the other hand, env is used to set or unset environment variables. When you run env followed by an environment variable name and its value, it will set the variable to that value. For example, `env hello="Welcome ALX"` will set the `hello` environment variable to `"Welcome ALX"`.

Additionally, if you run `env` without any arguments, it will display a list of all the current environment variables and their values. This can be useful to see what environment variables are currently set.

So, `printenv` is used to display the values of environment variables, while `env` is used to set or unset environment variables, and can also be used to display a list of all current environment variables.