teleren/devto huggingface dataset:
What is Inertiajs? No API required to connect Backend and Frontend?
Tags: inertiajs, laravel, vue, react
Published: 2022-12-14 17:22:36

Inertia.js is an approach that allows you to build single-page applications (SPAs) using server-side rendering and traditional server-side routing. In other words, it allows you to build SPAs using just PHP (Laravel), Ruby (Rails), or any other server-side language, and client-side framework such as React, Vuejs without worrying about maintaining two different repository, two different domain to host backend and frontend separately.

Inertia has no client-side routing, **nor does it require an API**. Simply you can build controllers and page views in easier way.

One of the easiest methods to get started with React/Vue, Inertiajs and Laravel is by installing Laravel/breeze scaffolding:

- Start a Laravel Project
```SHELL
composer create-project laravel/laravel laravel-inertia-react
```

- Install laravel/breeze in your laravel project.

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

- Then install the frontend scaffolding as per your desire

```
php artisan breeze:install vue
 
# Or...
 
php artisan breeze:install react
 
php artisan migrate
npm install
npm run dev
```

- Run server to view the Laravel/breeze default authentication scaffolding.
```
php artisan serve
```

**Note**: Inertia is not appropriate for those who value SEO, even though inertia make life easier to integrate frontend and backend.

