teleren/devto huggingface dataset:
SMS Notification in laravel using Nexmo/Vonage
Tags: laravel, php, programming, beginners
Published: 2023-01-28 16:51:57

**Hello Artisans,**

In the previous post we saw how we to send SMS notification using Twilio. If you are new to this post you can check my post on Twilio by the following the below link. {% embed https://dev.to/snehalkadwe/how-to-send-sms-notifications-in-laravel-using-twilio-5an %}


Sending SMS notifications in Laravel using nexmo (note: the nexmo is now Vonage), firstly we have to install the laravel/vonage-notification-channel and guzzlehttp/guzzle packages:

```php
composer require laravel/vonage-notification-channel guzzlehttp/guzzle
```

After installation you need to define VONAGE_KEY and VONAGE_SECRET environment variables in .env file to register your Vonage public and secret keys.

To access the Vonage public and secret keys you need to register on Vonage site. [Vonage](https://www.vonage.com/communications-apis/) and go to the Communication APIs login.

Now we need to define `VONAGE_SMS_FROM=your_phone_number` environment variable. This is the phone number is used to send SMS to the end user.

Create a new notification class using the `php artisan make:notification command`.

```php
php artisan make:notification SendSMS
```

In the newly created notification class, add a toVonage method. This method will contain the logic for sending the SMS using the Vonage package, it receives a $notifiable entity and should return an `Illuminate\Notifications\Messages\VonageMessage` instance.


```php
/**
 * Get the Vonage / SMS representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return \Illuminate\Notifications\Messages\VonageMessage
 */
public function toVonage($notifiable)
{

    $vonage = new Client(new Nexmo\Client\Credentials\Basic(env('VONAGE_KEY'), env('VONAGE_SECRET')));
    $message = $vonage->message()->send([
        'to' => $notifiable->phone_number,
        'from' => env('VONAGE_FROM'),
        'text' => 'Hello from Laravel!'
    ]);
    return $message;
}
```

To send the notification, you can use the Notification facade's send method and pass it the notifiable instance and the notification class.

```php
Notification::send($user, new SendSMS());
```

Now you can send SMS notification to the user.

**Note**: As stated above to use Vonage services, You need to config your Vonage account with phone numbers and other settings.


**Happy Reading**... :unicorn: :heart:
Latin x Python - 28/01/23
Tags: webdev, programming, latin, python
Published: 2023-01-28 16:51:54

So it's been almost a week since I started working on Latin is fun, a website whose ultimate aim is to help children around the world learn Latin in a fun way.
My aim for now though is to create a website which can easily generate questions like English-Latin, Latin-English or grammar questions (eg. what case a word is in).

---

Features I have added since Monday:
- I have completed the `noun_english_to_latin` function. So it can take in a word and convert it to English. The Latin word can be in any declension and it can convert to any case.
- I have started making the project into a website (using Flask)
- I have made an all nouns page (it shows all the nouns in the wordlist, and its latin nominative, genitive and declension)
- I have made a similar all verbs page, which shows all the verbs in the wordlist, its 4 forms, and its conjugation
- I have added 2 pages, one for converting verb from english to latin, and one for converting noun from english to latin
- The website contains some basic CSS (similar to the CSS on my portfolio website)

---

## Demo:
Main Page:
![main page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8p4h8r82k6wdfep6mwhx.png)

All Nouns Page:
![all nouns](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pcu9ptn6yev501pq3pic.png)

Convert Verb English to Latin Page:
![convert verb](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/afewz1fgf5mu1j1h5m3w.png)

---

Thanks for reading.
If you want to support me with this project, make sure to follow me and like this post!
If you have any suggestions, comment below.
Argumentos da Linha de Comandos
Published: 2023-01-28 16:33:19



## Definições
Argumentos de linha de comando são palavras após o nome do arquivo principal ou da aplicação e são armazenadas em uma lista que pode ser manipulada através de uma linguagem de programação.

Nas linguagens de programação, os argumentos são guardados num vector args de n elementos e por convenção, args[0] é o nome de arquivo do programa.
Um programa de linha de comandos lê cada argumento passado no terminal e faz um processamento de acordo as regras implementadas.

Os argumentos são delimitados por espaços em branco ou tabulação. Algumas aplicações usam flags(ex: --name) para ajudar na escrita dos argumentos passados.

## Exemplo de aplicações com argumentos CLI
- Windows: shutdown, taskkill, mkdir, ipconfig, tracert, dir;
- Linux: htop, grep, cp, pwd, cat, rmdir, mv, ls;
- Frameworks: dotnet, flask, ng;
- Gerenciadores de Pacotes: maven, npm, cargo, composer, mix;
- Compiladores: javac, gcc, cobc, python, go, php;
- Versionamento de Código: git, svn, subversion 
- Tunel de conexão: ngrok, localtunel, pagekite, teleconsole;
- Requisições: wget, curl;
- Rede: ssh, sftp, stp, ping
- Editores: vim, vi, nano;

## Observações:
Em linguagens como C, C++, Java, C# e Go, ao tentarmos compilar um programa sem uma função main, o compilador gera um erro.  Nessas linguagens a função main carrega explícita ou implicitamente todos os argumentos passados na chamada do programa pelo terminal.

## Exemplo
- Criação de uma aplicação para download de arquivos em servidores locais ou remotos. A aplicação permite listar os arquivos baixados e obter as informações do arquivo.
Liguagem: Go

Código Fonte
https://github.com/ortizdavid/go-downloader



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


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


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


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


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


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



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


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


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u1e1reyusnv196dg37po.png)
Next Export Is Broken / Doesn't Work With GH Pages?
Tags: nextjs
Published: 2023-01-28 16:27:37

---
title: Next Export Is Broken / Doesn't Work With GH Pages?
published: true
description: 
tags: nextjs
---


I built a website with next.js that works locally (code: https://github.com/xpress-smoke-shop/website).


I am now trying to deploy a static html version of the site to the domain: https://xpress-smoke-shop.github.io/website/

I can clone the repo and run these commands:

```
nvm use
yarn install
yarn build
yarn export
yarn deploy-gh
```

And I have changed the `next.config.js` file to reflect the repository that I'm using:

```javascript
/* eslint-disable import/no-extraneous-dependencies */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true',
});

module.exports = withBundleAnalyzer({
  poweredByHeader: false,
  trailingSlash: true,
  basePath: '/website',
  assetPrefix: '/website/',
  reactStrictMode: true,
});
```

But my deployed site still looks wrong and has all these file-not-found errors...

[![enter image description here][1]][1]


How do I get janky piece to deploy properly?? 😅


  [1]: https://i.stack.imgur.com/s73zy.png
JTable Color Header
Tags: java, swing
Published: 2023-01-28 16:12:39

A diferencia de las aplicaciones web, personalizar grillas (tablas) en Java Swing requiere de mucho más código. Pero podemos ayudarnos con clases utilitarias.

---

## 1) Original 

Consideremos este ejemplo:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8h450iqjxk20ikm51gut.png)
 
## 2) Column Group

Para agregar la capacidad de agrupar columnas, emplearemos una clase llamada _ColumnGroup_. Reconoce el título y las columnas que debe agrupar.

```java
ColumnGroup columnGroup = null;

int[] columns = {8,9};
columnGroup = new ColumnGroup("Precio Venta " + "S/.", columns);

UtilityTable.initSelectList(jTable, tableModel, ConstantsVentas.columnsList, 
columnGroup );
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6fuvftvufhujihqh9drw.png)

## 3) Color Header

También podemos cambiar el color de columnas específicas. Ello lo conseguimos indicando en la clase _FarmaColumnData_, el color de fondo.

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

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

---
## Documentación

https://docs.oracle.com/javase/tutorial/uiswing/components/table.html
https://github.com/edgargs/table-color-header.git
Add or Change a license on GitHub
Tags: github, opensource
Published: 2023-01-28 16:06:48

In this post, we will walk you through the steps of adding or modifying the license for your project on GitHub. Whether you're just getting started on a new project, or looking to make changes to an existing one, this guide will help you understand how to properly license your work on GitHub. From choosing the right license to adding it to your repository, we'll cover everything you need to know to ensure your project is properly licensed on GitHub. So let's dive in!

From the website [https://choosealicense.com/](https://choosealicense.com/) choose the license suitable for you and for your project.
In the website you can find all the information to choose the right one.

![choosealicense](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uaga3k8n09uafl4grnd6.png)

From your repository on GitHub, create a new file with the "**New File**" button on the top bar in the repo.
Name it "LICENSE.md" or "LICENSE.txt" and choose the right license from the license picker.

You can also paste the license from the website [https://choosealicense.com/](https://choosealicense.com/).

If a license is present in your repo, delete it and repeat this procedure after the deletion.

---

Are you interested in learning GitHub but don't know where to start? Try my course on LinkedIn Learning: [Learning GitHub](https://bit.ly/learninggithub).

![LinkedIn Learning](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdc2bpiftpadibi4h51c.gif)

---

Thanks for reading this post, I hope you found it interesting!

Feel free to follow me to get notified when new articles are out 🙂

{% embed https://dev.to/kasuken %}
Solidity Reference Types
Tags: web3, blockchain, solidity, ethereum
Published: 2023-01-28 16:02:46

It is possible to modify the values of reference types by using a variety of different names. This is in contrast to value types, where each time a value type variable is used, you get an independent duplicate of that variable. This necessitates the fact that reference types must be handled with greater care than value types. At the moment, reference types include structs, arrays, and maps, among other things. 

If you use a reference type, you must always explicitly specify the data area in which the type is stored: memory (whose lifetime is limited to the duration of an external function call), storage (the location where the state variables are stored, whose lifetime is limited to the duration of a contract), or calldata (the location where the type is stored) (special data location that contains the function arguments).

The automated copy process will always be triggered by an assignment or type conversion that changes the data location, whereas assignments inside the same data location will only copy in some situations, depending on the storage type.

 

## Data Locations:

Every reference type contains an additional descriptor, known as the "data location," that indicates where the data is kept. Memory, storage, and calldata are the three types of data storage available. Unlike memory, calldata is a static area that cannot be modified and is not persistent. It is used to store function arguments and acts in most ways like memory.

 

## Storage vs Memory vs Calldata:

When designing smart contracts in Solidity, it is important to be aware of how your variables and data are handled by the Ethereum Virtual Machine (EVM). The decisions you make will have an impact on a variety of factors, including gas costs — whether to call your functions or deploy your contract — as well as the structure of your storage facility.

Given that every piece of block space in Ethereum is extremely valuable (hence the high price of Eth, which has since dropped), the efficiency of your code and the resulting contract, which will hopefully be invoked on a regular basis, is greatly influenced. The gas used by every function call adds up; every amount of savings adds up when summed across the potential lifetime of all function invocations in a given time period.

For more content, follow me on - https://linktr.ee/shlokkumar2303
A productivity tool for GitHub users
Tags: github, extension, opensource, programming
Published: 2023-01-28 16:01:19

The extension in [chrome store](https://chrome.google.com/webstore/detail/starwall/icjbfnhahkkglbolodddjlgglnjeagek)
You can find source code here: [starwall source](https://github.com/iRay/StarWall)

How many times you faced the next situation: you need a package or a tool, search in google, go to github and figure out that you already have the repository starred in your bookmarks?

I've created and open sourced a chrome extension that allows you to easily search through all of your starred repositories, as well as the starred repositories of the users you follow.

#### StarWall Chrome extension
<img src="https://www.dropbox.com/s/70i9hrwav7ibjur/StarWallToken.gif?raw=true" alt="StarWall Chrome extension" width="800"/>
<br /><br />

With this powerful extension, you'll never have to waste time scrolling through your GitHub dashboard again - simply type in a keyword or phrase, and our extension will quickly find the repository you're looking for. 

Many of us have hundreds of starred repositories and it can be overwhelming to find the one you need, but with this extension, you can easily find the repository you need, even if you've forgotten about it. 

Additionally, the extension allows you to discover interesting repositories starred by the people you follow. 
Whether you're a developer, a designer, or just a casual GitHub user, this extension is an essential tool for staying organized and on top of your work.
How to remove help text from django's UserCreationForm
Tags: django, python
Published: 2023-01-28 15:39:08

So I've had a hard time creating users with the in-built UserCeationForm in django mostly because of the help text for password1 field so I tried looking into it critically get work my way around it. After much trial, I was able to get it done so that's what I'll be sharing with you guys today.

I'll believe you already have a little knowledge of django so I won't be starting from the very basics. I've created my project and named my app as `myapp`.

I'll start by creating a forms.py file where we'll be creating our custom user registration form.

```
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model

# get the current user model
User = get_user_model()

class CustomUserForm(UserCreationForm):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields["password1"].help_text = ""

    class Meta:
        model = User
        # add needed fields
        fields = ["username", "email", "password1", "password2"]


```

Once this is done, go into your views.py file and add the following

```
from django.shortcuts import render, redirect
from .forms import CustomUserForm

def register(request):
    form = CustomUserForm()
    # handle form submission
    if request.method == "POST":
        form = CustomeUserform(request.POST)
        if form.is_valid():
            form.save()
            return redirect("/path-to-redirect-to/")
    return render(request, "register.html", {"form": form})
```

Once these are done, you can style the form using django-crispy-forms. For now, that will be all.
Why should you struggle with SQL?
Tags: webdev, sql, beginners, database
Published: 2023-01-28 15:37:01


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

My disposition maybe wrong pardon me. or maybe because I know it. I don't know why people spend several hours trying to learn SQL.

It is so straight forward such that the English lang is always the use case.

1- You need a folder 📁 what do you do? You Create One (folder in this context is DB).
2- You need a file arrangements inside your folder 🗃️ 🗄️ , what do you do? You name those files and arrange them accordingly(Files in this context is table).
3- You need your employees name to appear in the files, what do you do? you "INSERT" their names respectively.

4- You want just an employee's detail to appear. What do you do? you "SELECT" from the corresponding file/table.

4- You misspelled one of the employees name in the file/table, what do you do? You "UPDATE" the corresponding file number with the appropriate employee name.

5- You no longer want an employee's name to appear in the file 🗃️ and Folder 📁. What do you do? You "DELETE/tipex" the name in the corresponding file.

6- You no longer want  a File 🗃️ in you folder 📂. what do you do? you "DROP" the file off the folder 📂.

7- You no longer want the entire folder 📂 and file 🗃️, what do you do? You "TRUNCATE" all.

Example of Commands:

Insert into File/table set = "employee name"  where ID = 0000

Update * file/table set = " New name" where ID = 0000

Delete * from  file/table where ID = 0000

Select * from file/table where ID = 0000


SQL is the simplest lang to struggle with just like HTML and CSS.
Managing Powershell collections graphically
Tags: powershell, devops
Published: 2023-01-28 15:36:25

---
title: Managing Powershell collections graphically
published: true
description: Out-ConsoleGridView is Powershell command for managing collections
tags: powershell,devops
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-28 11:44 +0000
---

One of the most interesting features of Powershell is manipulation of data as object collections, which is a feature inherited from the .net platform.

A collection (eg array) can be the result of powershell command and it could contain a lot of objects but only a subset of them could be interesting. To facilitate the selection of data subset, exists a Powershell Cmdlet console-based GUI called [Out-ConsoleGridView](https://github.com/PowerShell/GraphicalTools).

```Powershell
# installation
Install-Module Microsoft.PowerShell.ConsoleGuiTools

# usage example1:
PS C:\> Get-Process | Out-ConsoleGridView
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzkl8scbco9y1gwete5o.png)

