teleren/devto huggingface dataset:
An important lesson I learned.
Tags: javascript, webdev
Published: 2023-06-26 13:43:59

hey!
I'm called Gikundiro I'm going to tell you An important lesson I learned.
An important lesson I learned is Integrated database with php.
Integrated database with php it is to connect database and hph, it helps to insert data into database by using browser and it help us to display data in browser. 
When I was in high school, I liked database and I was good at, when I was in national examination practice I did my project and it run very well but CSS I used it doesn't attractive, panel came to verify my project and he gave many marks because my project it run very well and he told me CSS it is not better than database design and php because my project is management system.
that is reason why I say integrated database with php is An important lesson I learned.
Thank you!!!
How to change "state" during render without infinite loops
Tags: webdev, javascript, beginners
Published: 2023-06-26 13:42:27


You may have encountered a situation where you want to update a state variable inside a component function, but you can't because it triggers an infinite loop of re-rendering. You may also think of using useRef, but the React documentation says "Do not write or read ref.current during rendering." So what can you do? Here's a trick: if you use an external variable, you can write and read it during render. But be careful, it could cause side effects or unexpected behavior. Always make sure you have a clear logic for when and how to update your external variable.

```

let globalVar = 'default value';

export default function App() {
  //somethings happen
  const example = false;
  example ? globalVar : (globalVar = 'New value');
  //setState make a infinity loop here
  
  return (
    <div>
      <h1>Hello!</h1>
      <p>{globalVar}</p>
    </div>
  );
}


```
Run Raspbian VM (ARM) in Docker container
Published: 2023-06-26 13:41:03


# Install Docker

## Arch

```
yay -S docker docker-compose
```

## Ubuntu

```
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
```

## Start & Enable Docker service

```
sudo systemctl start docker
sudo sysyemctl enable docker
```

# Docker Compose

`docker-compose.yml`

```
version: '3.7'
        services:
           raspbian-vm:
               image: hannseman/raspbian
               container_name: raspbian-vm
               privileged: true
               ports:
                 - "2222:2222"
```

## Run Docker-Compose

### Start Service

```
sudo docker-compose up -d
```

### Stop Service

```
sudo docker-compose down
```

# Alternativly run via Docker Command

```
sudo docker run -it -p 2222:2222 --privileged hannseman/raspbian
```

# Connect to Server via SSH

```
ssh pi@servername.de -p 2222
```
KVM/QEMU Raspberry Pi ARM VM
Published: 2023-06-26 13:38:54


This project contains a fully configured `Raspbian Jessie`VM.

## Install QEMU

For the setup you need the `qemu-system-arm` package. **Arch**

```
pacman -S qemu-arch-extra
```

**Ubuntu**

```
sudo apt-get install -y qemu-system-arm
```

## Download Content

Download all following content in one Folder. **Create **`start.sh` file

```
#!/bin/bash
sudo qemu-system-arm \
-kernel ./kernel-qemu-4.4.34-jessie \
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" \
-hda raspbian-jessie.qcow \
-vga std \
-cpu arm1176 -m 256 \
-M versatilepb \
-no-reboot \
-serial stdio \
-net nic \
-net user,hostfwd=::1234-:22 \
```

**Download **`Rasbian Jessie 2017-07-05`

```
wget https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-07-05/2017-07-05-raspbian-jessie.zip
```

**Download **`Qemu Kernel Jessie`

```
wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.4.34-jessie
```

## Convert iso-image to qcow-image

1. 
   Create `QCOW` image from `ISO`.
2. Resize the `QCOW` image.

```
qemu-img convert -f raw -O qcow2 2017-07-05-raspbian-jessie.img raspbian-jessie.qcow
qemu-img resize raspbian-jessie.qcow +6G
```

## Start VM

```
./start.sh
```

## SSH into VM

For Using SSH you first need to enable ssh in the `raspi-config`.

1. 
   Open the raspberry pi vm
2. Run `sudo raspi-config`
3. Goto: `Interfacing Options > SSH > YES`

```
ssh pi@localhost -p 1234
```

### Default Login

