teleren/devto huggingface dataset:
The best 🔥 Google Chrome extensions for developers 👨‍💻
Tags: webdev, programming, productivity, python
Published: 2023-02-05 15:21:43

## Introduction

- Chrome extensions are a great way for developers to save time and increase their productivity. 

- With the right extensions, you can streamline your workflow and spend less time on tedious tasks like web browsing or debugging code. 

- There are hundreds of Chrome extensions available that can help you do your job faster, so it's important to choose the ones that best fit your needs. 

- One popular extension is AutoFill Form Filler which allows users to quickly fill out forms with pre-defined data such as name, address, credit card information etc. 

- Saving them from having to manually enter this information every time they need it. 

- This extension also includes features such as auto-filling passwords and automatically filling in CAPTCHAs which makes logging into websites much easier than before. 

- Additionally there’s an option for customizing fields according to user preferences making it even more efficient when dealing with multiple forms at once! 

- Another useful Chrome Extension is PageSpeed Insights which helps developers optimize their website performance by providing insights about how fast each page loads along with suggestions on how they could improve its speed further if needed be - a feature especially beneficial when trying maintain good search engine rankings or simply improving overall user experience within the site itself! 

- It also provides additional details regarding JavaScript execution times & other related metrics allowing one take necessary steps towards optimizing pages accordingly thus making sure visitors don't have wait too long before content appears on screen after clicking through links/buttons present within said sites!


###### Developers 💻 Chrome Extensions of the Month February 2023

🎥 {% youtube QinyyM27jR8%}


#### Bonus

###### 6 Google Chrome extensions 🔥 that'll help you turn hours of work into minutes free🚀💯 

🎥 {% youtube ZadRYU_bZD8%}


### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)
First Thoughts on Zig - Getting Started and Learning Resources
Tags: zig, programminglanguages
Published: 2023-02-05 18:51:58

