teleren/devto huggingface dataset:
How To Encrypt And Decrypt String In Laravel 9
Tags: laravel, laravel9, encrypt, decrypt
Published: 2022-11-21 05:30:00

In this article, we will see how to encrypt and decrypt strings in laravel 9. 

As we all know laravel framework provides more security to the user and that's why laravel provide encrypt of password or string to the user, here we will see encrypt or decrypt a string in laravel 9. 

Laravel's encryption services provide a simple, convenient interface for encrypting and decrypting text via OpenSSL using AES-256 and AES-128 encryption. 

So, let's see encrypt decrypt a string in laravel 9, laravel 9 in encrypt a string, laravel 9 in decrypt string.

You need to use the Crypt class to start encryptString and decryptString or some data.

```
use Illuminate\Support\Facades\Crypt;
```

Example 1:

```
<?php
 
namespace App\Http\Controllers;
 
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Crypt;
 
class UsersController extends Controller
{
  public function encrypt()
   {
        $encrypted = Crypt::encryptString('techsolutionstuff');
        print_r($encrypted);
   }
   
    public function decrypt()
    {
         $decrypt= Crypt::decryptString('your_encrypted_string');
         print_r($decrypt);
    }
}
``` 

---

**_[Read Also: How To Create Custom Helper Function In Laravel 9](https://techsolutionstuff.com/post/how-to-create-custom-helper-function-in-laravel-9)_**

--- 

Example 2:

If you are using older version of Laravel like laravel 5, laravel 6 then this example will help for you.

```
<?php
 
namespace App\Http\Controllers;
 
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Crypt;
 
class UsersController extends Controller
{
	$data = Request::all();

	$user = new User();
	$user->password = Crypt::encrypt($data['password']);
	$user->save();
	
	try {
    	$decrypted = Crypt::decrypt($data->password);
	} catch (DecryptException $e) {
		$e->getMessage();
		info("Error....!!");
	}
}
```
Get a head start with badass hardhat workflow
Tags: hardhat, web3, solidity, programming
Published: 2022-11-21 04:49:28

In this article I will first show you what a badass hardhat setup looks like and then second I will teach you so you can have the same.

## The 5 things a badass hardhat setup has:

1. Auto compile & deployment of code in development
2. Auto builds & maintains a file with every contracts address & abi.
3. A generic UI for your contracts, which hot reloads as contract code changes.
4. A single command to deploy contracts to testnet & mainnet
5. A single command to verify contracts.

## Now, let's take a look  at this setup IRL:

{% embed  https://youtu.be/LA2EZPCyLZI %}

[The code for this badass hardhat setup is here.](https://github.com/mistersingh179/badass-hardhat-setup)

## Here are the steps for you to have this same setup:

1. Clone this repo & install dependencies
```
git clone https://github.com/mistersingh179/badass-hardhat-setup
npm i
```
2. Then in a terminal window run the hardhat chain locally
`npm run chain`
3. Next, in another terminal window run the deployment script
`npm run deploy`
4. That's it. You should now have your chain running locally and code deploying to it in real-time.

## Let's test our setup.

1. Open your favorite IDE and you should see `*.sol` files in the contracts directory.
2. There should also be a file called `contract-addresses.json `being auto built everytime you change code.
3. Go ahead, change the code in the IDE and you should see in terminal that it is auto deploying and the `contract-addresses.json` has been updated.
4. For a UI, browse to [sidekick.xyz](https://app.sidekick.xyz), upload `contract-addresses.json` and press continue. You should have a UI for your contracts.
5. Make changes to your contracts now, you should see them also being updated in UI.

## Deploy to testnet & mainnet

1. When you are ready to deploy your code run npm run deploy-goerli or npm run deploy-mainnet
2. Then to verify the contracts do `npm run verify-goerli` or `npm run verify-mainnet`

## Writing new contracts

1. To add a new contract, just add a `*.sol` file in the contracts directory.
2. Then add a deployment script for that contract in deploy directory. Copy paste existing deployment scripts and just change the contract name. This way it is less prone to errors.
3. The contract should get auto-deployed now.

This is it. You too now have a badass hardhat setup. 🥳🎉

**FYI** – In case you want to see how all this is setup, just take look at the hardhat.config.js file and read the documentation of hardhat & its plugin hardhat-deploy
Why React Is Bad (alternatives)
Tags: react, webdev, javascript, programming
Published: 2022-11-21 04:36:08

## 1.react is too slow

so this is not so surprising. we all know that react is slow. but this not the thing that make you stop using react. but it is not worth. imagine you spent 7 days working on a project you deployed it on netlify. and the only one response you got is **"your app have Sh*t performance"** just look at benchmarks


![Image description](https://lh6.googleusercontent.com/J1bZkoLtIt9GLGmW4Uf9QmUFO_UZ1ax9dtVNg5_naZVqlpJ5au7kQ6AfexrYCS83q6T6ePK_n2PhyCMBLSWNtaIRBX493v483hIrFJDNtnK1-UGKWCpIaFz1iSMOWplEF0PmEyIL)

## 2.react router dom
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ox632u66b3ep32b09n9w.png
)

I am not saying that react router is not bad.
the point is , I am saying react is used for create SPA (single page application) and you have to install third-party package to link things and creating routes. Ands its not even Facebook's package.
 
## 3.create react app 
![img](https://camo.githubusercontent.com/b275c108e1c9e2d1c732a66ca1e0b6ecb1ae260824fb5d6ca4c4e46ee85d1ca0/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f66616365626f6f6b2f6372656174652d72656163742d61707040323762343261633765666130313866323534313135336162333064363331383066356661333965302f73637265656e636173742e737667)

create react app is too slow. you have too wait for half an hour. like the time **mind waiting**. best way to create a react app is using **[VITE](https://vitejs.dev/)**.


## 4.react is expensive
![img](https://cdn.britannica.com/77/176277-131-9DE4170C/Currency-Money-Cash-Dollars-Bills-Pile-dollar.jpg)

it costs moneys. because of server fees. react is bulky to use. take a lot of storage. if have billion dollar server this thing doesn't matter.

## 5(and last one). head component
![img](https://i.ytimg.com/vi/_dLTRiHm7B8/maxresdefault.jpg)
see. to change the title of webpage you have to go to public folder. enter index.html and then change title. and after lot of work. closed your editor and you saw that. there is typo in title. this freaking thing is too annoying.(based on true story)

## conclusion (and alternatives)
###React is bad. all above points are true just try it your self.
### alternatives
there is one one alternate look at image down below/
![img](https://res.cloudinary.com/practicaldev/image/fetch/s--TenQsTYv--/c_imagga_scale,f_auto,fl_progressive,h_900,q_auto,w_1600/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rd3omc5vp71r5k9z69b4.png)
Keyoxide Proof
Published: 2022-11-21 04:32:49

---
title: Keyoxide Proof
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-21 04:29 +0000
---
[Verifying my keyoxide cryptographic key: https://keyoxide.org/17C72572E866AE2A11A9659DDA3DA8901A66E9F4]
VPN แค่บางส่วนกับ openconnect กับ vpn-slice
Published: 2022-11-21 04:10:58

ช่วง WFH แน่นอนสิ่งที่เราต้องใช้เสมอคือ VPN สำหรับเข้าถึง network ของที่ทำงาน แต่ปัญหาคือพอ VPN แล้วเราก็เหมือนเข้าไปในจักรวาลอีกจักรวาล บางทีก็ช้าจนแชร์ screen ไม่ได้หรือบล็อกบางเว็บที่เรา วันนี้เลยมาเสนอตัวช่วยคือ [Openconnet](https://www.infradead.org/openconnect/) & [vpn-slice](https://github.com/dlenski/vpn-slice) 

## Openconnect คือ
เป็น cross-platform VPN Client (อย่างผมใช้ Manjaro Linux จะมีมาให้เลย MacOS ก็น่าจะ install ผ่าน brew ได้) ในการต่อ vpn เราสามารถใช้ openconnect ผ่าน command line ตัวอย่างเช่น

`openconnect https://vpn.mycompany.com/`

ข้อดีคือมันสามารถใช้กับ VPN ที่เราคุ้ยเคยอย่าง PAN GlobalProtect หรือ Fortinet SSL VPN ได้ด้วยการเพิ่ม param - protocal ได้ด้วย ตัวอย่างเช่น
`openconnect --protocol=gp vpn.example.com`
หรือ
`openconnect --protocol=fortinet fortigate.example.com`

## vpn-slice พระเอกของงาน
vpn-clice เป็น python project สามารถ install ผ่าน pip ได้เลย 

`sudo pip3 install "vpn-slice[dnspython,setproctitle]"`

พอ install เสร็จแล้วเราสามารถเพิ่ม vpn-slice ไปเป็น param ที่ openconnect เพิ่มได้ว่า "เอาแค่ network หรือ domain นี้นะที่ไปกับ VPN"
ตัวอย่างที่ผมใช้จะเป็นประมาณนี้

ทำเป็น bash ไว้เช่น myvpn.sh (chmod u+x ให้เรียบร้อยจะได้ run ได้)

`echo "super-password" | sudo openconnect --protocol=gp --user=tumit --script='vpn-slice 172.16.0.0/12 myweb.tumit.co.th db.tumit.co.th' vpn.tumit.co.th --passwd-on-stdin`

- เนืองจากไม่อยากกรอก password ทุกครั้งเลยให้ echo "password" แล้วใส่ | เพื่อส่งไปให้ openconnect แทน
- เรียกคำสั่ง openconnect ตามด้วย param อย่างผมใช้ GlobolProtect ก็ใส่เป็น protocal=gp ตาม user 
- ต่อมาส่วนที่ช่วยให้กำหนดว่า network หรือ domain ไหนที่เราอยาก VPN ก็มากำหนดที่ param script อย่างของผมอยากเข้าแค่ IP ที่เป็น 172.16.0.0/12 กับพวก web ใน dev environtment กับ db ก็ใส่ ๆ ไป
- ที่เหลือก็ vpn domain กับส่วน password รับมาจาก echo ด้วย passwd-on-stdin

ก็จะประมาณนี้นั้นแล ~
A case for conferences
Tags: beginners, programming, devrel, career
Published: 2022-11-21 03:47:03

  As a software engineer, here are three areas of focus: continuous learning, community, and challenging comforts. This year, I attended three tech conferences within driving distance. RenderATL, All Things Open, and Connect.Tech were playgrounds for fostering a sense of belonging within my career.

  As remote working continues to thrive, we need to keep getting together to talk about tech. We need conferences to provide safe, diverse, supportive, educational spaces to relax and relate with each other.

**Continuous learning**
  Success is as sharp as one's skills, and as the landscape continuously changes, so does one's toolbox. The beauty of conferences is a buffet of topics and tracks to glean knowledge and inspiration from. I gathered information about advanced typescript, edge computing, performant css, and decentralized information. Because of the conferences, I've gained understanding of frameworks through live coded presentations, and could chat with the speakers afterward.

**Community**
  Success is supported by numbers, and we need each other to have fun and get through the difficult times together. Conferences are best served through cultivating a sense of belonging, that tech is welcoming to everyone, especially you. The atmosphere is set on a common ground of interests, and that gathering is magical. Over the year, I've joined a few discord servers, where I've made friends that attended the same conferences. Outside of the technical topics is the humanness that is nurtured through shared meals and music.

**Challenging comforts**
  Success is sitting with discomfort, and finding reasons to stay. There are always moments of wondering what to say or where to go next. There are moments where I don't understand where a conversation is going or what the topic is exploring. This is where learning happens, how I sparked interest in other frameworks, architectures, and paradigms. This is where I learned that my career in tech is sustainable in the right environments.
【Laravel】timestamps() and timestamp()
Tags: laravel
Published: 2022-11-21 03:22:01

*The version of Laravel ...5.8, PHP...7.1.3

When you create migrations in Laravel, you need to set columns that store timestamps  ("created_at", "updated_at", "deleted_at"). 

```
$table->timestamps();
```

It creates "created_at" and "updated_at" automatically and these columns can store NULL.

You also can set  name for a single column for timestamp like as below.

```
$table->timestamp('<column name>');
```

Make sure to use "timestamps()" (plural)  to set "create_at" and "updated_at" at the same time, and for a single column, use "timestamp()" (not plural). Otherwise, you will waste hours and hours to fix the error like I did...
Design Documentation for an Open Source COBS Decoder in VHDL
Tags: opensource, fpga, vhdl
Published: 2022-11-21 03:11:50

Design documentation for an open source COBS decoder in VHDL from [Open Research Institute](https://openresearch.institute) can be found here:

https://github.com/phase4ground/adi_adrv9371_zc706/blob/adrv9371-zc706-dvbs2-integ/design_docs/cobs_decoder/COBS_dec-Entity-Design.md
Apakah Di Poki Games Sudah Ada Free Fire? Ini Penjelasannya!
Published: 2022-11-21 03:03:19

Poki Games Free Fire saat ini sedang di pertanyakan oleh netizen. Nah, seperti yang Anda ketahui, Poki Games Free Fire sangat populer di kalangan gamer.

Banyak pemain memainkan permainan poker online gratis tanpa mengunduhnya. Seperti yang kamu ketahui, Free Fire harus memiliki ruang penyimpanan minimal 1GB untuk bisa dimainkan di smartphone kamu.

Kehadiran Poki Games Free Fire menjadikannya sebagai tempat bermain game online tanpa harus menginstalnya. Permainan poki juga sangat mudah digunakan, sehingga permainan poki ini bisa dimainkan oleh segala usia.

Menariknya, Poki Games selalu memperbarui atau menambahkan game yang tidak terdaftar di Poki Games.

Banyaknya pilihan permainan di Poki Games memberikan kebebasan kepada pengguna untuk memilih permainan yang ingin dimainkan.

Selain itu, tata letak Poki Games yang sangat sederhana menjadikannya daya tarik tersendiri bagi pengguna Poki Games.

Untuk memastikan bahwa [Poki Games Free Fire](https://pokionlinegames.org/) tersedia di website Poki Online Games, Anda bisa mengeceknya terlebih dahulu dari link Poki Games yang kami bagikan di bawah ini.

Coba perhatikan ada tidaknya logo Poki Games Free Fire. Jika tidak, Free Fire mungkin belum tersedia di Poki Poki Games.

Karena kemungkinan belum ada kolaborasi antara keduanya, Poki Games Free Fire belum tersedia.

**Opsi Game di Poki Games**

## Minecraft Classic

Game Minecraft sangat terkenal dikalangan para gamers karena hampir setiap generasi mengenal game ini. Karenanya, game minecraft bisa menjadi salah satu game sepanjang masa yang tersebar di seluruh dunia.

Game Minecraft mengajak Anda berpetualang dan Anda harus bertahan hidup sambil mengumpulkan sumber daya yang tersedia untuk membangun dunia.

## Raft Wars

Anda dapat menemukan dan memainkan game Raft Wars secara gratis di Poki Games yang termasuk dalam kategori Game Perang.

Pemain yang menyukai game Raft Wars juga cukup tinggi, dilihat dari Play Store, game ini sudah diinstal lebih dari 100.000 kali.

Versi permainan multipemain ini mudah dimainkan di Poki Games dan Anda bisa bersenang-senang memainkannya.

Itu adalah berbagai pilihan permainan poki dan cara menggunakan permainan poki yang dapat kami bagikan kepada Anda. Permainan poki ini sangat cocok untuk mengisi waktu luang anda, selain itu permainan poki ini juga bisa anda mainkan sendiri atau berpasangan.
OSD600 - release 0.3 code reviews
Published: 2022-11-21 03:03:19

For release 0.3 of my course in Open-Source Development, I was tasked with reviewing two PRs to any of the Seneca [telescope](https://github.com/Seneca-CDOT/telescope) or [IPC144](https://github.com/Seneca-ICTOER/Intro2C) repositories.

For the first review, I looked at a PR to [improve the style of the help section for search](https://github.com/Seneca-CDOT/telescope/pull/3754). The font for the help section did not match the rest of the website. The PR involves changing the font style to `Spartan` to match the rest of the website and decreasing the font-size as the Spartan font displays larger than the previous font. I tested this by navigated to the vercel deployment link from the PR and confirmed that it worked on different browsers, and that the font looked consistent across different screens sizes. After confirming that everything looks good, I approved the PR. However, someone had pointed out that using `[]` instead of `'` could be better:


![Search help section](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mh14riiidyutlcin1snn.png)

This led to a discussion that maybe the search help needed improvements so it could be understood better. Terms such as `slop amount`, `fuzziness` were not explained and would not be obvious to someone not familiar with search APIs such as [elasticsearch](https://www.elastic.co/). It was decided that this should be handled in a different issue, and the font change could be merged on its own.

For the second review, I looked at a PR to [change the width of the blog URL](https://github.com/Seneca-CDOT/telescope/pull/3757) on the sign-up confirmation page to base it on the width of the parent element. This was previously fixed at 300 px as an approximation to prevent the text from overflowing the parent form element. This was a small change, but it took me a while to test as I had to fix my local setup. To get to the sign-up confirmation page, a test sso is used locally. However, I could not get docker to work. It was stuck in a 'Starting docker' state. Trying to stop it would result in it getting stuck in a 'Stopping' state. Eventually, I solved it by force quitting it using task manager and restarting my computer. Then, I confirmed that the change was working as expected and approved the PR.
innerHTML and textContent
Tags: beginners
Published: 2022-11-21 01:53:27

Hey all I'd like to go over a HTML concept about some differences in properties of HTML and when they are rendered to the DOM.

As a beginner like myself, the difference between innerHTML and textContent did not seem very different until ran into a problem on a project I was working on. 

The first web app I built was a mood playlist site that used the Spotify API to render playlist based on input of the user's mood.
If you've used Spotify before or any digital music app then your  probably aware that you can create and publish a playlist. 

**The Problem**

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

I typically use textContent when rendering just text to the DOM because I knew what data was going to be. However, when I didn't know what my data was going to be, it became a learning opportunity.

I realized that my Spotify data had other html elements inside of what I thought was just text. To be specific, it was string.  

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

{% embed https://www.w3schools.com/JSREF/prop_node_textcontent.asp %} W3School says that textContent sets the text content of the specified node. It also says that textContent returns the text content of the element and all descendances, with spacing and CSS hidden text, but without tags. 

So why does it have the tag?

We are returning just the string with HTML inside of it. If we look at MDN's description of innerHTML [https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML](url), it set's the HTML from the element. I wanted to have the html from my data reflected on the DOM so I need innerHTML to parsed the string into HTML.


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

It's working now! Thank you for reading my blog post!
OSD600 - Fixing an issue in AppFlowy
Published: 2022-11-21 01:21:01

This week, I worked on an issue in the [AppFlowy](https://github.com/AppFlowy-IO/AppFlowy) project to fix [focus borders not appearing on date cells](https://github.com/AppFlowy-IO/AppFlowy/issues/1414). AppFlowy is a note taking app built using [rust](https://www.rust-lang.org/) and [flutter](https://flutter.dev/). The issue was that cells which have a type of 'Date' would not have a focus border if they were selected:

![No border on selecting ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xue2op81j64xv7zrvft2.png)

Here the second cell has been clicked to change the value but there is no visual change in the cell to indicate this. I had previously contributed to AppFlowy so I thought I would be able to get started right away. However, when I tried to run the app in debug mode, I got a build error: `-Csplit-debuginfo is unstable on this platform`. After some investigation, I found that [this happens on a newer version (>1.65) of rust](https://github.com/rust-lang/rust/issues/100657). And I had recently updated rust to the latest version. Thus, I downgraded rust to 1.64 was able to run the app locally.

I used the Widget Inspector to find the logic for rending the data cell and thought about how to add the focused border functionality. The date cell opens a popup when it is clicked. I decided to use this existing logic to show a focus border when the popup is shown and remove it when the popup is closed: 

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

Now, the selected cell is highlighted. I tested the popup by trying to change different values, changing field types etc., and confirmed that the border worked on both light and dark themes. Finally, I created a [PR](https://github.com/AppFlowy-IO/AppFlowy/pull/1469) for the changes.
Laravel project
Tags: laravel, php, mysql, javascript
Published: 2022-11-21 01:09:52

## Laravel 1 dars
laravelni o'rnatish
```
composer create-project --prefer-dist laravel/laravel laravel-task
```


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

_github bilan bog'lash_
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emqx5bs3x9cn8jmszfxx.png)


**databasani bog'lash**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kv9700oc2f1lanllm3fb.png)



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




## starter kitsdagi breezedan foydalanamiz


```
composer require laravel/breeze --dev
```

```
php artisan breeze:install
```

```
php artisan migrate

```

```
npm install

```

```
npm run dev
```
Create Node app using Docker without installing Node Locally
Tags: node, docker
Published: 2022-11-21 00:59:11

Almost all tutorials shows how to initialize a node app with Node installed locally. Here is a way to create a node app in Docker without installing Node locally.

## Initialize a node app in the current directory with Docker: 
  - Replace `npm init` with whatever npm command is needed
  ```sh
docker run --rm -v "$PWD:/$(basename $PWD)" -w "/$(basename $PWD)" -it node:current-alpine sh -c "npm init"
  ```

## Info
- `-rm` remove
- `-v` volume
- `$PWD` path to current directory
- `basename` last element of file path
- `-w` working directory
- `-it` interactive docker terminal
- `-c` context, without it sh will not work
Gosloto Russia Results
Published: 2022-11-21 00:11:10

The Russia Gosloto 7/49 draw takes place five times a day.Betting for the five draws close at the following times each day:
09:28, 12:28, 14:28, 17:58 and 21:28
[Gosloto Results Today](https://goslotoresult.co.za/)
FarFarLight, Оптовий склад скла фар та корпусів фар
Published: 2022-11-20 22:42:13

[Корпуси на фари автомобілів](https://farfarlight.com.ua) та [Скло фар у Києві](https://farfarlight.com.ua) іноземного виробництва.Вроздріб та Оптом зі складу компанії, дуже великий вибір для всіх марок автомобілей. Самий великий склад України! Перевірте, зайшовши на нашу веб-сторінку, саме тут Ви можете одним натисканням придбати необхідну деталь, а за вказаними контактами отримати детальну консультацію наших спецілалістів. У нас можна придбати та замовити ремонт, відновлення, заміну, усунути тріщини, сколи та інші експлуатаційні поломки. Гарантуємо високу якість, вчасну доставку покупцю та якісне гарантійне обслуговування. Купляйте у нас!