```
User: pi
        Password: raspbian
```
SHOW DEV: ArchitectAI.app 🤖 AI instant Makeover for 🏡
Tags: ai, design, architecture, webdev
Published: 2023-06-26 13:36:46

I made this app :) Ask me anything 🎉 [](https://ArchitectAI.app)

Get 5 free renders/day

🏡 ArchitectAI™ , the World's First 🤖 AI interior and architecture designer, transform photos and sketches of your building, interior, landscape to a new style.


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

Whether you're looking to remodel your home, design a new space, or revamp your outdoor areas, ArchitectAI provides an extensive range of choices to suit your preferences.

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

Explore over 50 types of buildings, 185+ architectural styles, 40+ room types, 150+ interior styles, and 45+ landscape styles.

🌆 Generate Outstanding Concepts
🏰 Visualize with Stunning Realism
⏰ Save Time and 💰 Money on Design


Transform your home, design new spaces, or revamp outdoor areas with a wide range of choices to suit your preferences.

(https://ArchitectAI.app)

Get 5 free renders/day
My Dream JOB
Published: 2023-06-26 13:31:51

Ladies and gentlemen Good evening? I am Elyse I live in Rwanda country, eastern province, KIREHE district, I have completed my secondary school last year 2022, I studied computer application and multimedia. 
My dream job was changed because of the different thing I have been leaned, from 2019 my dream job was to be producer caused the combination I learned in junior secondary school, I have been loving the photographic and even after my studies I made my own business of photographic and editing video and song.

Now my dream job was already changed due to the Alight Coding School given me the chance to study Coding. in particularly the teacher of coding is the one who made me to be proud in that course and like it more and how encourage us and show us how it is most important.

that is how my dream job already changed, now my dream job is to be software developer.
thank you!!
Let's Learn About Frontend Development!
Tags: beginners, frontend, webdev, learning
Published: 2023-06-26 13:29:30

Hello, everyone! Today, we're starting a fun journey to learn about frontend development. No matter if you've been working in tech for years or if you're just curious about it, this series will help you understand how we build the parts of websites and apps that people interact with.

## What is Frontend Development?
Frontend development is about creating the parts of a website or app that you can see and touch. It's everything you see when you're surfing the internet. Every button you click, every picture you look at, every form you fill out - that's all part of frontend.

Frontend development is all about bringing designs to life. It's what you experience directly when you use an app or website.

## The Building Blocks: HTML, CSS, and JavaScript
Frontend development is based on three main tools: HTML, CSS, and JavaScript.

1. **HTML (HyperText Markup Language):** HTML is like the blueprint of a webpage. It decides where everything goes and what content is on the page.
2. **CSS (Cascading Style Sheets):** CSS makes a webpage look nice. It picks the colors, the fonts, and how everything is arranged on the page.
3. **JavaScript:** JavaScript makes everything work. It lets webpages do more than just sit there. With JavaScript, buttons can change when you click them, and data can be sent and received.

## Why is Frontend Development Important?
These days, a company's website or app is often the first thing a customer sees. The frontend interface is their first impression of the business.

Good frontend development makes sure that the website or app is nice to look at, easy to use, and works well. It connects the users with the business's systems and makes using web applications easier and more enjoyable.

## Conclusion
Frontend development is a big part of how we use the web. It shapes our online experiences and helps businesses reach their customers more effectively. In the next few weeks, we'll learn more about this important part of web development, including some special lessons on a tool called React.js that many developers love to use.

So, let's get ready to learn more about the amazing world of frontend development!
The Art of Code Design: Demystifying the Liskov Substitution Principle
Tags: php, solid, webdev, phpdevelopment
Published: 2023-06-26 13:25:35

---
title: The Art of Code Design: Demystifying the Liskov Substitution Principle

published: true
description: Learn how to enhance the flexibility and maintainability of your code with the Liskov substitution principle. Discover best practices and real-world examples for writing robust and extensible software

tags: php, solid, webDevelopment, PHPDevelopment
cover_image: https://anastasionico.uk/img/blog/demystifying-the-liskov-substitution-principle-a-key-to-solid-code-design.jpg
---

Imagine you're a skilled architect tasked with designing a magnificent skyscraper.

You meticulously plan every aspect, from the foundation to the intricate details of the facade.

But as construction begins, you realize that different teams are working on different sections of the building without adhering to a common set of guidelines.

 

The result?

 

Incompatible materials, inefficient workflows, and a structure that lacks cohesion.

In the world of software development, a similar scenario can unfold when the Liskov substitution principle is overlooked.

This principle emphasizes that objects of a superclass should be replaceable with objects of their subclasses without affecting the correctness or behavior of the program.

 

It's like ensuring that each piece of your skyscraper's puzzle fits perfectly, seamlessly blending together to create a cohesive and harmonious structure.

By following the Liskov substitution principle, you ensure that your code is built on a solid foundation, allowing for effortless extensibility and maintainability.

 

It promotes modularity and flexibility, enabling you to swap out components or add new features without causing unexpected side effects.

So, just as an architect strives for a structurally sound and visually stunning skyscraper, as a developer, you too can create elegant and reliable software by embracing the Liskov substitution principle.

Let's explore this principle further and discover how it can elevate the quality of your code.

[The Art of Code Design: Demystifying the Liskov Substitution Principle
](https://anastasionico.uk/blog/the-art-of-code-design-demystifying-the-liskov-substitution-principle)
I built with ChatGPT entire all SaaS Code | Ask Me Anything
Tags: ai, chatgpt, webdev, ama
Published: 2023-06-26 13:25:21

Picture this: a person with only a smidgen of coding knowledge decides to take on the challenge of building an AI startup using just chatGPT. 

Why, you ask?  Well, I figured that with the magic of gpt-chatting, I could crack the code to even the most mind-boggling problems. 
And guess what? I actually pulled it off! 

So here's the scoop: [my Project](https://architectai.app) is a SaaS extravaganza, server component is like a superhero, effortlessly handling heavy traffic and having lively conversations with AI through trusty AWS SQS. We've also got an AI API server, a snazzy client-side app that's the talk of the town, and...wait for it...so much more! :) 

But here's the real kicker: within just two days of launching, we already had customers flocking to us like bees to honey. We're making waves, my friend! 

Please feel free to ask any questions you may have, and I'll gladly provide answers.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nrurvocjjti78wc7rosg.png)
The best book I've ever read
Published: 2023-06-26 13:24:55

hello!!
I am a web designer in my life
there is a book was readed to 
my own side called computer science 
combine many topics
on these topics there two may 
covered in those practical reading
such us HTML and CSS all
those topics assist  me to do my 
own Portfolio and websites to use 
in social media for attract any one 
on social media. 
now I'm beginner to programming but 
in welcoming days I will done as
professional programmer because
now I'm start JS(JavaScript).
I'm interested now to accomplish 
many programs for using in many jobs 
which are online .
Thanks to my partner in programming
!!!!.
THE BEST BOOK I HAVE EVER READ
Published: 2023-06-26 13:06:43

Hello, my name is Mugisha Ghad, I'm going to share with you the best book I have ever read.
In my daily life, I like to read different books that talks about the environment.
One day when I was reading the book of geography for senior six,  I have been read the topic called Our Universe, this topic Has answered all questions I had about the universe,  especially the earth's rotation and movement of the sun and other globes.
I like that book because that book helps me to know the difference Between the Earth and other planets, it also helps me to understand as well as what the universe means.
So, it's an amazing time to invite everyone who needs to know about  The universe to read that book of GEOGRAPHY, you will find many and many, and you will improve your knowledge and skills about the environment. thank you!!!!!
Music Monday — What are you listening to? (Sunny Weather Edition ☀️)
Tags: watercooler, discuss, music
Published: 2023-06-26 13:00:00

_cover image source: [Giphy](https://giphy.com/gifs/cool-gif-sun-see-the-hO9kXV85GOHe0)_

**Yeah, I know it's not a musical genre, but there are some songs that just seem to fit sunny days better than others. I'm thinking about those upbeat, feel-good tunes that act as the perfect soundtrack to a warm weather day. So, whatever kinda music you like to pop on for those days, I wanna hear it. Let's go!** 😎

![A graphic of Bob Marley surrounded by colorful patterns](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmetqf5pv2ucvox1ywzv.gif)

***

## How we do 

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others suggestions. You can follow the suggested genre if you'd like, but don't feel confined to it; you're free to suggest whatever you wanna. 🙌  

If you're interested in having other discussions about music, consider following the aptly named [#music discussions](https://dev.to/music-discussions) organization.

{% embed https://dev.to/music-discussions %}  

***

Sun, sun, sun, here it comes. 🌞 _Note: you can embed a link to your song using the following syntax `{% embed https://... %}`. This should work for most common platforms!_

Looking forward to listening to y'all's suggestions! 🎶
Weekly AI News and Discussion Thread
Tags: ai, discuss, news
Published: 2023-06-26 13:00:00

Hey everyone, the past few months have been pretty electric in terms of advancements in AI and actual/imagined changes to our workflow and industry.

This is a regular open thread where everyone is encouraged to share...

* Notable news in the field of AI
* Personal experiences and insights
* Concerns and fears
* Success stories and demos
* And any other related discussions you'd like to bring to the table

This thread will go out every week.
Call, Apply and Bind
Tags: javascript
Published: 2023-06-26 12:35:22

<aside>
💡 In JavaScript, `call`, `apply` and `bind` are three methods that are used to manipulate the ‘this’ context in a particular function.

</aside>

First let me create a simple object to explain this:

```jsx
var person = {
    name : "john",
    hello: function(thing){
        console.log(this.name+ " says hello "+ thing);
    }
}

person.hello("world"); //john says hello world
```

Call, apply and bind allow us to explicitly set the execution context for the this keyword

### call

It is used to invoke  a function with specified this value and individual arguments. The syntax is:

functionName.call(thisArg, arg1, arg2, ...);

```jsx
var person = {
    name : "john",
    hello: function(thing){
        console.log(this.name+ " says hello "+ thing);
    },
};

var alterEgo = {
  name: "Rose"
};

person.hello.call(alterEgo, "world"); //Rose says hello world
```

### apply

It works same as Call method, but here we take array of all our parameters.

for example:

```jsx
var person = {
    name : "john",
    hello: function(thing){
        console.log(this.name+ " says hello "+ thing);
    },
};

var alterEgo = {
  name: "Rose"
};

person.hello.call(alterEgo, ["world"]); //Rose says hello world
```

### bind

It works the same as call , but instead of executing the function, it returns a new function that can be executed later. The syntax is:

```jsx
var newFunction = functionName.bind(thisArg, arg1, arg2, ...);

```

```jsx
var person = {
    name : "john",
    hello: function(thing){
        console.log(this.name+ " says hello "+ thing);
    },
};

var alterEgo = {
  name: "Rose"
};

var helloRose = person.hello.bind(alterEgo, "world");
helloRose(); //Rose says hello world
```
Fortify Rails - Defending Your Ruby on Rails Applications from Bad Actors
Tags: rails, security
Published: 2023-06-26 18:24:50

---
title: Fortify Rails - Defending Your Ruby on Rails Applications from Bad Actors
published: true
date: 2023-06-26 12:34:56 UTC
tags: rails,security
canonical_url: https://fastruby.io/blog/fortify-rails-security-webinar.html
---

On Monday June 12th, 2023, FastRuby.io partnered with [Expedited Security](https://expeditedsecurity.com/) to talk about how to secure your Ruby on Rails application.

In this free webinar [Ernesto Tagwerker](https://mastodon.social/@etagwerker) (FastRuby.io) and [Mike Buckbee](https://ruby.social/@mbuckbee) (Expedited Security) discussed topics of interest related to [Rails security](https://fastruby.io/blog/tags/security) (exploitable ActiveRecord code, vulnerable dependencies, botnets, DDoS, a breakdown of common threats, and more).

You’ll also get a sneak peak of [Wafris](https://wafris.org/), an Open Source service to prevent attackers and dark traffic to your application and of our new [Rails Security Audit](https://www.fastruby.io/security-audit?utm_source=blog&utm_medium=organic&utm_campaign=webinar), a service to detect vulnerabilities and exploitable code in your app!

<!--more-->

Check out the recording of the Fortify Rails webinar here: https://www.youtube.com/embed/KkXTw7UDR9w

Here are the slides on exploitable code and insecure dependencies: https://speakerdeck.com/etagwerker/fortify-rails-webinar

If you want to read more about Ruby and Rails security tooling check out this article: [4 Essential Security Tools To Level Up Your Rails Security](https://www.fastruby.io/blog/rails/security/ruby-security-toolkit.html)

Need a trusted third party to give you a prioritized list of security issues? Check out our [Rails Security Audit](https://www.fastruby.io/security-audit?utm_source=blog&utm_medium=organic&utm_campaign=webinar) service.
5 things I wish I knew before writing 1 Million lines of code
Tags: coding, softwareengineering, codequality
Published: 2023-06-26 12:25:36

Developers spend much more time reading the code than writing it. So, after optimizing code for time and space complexity — optimize it for reading complexity. There’s even a term for that — Cyclomatic Complexity.

After having written more than 1 million lines of code and having read much more awful lot, here are the top 5 things I wish I knew sooner to write more readable code.

## 1. Your code will be read more times than you think.
A common misconception among upcoming and new developers is — Software Development is about writing the O(n) complexity code of binary tree inversion. And I hate to break it to you — it’s not.

A lot of time it’s about, adding a new feature or fixing a bug in an existing code base with its own coding conventions, naming conventions, design, and architecture. So reading and understanding the existing code becomes one of the most important parts of the job.

> Great developers spend a lot of time reading other people’s code.

## 2. Readable code > Smart Code
In almost all programming languages and frameworks, there are numerous ways of doing the same thing. The smarter and one-liner way may feel good to write at the moment, but often it’s not good for the next reader — which can be YOU six months down the line.

So,

> If there is a little more verbose but more readable way to do it — do it and your future self will thank you later.

## 3. Document the “why” instead of “what”.
Usually, I’m against documentation. Because

> The code is literally the instructions written to build something.

The only parts that need documentation are the “why”. Why we’ve written this piece of code this way?

If you don't understand the "what"? Maybe you shouldn't be the one changing it.

## 4. Describe everything your function/method does in the name.
> There are only 2 difficult things in Computer Science — Cache Invalidation and Naming

Just by reading the name of the function, its intent should be clear.

“But then large functions would have way big names” — that’s the point. Your function should do only 1 or a few things and do it properly.

> Refactor the function/method if it’s job can’t be described in the name.

## 5. “Deadline” is a silly excuse for writing bad code.
“There’s no time to write good code” is not a good enough excuse for writing bad code.

> Checking for the readability of your code is like flushing the toilet — it’s part of the ceremony. You do it no matter how late you are for anything else.

So next time you write code, think about your future self, what would you answer to that person? Don’t bring the shame to yourself. Write readable code.

Happy Coding!
My first assignments at my new Tech job
Tags: webdev, beginners, database, java
Published: 2023-06-26 12:18:33

Recently in the previous [post](https://phillipcabrera.com/how-to-act-in-a-job-interview/) I have indicated how you must act in an interview for a job related to technology, it is my pleasure to inform you that I am already working as an information technology analyst and part of the new things I have learned in this new position are:

- Obtain a deeper understanding of the company's databases.
- Learn to run programs developed in Java.
- The most used commands in Linux to work with servers.
- Among others that I will continue posting here.

Despite being a role that is not entirely involved with development, the responsibility is high, since it depends on me to manage and give suggestions to teams such as Infrastructure, DBA, Windows Admins/ UNIX, etc..., on how to proceed to resolve any event that is affecting the normal operation of the company.

My first assignment was to automate some changes at the DB level that constantly had to be done manually, thanks to constant research and the use of AI (only for script correction) I have achieved create this procedure. Working on what you like and above all the challenges give incredible satisfaction. Tomorrow one of the seniors will review my script so fingers crossed that everything goes well.
Having only been in this new position for two weeks (IT Analyst), I still don't have enough context and information with which to share with you, but don't worry, the best will come later.

I will be thank you to suscribe to my personal [blog](https://phillipcabrera.com/).