As you can see the tool is always integrated into the terminal because it has built on a cross platform UI toolkit based on a fantastic open source project called [Terminal.Gui](https://github.com/gui-cs/Terminal.Gui). Now you can select the objects by using space bar and than confirm the selection with enter.
The result will be:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7cos3f1ccue72rnxbjp.png)

As you noted the result its still a collection so we can use it by pipe with another Powershell command:

```Powershell
# usage example2:
PS C:\> Get-Process | Out-ConsoleGridView | Export-Csv -Path .\ProcessLog.csv
```
Insert images in a PowerPoint template with BroggiSoft.OfficeExport
Tags: csharp, dotnet, programming, tutorial
Published: 2023-01-28 15:19:01

Here is an example of using BroggiBoft.OfficeExport to insert an image into a PowerPoint template:

First, you need to create a PowerPoint template containing a tag for the image that you want to insert. To do this, you must create a Rectangle shape of the desired size and put a `{{Img=YourNameValue}} ` tag inside. For this in PowerPoint go to Insert > Shapes > Rectangle.
For this example the value of YourNameValue is logo.

![PowerPoint template with tags](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zks44rdljocm8ppp6yrh.png)

Next you need to convert the image you want to insert to base64. You can use the Convert.ToBase64String class to convert the image to a base64 string.