Useful links: [Inertiajs](https://inertiajs.com/), [Laravel-breeze](https://laravel.com/docs/9.x/starter-kits)

**If you liked this post please leave a reaction/comment.**

Read More in [BlazeCodes.com](https://blazecodes.com)
A very short demo to show YugabyteDB follower reads
Tags: yugabytedb, ybwr, follower, consistency
Published: 2022-12-14 17:03:47

Here is a very short demo to show "Follower Reads" feature

I install my [ybwr.sql](https://github.com/FranckPachot/ybdemo/blob/main/docker/yb-lab/client/ybwr.sql) to display tablet server statistics and create a `demo` table where I insert two times 100 rows at 30 second interval:
```sql
\! curl -s https://raw.githubusercontent.com/FranckPachot/ybdemo/main/docker/yb-lab/client/ybwr.sql | grep -v '\watch' > ybwr.sql
\i ybwr.sql
create table demo (x int);
insert into demo select generate_series(1,100);
select pg_sleep(30);
insert into demo select generate_series(1,100);
execute snap_reset;
```

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

I query all rows and display the tablet statistics:
```sql
execute snap_reset;
explain (costs off, analyze, dist)
select * from demo;
execute snap_table;
```

It has read `rows=200` from 3 tablets (ranges `[0x0000, 0x5554]`, `[0x5555, 0xAAA9]`, `[0xAAAA, 0xFFFF]`) from 3 tablet servers (`10.0.0.62`, `10.0.0.61`, `10.0.0.63`) leader (` L `) tablet peer:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mgcizl345w0sc7npt5z9.png)
I'm using packed rows (`--ysql_enable_packed_row=true`), so 200 RocksDB entries, which is a seek() to the beginning of each tablets (`rocksdb_seek=1+1+1`) reading 3 rows and the next() `72+55+70` 197 rows to get the total of 100 rows.

Now in a read-only transaction with follower reads enabled:
```sql
execute snap_table;
set default_transaction_read_only=on;
set yb_read_from_followers=on;
explain (costs off, analyze, dist)
select * from demo;
set default_transaction_read_only=off;
execute snap_table;
```
Only 100 rows are read because the default staleness is 30 seconds (`yb_follower_read_staleness_ms=30000`) and only 100 rows were inserted before:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6umly4snl140x1wuor96.png)
The only difference in the execution plan is `rows=100` without any indication of follower reads. Even the time is similar here because I have 3 nodes on the same VM in this lab. However, the statistics show the same numbers (because all replicas hold the same rows) but from one server only (`10.0.0.61`) and only one leader (` L `). The others were the followers which were preferred to remote nodes (my connection is on `10.0.0.61`) when followers can provide the consistent view from 30 seconds before.
Luos with Freedom Robotics
Tags: embedded, programming, microservices, luos
Published: 2022-12-14 17:00:44

⚡️ We worked together with Freedom Robotics to connect a sensor to your project, allowing you to display what you are working on in real-time. 

Read more about the project in this short blog article: https://www.luos.io/blog/display-your-device-real-time-luos-and-freedom-robotics

Thank you to the team at Freedom Robotics (and especially to Achille Verheye) for the collaboration!
Hero Site Parallax Scroll
Published: 2022-12-14 16:39:23

Zoom out parallax background: 

```
.bg-image{
    height: 100vh;
    width: 100%;
    background-image: url(./bg1.jpg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 160%;
    background-attachment:fixed;
}
```

```
const bgImg = document.getElementById('bg-image');

window.addEventListener('scroll',()=>{
    updateImage();
})

function updateImage(){
    bgImg.style.opacity = 1 - window.pageYOffset/900;
    console.log(1 - window.pageYOffset/900);
    bgImg.style.backgroundSize = 160 - window.pageYOffset / 12 + ('%');
}
```

live site :[zoomout-perallax-background-scroll](https://farhanacsebd.github.io/background-image-scroll-effect/)

---

Fade-type parallax background:

```
background: url(./bg.jpg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
```

```
const bgImg = document.getElementById('bg-image');

window.addEventListener('scroll',()=>{
    updateImage();
})

function updateImage(){
    bgImg.style.opacity = 1 - +window.pageYOffset/550+'';
    //  console.log(1 - +window.pageYOffset/550+'');
    bgImg.style.top = +window.pageYOffset + 'px';
    bgImg.style.backgroundPositionY = -+window.pageYOffset/2 + 'px';
}
```
live site :[Fade-type-parallax-background-scroll](https://farhanacsebd.github.io/background-image-fade-scroll-effect/)
Software Development can be boring!
Tags: programming, productivity, projects, career
Published: 2022-12-14 16:36:23

You don't believe me? Let me tell you my story.

I've been passionate about software development and computer science since the start of 2020 and since then I started learning programming , from language to language improving my skills little by little and then I later joined Rwanda Coding Academy to further make software development my career. What happened later is not far from what you think.
#At Rwanda Coding Academy
I joined the academy and got some mentorship and I learn Frontend Development with React JS and Backend Development with Node JS and I also built a couple of projects to showcase my skills and I embarked on a job seeking journey. I applied to every job post I would come across and after few rejections I started seeking ways to improve my resume and cover letter , social media profiles ,etc..

So basically, I started off with a passion to create but then after many rejections I started get demotivated and later forgot what brought me in this coding career and coding started being boring because I had no other purpose to code than getting some job opportunities which was not actually the real reason I came into this field in the first place.

#Finding what I enjoy is helping me now!
I sat down and realized I have spent a month without having learnt anything new, my Github streak was broken and I hadn't built something at least. So, I decided to try to identify the root cause and I found out it was because I was not being true to myself. I just enjoy building stuff and solving problems , that's what got me into this career so I transitioned and started working on some ideas I had and learning things for the sole purpose of being able to build and solve problems. 

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


#Now things are kinda smooth now!

I haven't been stable yet but at least am working on some projects am passionate about and I really believe something great will come out of that.

#Last words

Just follow your passion and work on something that really interests you or else soon you'll find yourself undergrowing and time will be passing by with you not doing anything productive.
Cloud Computing , let's talk about it [Part 2]
Published: 2022-12-14 16:34:36

Alright ! After knowing what and why cloud computing is implemented and being used , now let's get into Part 2 !

**If you haven't read my previous article, you can read here [Link](https://dev.to/alanliew88/cloud-computing-lets-talk-about-it-3gnp)**

---------------------------------------------------------

Now, Let's talk about basics of cloud computing. 🚀
<br>
**There are 4 Types of Cloud:**

1. Public Cloud 🚌
2. Private Cloud 🏡
3. Community Cloud 👯‍♀️
4. Hybrid Cloud 🏢


---------------------------------------------------------

**Cloud Services Models:**

1. **SaaS(Software as a Service)** Example : BigCommerce, Google Apps, Salesforce, Dropbox, MailChimp, ZenDesk, DocuSign, Slack, Hubspot.

2. **PaaS(Platform as a Service)** Example : AWS Elastic Beanstalk, Heroku, Windows Azure

3. **IaaS (Infrastructure as a Service)** Example: AWS EC2, Rackspace, Google Compute Engine (GCE), Digital Ocean

---------------------------------------------------------

**The Advantages and Disadvantage of Cloud**

1. Lower software cost 💰
2. Improve Performance 🚀
3. Fewer maintenance 🔨
4. Instant Software update 🆙
5. Data safety 🧯

**Disadvantages**
<br>
1. Reliable on strong and consistent internet connections


Share me your thoughts about cloud too in the comment below !

<br>
 
---------------------------------------------------------


to connect, you can add me at [Linkedin](linkedin.com/in/alan-liew/) !
A Quick Guide to Event-Driven Architecture
Tags: php, eventdrivenarchitecture, rabbitmq, eventdrivenpattern
Published: 2022-12-14 16:28:39

---
title: A Quick Guide to Event-Driven Architecture
published: true
description: Learn how programs and microservices take advantage of this pattern
tags: php, EventDrivenArchitecture, rabbitMQ, EventDrivenpattern
cover_image: https://anastasionico.uk/img/blog/a-quick-guide-to-event-driven-architecture.jpeg
---

In 2018, after a series of attacks, the chain of hotels Marriott notified their customers with bad news.

 

They said to them that they lost around 383 million records.
 

Someone connected to their database and stole data and payment details worth millions if not more of dollars.

 

Over the years, there have been many more attacks, and some of them have done even more damage.

 

Both as money and data stolen.

 

Luckily for us, programmers have invented ways to protect this data.

 

We can now make applications more reliable and secure.

 

In this post, we will go over the concept of event sourcing and why it is important to put in place an event-driven architecture in your project.

 

If the security of data and reliability is what you want for your project, let’s jump on this topic!

 
[How does event-driven architecture work?](https://anastasionico.uk/blog/a-quick-guide-to-event-driven-architecture)
Cloud Computing , let's talk about it [Part 1]
Tags: aws, cloud, ec2, amazonwebservice
Published: 2022-12-14 16:22:55

**Does cloud computing sound complicated to you?**


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


Most of the answer I got from people are Yes ! It seems like everyone is talking about cloud and cloud computing but no one ever explain it in a simple way.


First of all, we have to understand why cloud computing is being used in the first place. Let's put it this way.


> Imagine a client came to your IT solutions company and order to make them an applications. They offered you a budget and timeline. You accepted it.


Well you guess it right. Then, you will have to start to develop the applications.


And to make this even more easier to understand, let's make this simple cycle.



```
Development → Testing → Deployment → Production → End User
```



So, this is a typical Software Development process and infrastructure where a company is needed in order to deliver the product and services. You will need certain server, platform, storage and tools for each of the step in the cycle.



And after you have completed the process , all the infrastructures are left behind. You will never use it anytime soon if there is no new projects coming in. Or you will most probably need different configurations , platform, software for next project.



**Hence, all the server , equipment, platform , storage are costing you money.** Purchasing expensive systems and equipment for your business just to carry out one project development.



> Now, let's imagine we can have it all , the Software, Infrastructure, Platform and Storage , just for our current project and we can stop anytime when we do not need it , does it sound good ?



Ta-da, and this is why cloud computing is exists. We can use cloud computing for their ready to use software, infrastructures and platforms, what we do is we only need to configure it to the way we want it to be.



In fact, we only need to pay minimal amount of cost acquiring it on the cloud comparable to physically have it in your office, in order to done the development.



Now, have you got the idea what is cloud computing is ? and why cloud computing is being used?



Share with me what is your special experience with cloud computing at the comment below !



Thanks



to connect, you can add me at [Linkedin](https://www.linkedin.com/in/alan-liew/) !
Enhance Your Google Searches With DALL-E 2 Google Extension
Tags: ai, productivity, programming
Published: 2022-12-14 16:19:51

DALL-E 2 Google Extension is a browser extension that allows you to enhance your Google Images search experience by adding generated images from DALL-E 2 to the search results.


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


## Install from Chrome Web Store

https://chrome.google.com/webstore/detail/dall-e-2-google-extension/debegnklcecggjmakkfjmbhikifklmjm

## Usage

1. Generate an API key for DALL-E 2 by visiting the [API keys](https://beta.openai.com/account/api-keys) page on the OpenAI website.
2. In the extension options, enter the API key and click "Save".
3. Open Google Images and start searching for images to see the generated results.
Announcing Youki 0.0.4 🎉🎉🎉
Tags: rust, opensource, devops, tooling
Published: 2022-12-14 16:07:33

Hello everyone!

For about a year now, I have been doing some open source contributions to a great project called `Youki`. It is a low level container runtime, written in Rust language, which aims to be similar to existing `runc` or `crun` projects, with its own advantages. It has been immense fun to contribute, and I have learnt a lot while doing this, right from writing docs, figuring out stuff in a complex code base to Linux internals such as namespaces, cgroups, and processes.

Today, we are announcing version 0.0.4 of Youki.

## In this release

last release of v0.0.3 was done in April, and this release brings some pretty exciting updates to Youki :

- Now Youki passes all of the contained integration tests, which means it can be used a runtime with containerd like runc or crun
- Adds support for WasmEdge, which is one of the fastest WASM runtimes
- And Many More!

The Full changelog + release notes can be seen here : [https://github.com/containers/youki/releases/tag/v0.0.4](https://github.com/containers/youki/releases/tag/v0.0.4)

Thanks to everyone who [contributed](https://github.com/containers/youki/graphs/contributors) and helped us achieve this! 

Personally, I'd also like to especially mention [utam0k](github.com/utam0k/) and [Furisto](github.com/Furisto/) who helped me a lot!

Check out Youki  at its github Repo :
{% embed https://github.com/containers/youki/ no-readme %}

We also have a nice documentation up at [https://containers.github.io/youki/](https://containers.github.io/youki/) for both users and developers, come take a look!
Trikal-Darshi Mahadev Supremacy
Published: 2022-12-14 15:54:45


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o35a4xnw5lyodr088hhw.png)
**[Trikaldarshi Mahadev Supremacy](https://rudra-angsa.blogspot.com/)** is a popular Indian Hinduism concept of the supremacy of Lord Shiva. Trikaldarshi Mahadev Supremacy is a common phrase in Shiva-related literature, while the alternative term Adyatma-Mahadev is found in the Vedas. The word trikaldarshi translates as "having three eyes", and refers to a form of Shiva, where he has three eyes. This form is regarded as a "complete manifestation" of Shiva, with each eye representing a power of Shiva. The various Shakti scriptures, such as the Devi Mahatmya and the Tripura Rahasya, assert that this form of Shiva is the highest aspect of him. He is the supreme being and is said to be the source of the universe and all that exists.
Adding CI to my SSG
Published: 2022-11-17 01:17:46

Hi everyone,

This week I added CI to my [SSG](https://github.com/NeilAn99/nan1-ssg). I used GitHub's CI service GitHub Actions to accomplish this. It was very easy to set up as I just had to find the Node.js workflow and add it.

This is what the YAML file looks like:

```
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x, 16.x, 18.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - run: npm ci
    - run: npm run build --if-present
    - run: npm test
```

[Here's the link to my successful workflow run.](https://github.com/NeilAn99/nan1-ssg/actions/runs/3457131724)

I also added a test to a [partner's SSG](https://github.com/LostButton/my-button-ssg). Writing a test for their SSG was not difficult as their code was easy to understand. They were using the same testing framework/workflow as me.

I think CI is extremely easy to set up and very useful to have. It's important for the main branch of a project to be running and working at all times.
PMs handbook on managing a software project
Tags: management, devjournal, tutorial, beginners
Published: 2022-12-14 15:25:28

##Plan your development project

Most of the roadblocks that hold down projects can be attributed to—poor planning. Thus, you should get off to a good start because a job well started is half done.

The first stage in managing a project is planning. A solid plan lays out techniques to assist you in achieving your objectives while providing you with clear concepts of your project's goals. You must have a solid understanding of the project's scope and anticipated results to develop an effective working plan.

##Define deadline and milestones 

The process of creating a project scope statement will specify the project's business requirements as well as its limitations. This ensures that everyone important to the project knows its goals and construction process. It lessens the possibility of "scope creep," as everyone is on the same page. 

##Identify and work on potential risks right from the start

The duties of a project manager also include risk analysis and management. You must put methods in place to ensure that these risks do not obstruct the [development of your software project](https://www.simform.com/blog/software-development-outsourcing/). A good manager will be able to evaluate the risks, rank them according to seriousness, and promptly take steps to mitigate them.

##Create a healthy coding environment

Make sure you create a workspace that is ideal for coding. Your developers enjoy writing code, so give them the freedom to do it properly without outside intervention. With the correct encouragement, it will maintain their enthusiasm for coding.

Remember that quality matters more than quantity. Therefore, don't pressurize your developers needlessly. Utilize your planning abilities to distribute anticipated requirements in advance to prevent strangling your development team with impossible deadlines. Your engineers will code better if you offer them more time and room to express their ideas.

##Avoid Micromanagement

You could occasionally lose sight of the value of letting your team do their task in their own unique way because you become so fixated on perfection. Micromanagement is bad for your team's morale as a whole and can reduce rather than boost production.

##Utilize project management tools

You may manage your team more skillfully and productively with the use of project management software to produce the best results possible.

To sum it up, project management software serves as your go-to place for everything project-related. This software allows you to submit project files, critical documents, and changes to instantly reach all of your stakeholders.
cara menambah versi php 7.4 pada vestacp ubuntu
Tags: vestacp, php, ubuntu
Published: 2022-12-14 15:23:38

mungkin ada beberapa dari kalian yang menggunakan vestacp sebagai panel pada server, nah tutorial ini akan membahas bagaimana cara menambah versi php pada panel vestacp.

langsung aja, buka server kalian menggunakan ssh dengan terminal kesukaan kalian.

```
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

add-apt-repository ppa:ondrej/php

apt-get update
a2enmod proxy_fcgi setenvif

apt-get install php7.4-apcu php7.4-mbstring php7.4-bcmath php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-mysql php7.4-soap php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-zip
update-rc.d php7.4-fpm defaults
a2enconf php7.4-fpm
systemctl restart apache2
cp -r /etc/php/7.4/ /root/vst_install_backups/php7.4/
rm -f /etc/php/7.4/fpm/pool.d/*
wget https://github.com/t0rik/vesta-php-fpm-74/raw/master/PHP-FPM-74.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl
wget https://raw.githubusercontent.com/t0rik/vesta-php-fpm-74/master/PHP-FPM-74.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl
wget https://raw.githubusercontent.com/t0rik/vesta-php-fpm-74/master/PHP-FPM-74.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
```
silahkan copy dulu ke notepad atau text editor dan matikan cek warp agar syntax tidak terputus dan work.

yap, selesai

tinggal buka vestacp panel kalian, pilih web yang ingin kalian upgrade php versinya, kemudian klik edit.


![edit web](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pjdpy59y9m31yrg2q8l.png)

kemudian pilih versi php 7.4

![ganti versi php](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5s5lezd82dudfv1e3dz8.png)

lalu save

enjoyyy
Go Source Code From AST Parser
Tags: parser, go
Published: 2022-12-14 15:20:32

I am trying to regenerate source code from ast of a go program. After regenerating the source code, I am trying to match that with the original source code. But the regenerated source code gives some extra spaces in some places of the code. The code is given below.
`
fs := token.NewFileSet()
	f, err := parser.ParseFile(fs, filename, nil, parser.ParseComments)
	if err != nil {
		log.Println(err)
	}
cfg := printer.Config{Mode: printer.RawFormat}
	err = cfg.Fprint(&buffer, fs, f)
	if err != nil {
		log.Println(err)
	}
	source_code, err := os.ReadFile(filename)
	if err != nil {
		log.Println(err)
	}
	buffer_source_code := buffer.String()`

Can someone help me what should I do to get the exact source code as the original from a ast?