---
title: First Thoughts on Zig - Getting Started and Learning Resources
published: true
date: 2023-02-05 15:10:45 UTC
tags: Zig,ProgrammingLanguages
canonical_url: 
---

 ![First Thoughts on Zig - Getting Started and Learning Resources](https://images.unsplash.com/photo-1618907325987-8956fe9b4817?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDE4fHx5ZWxsb3clMjBsaXphcmR8ZW58MHx8fHwxNjc0NTA0MDI5&ixlib=rb-4.0.3&q=80&w=2000)

> This post originally appeared on [Weekly Typed](https://www.weekly-typed.com/first-thoughts-on-zig/).

In January 2023, I delved into the Zig programming language. If that's unfamiliar, check out [the website](https://ziglang.org/) for a rundown of what it's about. [The Road to Zig 1.0](https://youtu.be/Gv2I7qTux7g) is also a great talk by Andrew Kelley explaining why he created it. I had heard about Zig a while back but only got interested enough to learn it because the [Bun](https://bun.sh) runtime for Typescript/Javascript piqued my interest. And that project is written in Zig.

Anyway. Here are some initial thoughts I had trying to get started and learn the language.

## Getting started

The getting started guide was beneficial. It was easy to install the zig compiler and toolchain on Mac (via Homebrew) and Windows (via Chocolatey).

I did run into one snag when installing extensions on VS Code. The guide mentions several options, but most people will probably want [zls-vscode](https://marketplace.visualstudio.com/items?itemName=AugusteRame.zls-vscode). I installed another extension by mistake, which only gave me syntax highlighting and a small amount of linting. Which is what the guide actually tells you if you read it. `zls-vscode` is a frontend for the Zig language service (zls). When you install it, you will be prompted to install zls. This gives you all the features of the other extensions and more.

## Learning resources

[Ziglings](https://github.com/ratfactor/ziglings) is a great way to learn the basics of the language. It is a repository with a series of one-file programs. At the top of each file, comments give you information about one concept in Zig. Each program is broken in some way related to that concept. Your goal is to fix it with the help of the comments.

There are a few things to know before going in.

First, Ziglings needs to be updated in places. Zig is not yet to version 1.0. So don't be too surprised if some field names of common types have changed, and Ziglings still needs to catch up.

Second, Ziglings only covers some things. Once you are done with it, give the docs a look. They are great and cover everything.

Because Zig is still so young, there are few other resources to learn from

## Next

That's it for now. In a future post, I will discuss my thoughts on some features of Zig. Some of them are familiar, but Zig does them differently. Others are very unique.

- Error handling
- Optionals
- Unions
- Types as values
- Comptime
Stripe Abandoned Cart Automation - ConvertX
Tags: automation, stripe, abandonedcart, javascript
Published: 2023-02-05 15:05:18

https://ConvertX.io

Hey All,

Check out my latest project ConvertX! It's an abandoned cart automation tool that is seamless to use! 


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


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

The App allows you to connect your Stripe account and see when a customer abandons that cart. The app will send an email reminder at 1 hour to try and get the customer to purchase at full price. It will then send an email at 24 hours with a discount.
How to get yesterday’s date in JavaScript without a library
Tags: javascript, webdev, beginners
Published: 2023-02-05 15:01:38

> ✋ **Update:** This post was originally published on my blog [decodingweb.dev](https://www.decodingweb.dev), where you can read the [latest version](https://www.decodingweb.dev/javascript-yesterday-date) for a 💯 user experience. _~reza_

## How to get yesterday’s date using JavaScript?

To get yesterday’s date in JavaScript, you need to get today’s date and use `setDate()` of the Date object to subtract a day from it.

It’s quite easy to implement; You can do it in four steps:

1. Get the current date by `Date` constructor
2. Get the day of the month via `Date.prototype.getDate()`
3. Subtract 1 day from it
4. Use `Date.prototype.setDate()` to set the result as the day of the month

Let’s write the code:

```js
let currentDate = new Date()
           
// Instantiate another object (based on the current), so we won't mutate the currentDate object
let yesterday = new Date(currentDate)
yesterday.setDate(yesterday.getDate() - 1)
           
console.log(yesterday)
```

In the above example, we get the current date (today in this case). Then, we instantiate another date object to avoid mutating the `currentDate` object. 

The `getDate()` method returns the day of the month for our date object. The return value is an integer number between `1` and `31`.

Next, we subtract `1` from the value returned by `getDate()` and pass it to `setDate()` as an argument. 

If the result is outside the acceptable range for the respective month, `setDate()` will update the Date object accordingly (by changing it to the next or previous month respectively).

For instance, if we're on the first day of the month, and we subtract a day, the result would be the last day of the previous month - instead of `0`.

## How do I get yesterday's timestamp?

To get the yesterday's date in Unix Timestamp, first you need to call `Date.prototype.valueOf()` on your Date object. And since the returned value is in milliseconds, you'll have to divide it by `1000`:

```js
let currentDate = new Date()
           
// Instantiate another object (based on the current), so we won't mutate the currentDate object
let yesterday = new Date(currentDate)
yesterday.setDate(yesterday.getDate() - 1)

console.log(Math.floor(yesterday.valueOf() / 1000))
```

It's important to return only elapsed seconds as an integer value; That's why we used `Math.floor()`, and not `Math.round()`.

And that's how you get yesterday's date in JavaScripts hope you found this quick guide helpful!

Thanks for reading.

**❤️ You might like:**

- [Cannot find module error in Node.js (Fixed)](https://www.decodingweb.dev/cannot-find-module-error-in-node-js-fixed)
- [Add commas to numbers in JavaScript (Explained with examples)](https://www.decodingweb.dev/add-commas-to-numbers-in-javascript)
- [How to fix "ReferenceError: document is not defined" in JavaScript](https://www.decodingweb.dev/how-to-solve-referenceerror-document-is-not-defined)
- [Label htmlFor Property Explained](https://www.decodingweb.dev/label-htmlfor-property-explained)
List, Indeks, Manfiy indeks
Tags: python, programming
Published: 2023-02-05 14:52:43

                     _list() konstruktori_
List ro'yxati _list()_ konstruktori yordamida hosil qilish mumkin. Bunday holatda kvadrat qavslar qoyib bo'lamaydi:
_Misol uchun:_
Sabzavotlar = list(("sabzi", "kartoshka", "bodring", "pomidor", "lavlagi"))
print(sabzavotlar)

                   _Elementlarga murojaat_
_List_ elementlariga murojjat qilish uchun, elementning indeksini ko'rsatiladi. Sanoq  har doimdek 0 dan boshlanadi. 
_Misol uchun:_

Mashina = ["Audi", "Toyota", "BMW"]
print(Mashina[1])

                       _Manfiy indeks_
Manfiy indeks sanoq oxirida boshlanishini bildiradi. Masalan, -1 eng oxirgi, -2 oxiridan ikkinchi element va h.k
formating a USB stick on a linux machine
Published: 2023-02-05 14:50:24

well i look for the most apropiate way to format a USB stick 

in other words: what is the best practice for formatting a USB stick? Is it best to format the USB stick only for Linux use rather than for both Linux and Windows use? 

i have heard that one of the best Filesystem is exFAT: Especially on USB pendrives and SD cards and the like the exFAT provides a good method to use a Filesystem.

i have made some investigations and did some google-search: the so called exFAT is, roughly speaking, a revision of the legendary system FAT32 without the 4GB max file size limitation. 

i have had a look at some manpages and tried to find out which is the best way to get a usb-stick formated with exFAT

first of all:  If not installed, we will have to install exFAT support.

> $ sudo apt install exfatprogs # Debian/Ubuntu
> $ sudo pacman -S exfatprogs # Arch Linux/Manjaro

From here, you have mainly two options: by the way: we wont make use a graphical tools like gparted or the command line (which is more fun). 

first of all - we have to take care for the following things and steps: 

- Plug-in the USB pendrive/SD card into the system afterwards 
- we have to identify the device. It should be one of /dev/sd thats for sure.

If we use the commandline  then we run the below command which will see the connected devices and all the partition mount points. 

In this example, /dev/sdb is the device,

with two partitions, the first of which is mounted.

```$ lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb           6:46   1    30G  0 disk 
├─sdb1        6:47   1   256M  0 part /media/myuser/mydevice
└─sdb2        6:38   1  29,7G  0 part 
nvme0n1     259:0    0 967,5G  0 disk 
├─nvme0n1p1 259:1    0   532M  0 part /boot/efi
├─nvme0n1p2 259:2    0    74G  0 part /
├─nvme0n1p3 259:3    0   266G  0 part /home
├─nvme0n1p4 259:4    0    58G  0 part [SWAP]
├─nvme0n1p5 259:5    0   458G  0 part /data
├─nvme0n1p6 259:6    0    17M  0 part 
└─nvme0n1p7 259:7    0   125G  0 part 
Unmount mounted partitions.
```

and then afterwards .. 
```
$ umount /dev/sdb1
```
now - at this point we have to create a new partition table and partition of type 

```HPFS/NTFS/ - and here we use exFAT.
$ sudo fdisk /dev/sdb # Pay attention! No final digit is used.```

Welcome to fdisk (util-linux 2.xy).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help):
```Create a new (dos) partition table: press o and enter.
Create a new partition: press n, enter and accept default options.
Change the partition type to HPFS/NTFS/exFAT: press t, enter, 7, enter.
Quit saving changes: press w and enter.
You can quit without saving changes: press q and enter.
Format the partition.
$ sudo mkfs.exfat -n "my label" /dev/sdb1 # Pay attention! Final digit is used.
mkexfatfs 1.x.y
Creating... done.
Flushing... done.
File system created successfully.
```
Hackathon - ErgoHack VI - Cypherpunk Finance
Tags: opensource, blockchain, rust, scala
Published: 2023-02-05 14:43:04

[Ergo Hackathons](https://ergohack.io/) have become a principal and defining feature of the community over the last year. In just a short amount of time, Ergohacks have helped build tools and dApps that are now key pieces of infrastructure in the Ergo ecosystem. Though these events started out as competitions, one of the greatest outcomes has been the retention and expansion of community developers actively working to build DeFi on Ergo. 

Ergo’s next hackathon, ErgoHack VI, will run in partnership with ErgoPad! Cypherpunks advocate the widespread use of strong cryptography and privacy-enhancing technologies and are encouraged to explore the realms of Web3, stablecoins, DeFi, and more.

The event will span over a two week period starting on the 8th of February and ending on the 22nd – registrations are open today! Similar to previous Hackathons, we welcome both solo and team participants (of up to 6 people in the group) to the Ergo Discord Server. There, participants can chat with mentors and find other possible teammates (if they are looking for additional members).

Hackathon participants will be free to pursue and build projects that span a variety of DeFi use cases. Utilizing DeFi’s composable building blocks, developers can enjoy the ability to tap into their creativity and build entirely new financial services. If you are looking for suggestions, our judges have prepared some suggestions for products that could be built on Ergo. However, there are no limits and participants are encouraged to submit ideas that explore their inspirations.

Are you ready to build the future of blockchain?

[Tweet](https://twitter.com/Ergo_Platform/status/1620917097835671554?s=20&t=YzxjYxoYUGY55xFE79182w)
2fa on the Command Line
Tags: 2fa, security, tutorial, productivity
Published: 2023-02-05 14:42:36

Two-factor authentication (2FA) is a security process in which a user provides two different authentication factors, other than a password to verify their identity. Implementing 2FA can enhance the security of your systems and applications. In this tutorial, we will see how to implement 2FA using the 2fa command line tool.

**Step 1: Update the Package List**

The first step is to update the package list on your Linux machine. To do this, open a terminal and run the following command:

```bash
sudo apt-get update
```

**Step 2: Install GCC Go Compiler**

The next step is to install the GCC Go compiler. The GCC Go compiler is required to build and install the 2FA library. To install it, run the following command:

```bash
sudo apt install gccgo-go
```

**Step 3: Set GOPATH Environment Variable**

The GOPATH environment variable defines the location of your Go workspace. It is used by `Go` to find the packages and libraries that you need to build your applications. To set the GOPATH environment variable, run the following command:

```bash
export GOPATH=$HOME/go
```

**Step 4: Add Go Binary Directory to PATH**

The PATH environment variable specifies the directories where the system should look for executable files. To add the Go binary directory to the PATH, run the following command:

```bash
export PATH=$PATH:$GOPATH/bin
```

**Step 5: Clone the 2FA Repository**

The next step is to clone the 2FA repository developed by [Russ Cox](https://github.com/rsc). To clone the repository, run the following command:

```bash
git clone https://github.com/rsc/2fa.git
```

**Step 6: Change Directory to 2FA**

Change the current directory to the 2FA repository using the following command:

```bash
cd 2fa
```

**Step 7: Install the 2FA Library**

The final step is to install the 2FA library. To install the library, run the following command:

```vbnet
go install -mod=readonly
```

The `-mod=readonly` flag ensures that the installed module cannot be modified.

**Step 8: Create a Symbolic Link to the 2FA Binary**

The 2FA binary is now installed in the Go binary directory specified by the GOPATH environment variable. You can only run the binary from that directory. To make it easier to access the binary from anywhere, we can create a symbolic link to it in the local bin directory. To create the symbolic link, run the following command:

First, create a `local bin` directory if there isn't exist:-

```bash
mkdir -p $HOME/.local/bin
```

The `-p` flag tells the `mkdir` command to create the specified directory if it doesn't exist.

```bash
ln -s $HOME/go/bin/2fa $HOME/.local/bin
```

Now the 2fa configuration is all done and you can access the command from anywhere.

> eg:- 2fa -add facebook
Trigger CircleCI Workflow. AKA Simple Deploy Button
Published: 2023-02-05 14:29:28

Very simple, no parameters needed, no enums, no booleans... just a really easy way to trigger a deploy with CircleCI. We can do this making use of the [trigger_source](https://circleci.com/docs/variables/#pipeline-values) pipeline value. When you click the button in CircleCI to "Trigger Pipeline" the value would be `api` vs something like `webhook`.

```yaml
version: 2.1
jobs:
  deploy:
    machine:
      image: ubuntu-2204:current
    steps:
      - run: echo 'Deploying...'
workflows:
  deploy:
    when: { equal: [ api, << pipeline.trigger_source >> ] }
    jobs:
      - deploy
```

If your workflow needs a test job, consider doing something a bit more complicated. Here we use two `when` conditions to work with a parameter.

```yaml
version: 2.1
parameters:
  workflow:
    type: enum
    default: test
    description: The workflow to trigger.
    enum: [test, deploy]
jobs:
  test-job:
    machine:
      image: ubuntu-2204:current
    steps:
      - run: echo 'Testing...'  
  deploy-job:
    machine:
      image: ubuntu-2204:current
    steps:
      - run: echo 'Deploying...'
workflows:
  test:
    when: { equal: [ test, << pipeline.parameters.workflow >> ] }
    jobs:
      - test-job
  deploy:
    when: { equal: [ deploy, << pipeline.parameters.workflow >> ] }
    jobs:
      - deploy-job
```

Now your CircleCI config will run tests by default and you can easily trigger a deploy via any branch using the "Trigger Pipeline" button.

![Screen capture of the CircleCI application. This shows the trigger pipeline UI which has the Add Parameter disclosure open. The options Parameter type, Name, and Value have been set to string, workflow, deploy.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5b23gl0yk10sqpv3hur.png)
Insertion Sort (Python Algorithms)
Published: 2023-02-05 14:12:53

[Insertion sort](https://cleancode.studio/python/algorithms-in-python/python-insertion-sort-algorithm) is a [simple sorting algorithm](https://cleancode.studio/algorithms/sorting) that builds the final sorted [array](https://cleancode.studio/data-structures/arrays) (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as [quicksort](https://cleancode.studio/algorithms/sorting/quick-sort-algorithm), [heapsort](https://cleancode.studio/algorithms/sorting/heap-sort-algorithm), or [merge sort](https://cleancode.studio/algorithms/sorting/merge-sort-algorithm). 

```python
def insertion_sort(arr):
    for i in range(1, len(arr)):
        key = arr[i]
        j = i-1
        while j >= 0 and key < arr[j] :
                arr[j + 1] = arr[j]
                j -= 1
        arr[j + 1] = key
    return arr
```

The time complexity of [insertion sort](https://cleancode.studio/algorithms/sorting/insertion-sort-algorithm) is O(n^2).

[Python](https://cleancode.studio/python) 
[Algorithms](https://cleancode.studio/algorithms)
[Sorting Algorithms](https://cleancode.studio/algorithms/sorting)
[Insertion Sorting Algorithm](https://cleancode.studio/algorithms/insertion-sort-algorithm)   
[Python Insertion Sorting Algorithm](https://cleancode.studio/python/algorithms-in-python/python-insertion-sort-algorithm)
How to test Laravel with Sanctum API using the Postman
Tags: laravelframework, webdev, php, api
Published: 2023-02-14 03:54:55

---
title: How to test Laravel with Sanctum API using the Postman
published: true
date: 2023-02-05 14:06:36 UTC
tags: laravelframework,webdevelopment,php,api
canonical_url: https://blog.devgenius.io/how-to-test-laravel-with-sanctum-api-using-the-postman-4e0515b30b82
---

[![](https://cdn-images-1.medium.com/max/2600/0*TpU1dwPA61yrsnIi)](https://blog.devgenius.io/how-to-test-laravel-with-sanctum-api-using-the-postman-4e0515b30b82?source=rss-17217f29618a------2)

Laravel creates an Admin API from scratch - Part 2

[Continue reading on Dev Genius »](https://blog.devgenius.io/how-to-test-laravel-with-sanctum-api-using-the-postman-4e0515b30b82?source=rss-17217f29618a------2)
Bubble Sort (Python Algorithms)
Published: 2023-02-05 14:04:40

[Bubble sort](https://cleancode.studio/algorithms/sorting/bubble-sort-algorithm) is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The [algorithm](https://www.cleancode.studio/python/algorithms-in-python/python-bubble-sort-algorithm) gets its name from the way smaller elements "bubble" to the top of the list. 

```python
def bubble_sort(arr):
    n = len(arr)
    for i in range(n):
        for j in range(0, n-i-1):
            if arr[j] > arr[j+1]:
                arr[j], arr[j+1] = arr[j+1], arr[j]
    return arr
```

The time complexity of bubble sort is O(n^2).



[Clean Code Studio](https://cleancode.studio) ~ [Python](https://cleancode.studio/python) ~ [Algorithms](https://cleancode.studio/python/algorithms)
Business at the Speed of AI
Tags: chatgpt, business, ai, techtrends
Published: 2023-02-05 13:54:39

Today, Artificial Intelligence(AI) plays a crucial role in shaping our online experiences, often driving them.

- When we publish posts on LinkedIn, share blog articles, or tweet, AI algorithms review them along with the hashtags and may reshare, retweet, or add them to relevant newsfeeds.

- Financial trading bots may act on news published by reputable financial outlets regarding a company's results.

- Perhaps the financial article may have been written, assisted by a language model like ChatGPT, just like business proposals, formal and informal emails.

- AI algorithms generate product recommendations, AI-powered recruitment bots screen job applications, and advertising bots target our social media usage.

- Chatbots offer AI-based customer support, Dall-E creates product images, and AI is winning art competitions.

The reality of an **AI-based neuralink** is already here, and it is conceivably not incorrect to say; **business is conducted at the speed of AI**, not speed of human interactions.