Create a dictionary that contains the image data with the key name that matches the tag in the template.

```
var imageBase64 = Convert.ToBase64String(File.ReadAllBytes("logo.png"));
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("logo", imageBase64);
data.Add("title", "OfficeExport Example");

```
Install the nuget package BroggiSoft.OfficeExport from: https://www.nuget.org/packages/BroggiSoft.OfficeExport/

Finally, use the ExportFromDictionary method of the OfficeExport class to replace the tags in the template with the image data.

```
OfficeExport.ExportFromDictionary("template.docx", "output.docx", data);
```
The output file "output.pptx" will now contain the image inserted into the Shape Rectangle named "logo" in the template, and the title will have been replaced by its corresponding value (here: OfficeExport Example).


![The powerpoint output after replacing the tags](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h8x5j0f8iz6zbi6tsqcg.png)

It's important to note that you can use the same steps to insert images into Word and Excel templates.

You can find a test project on GitHub: [OfficeExportTest](https://github.com/BroggiQ/OfficeExportTest)
ChatGPT Free Credits Expiring at April 1/2023
Tags: chatgpt, ai, blog, softwareengineering
Published: 2023-01-28 15:16:08

It turns out initial credits to experience the ChatGPT is 18 USD:

![image.png](https://cdn.steemitimages.com/DQmYDu9en2JxMSQm5TyrxAM666nb1yg3itmdeiDeQCt32h9/image.png)

OpenAI + [Microsoft Azure](https://helloacm.com/simple-bearer-token-credential-wrapper-for-c-azure-sdk/), they probably will monentize ChatGPT via pay per month or pay per usage.

---

ChatGPT may not be used in some parts of the country, for example, In China. If you try to use a VPN, which may be detected and blocked:


![a303d8f5b5f6c74dd9741bbdc4a4e00.jpg](https://cdn.steemitimages.com/DQmdX2HAGkQmbtLXNo6KwKcNzcfmFDQy36ygYi3d3ZrSmBK/a303d8f5b5f6c74dd9741bbdc4a4e00.jpg)

---

For now, you can visit the [bots both in discord/telegram](https://steemyy.com/bots.php) and talk to ChatGPT via "!ask" command.


![image.png](https://cdn.steemitimages.com/DQmWeYJ3KM7AUX9fjCEB5AQxYnggdQXntkJ7smY26n8BWnX/image.png)