Create an app with Electron and React

How to create an Electron Node.js desktop application using create-react-app 2021 UPDATE: I highly recommend using electron-react-boilerplate instead of the approach described in this post Table of Contents Install Node.js if you haven’t already Move to your development folder Create react app Add electron Install foreman to allow executing the app from command line Install the create-react-app dependencies Configure eslint Enough with the setup! Start up Thanks to When I first used Electron in 2015 it was not yet clear that it would be so pervasive in modern apps, and I was kind of shocked by the resulting app size....

Create Security for Your Future: Becoming Your Own Boss

Gone are the days when being an employee guaranteed job security. Working for someone else means you are at the mercy of their decisions. Imagine dedicating 40 to 60 hours a week to a job only to be let go at the slightest mistake or when your skills are no longer needed. Your destiny is not in your hands when your employer can close the business without any control on your part....

Creating a Desktop App with node-webkit

In this blog post, I will provide an overview of how to use node-webkit to package and deploy a web application for Mac and Windows. Please note that this post may not reflect the latest advancements in this technology. Before diving into the details, I want to clarify that this post will focus on packaging a web app to run on Mac and Windows, excluding Linux. node-webkit, named by its creators, is a web runtime based on Chromium and node....

Creating a Self-Signed HTTPS Certificate for an Express Server

In this blog post, we will learn how to create a self-signed HTTPS certificate for a Node.js application to test locally. A self-signed certificate is sufficient for establishing a secure, HTTPS connection during development, even though browsers may display a warning that the certificate is not trusted. To begin, you need to have OpenSSL installed on your system. If it is not installed, you can check by typing openssl in your terminal....

Creating a Table in SQL

In a SQL database, a table is a fundamental component of a database system. This article will guide you on how to create a table using the CREATE TABLE command in SQL. When creating a table, you need to specify the column names and their respective data types. SQL provides various data types, but the most commonly used ones include: CHAR: fixed-length character string TEXT: variable-length character string VARCHAR: variable-length character string with a maximum length specified DATE: date value TIME: time value DATETIME: combination of date and time TIMESTAMP: date and time, typically used for recording modification times There are also numeric data types available in SQL, such as:...

Creating a TCP Server in Python

In this blog post, we will learn how to create a TCP server in Python using the socketserver package from the Python standard library. TCP (Transmission Control Protocol) is a widely used protocol for transmitting data reliably over a network. Code Example from socketserver import BaseRequestHandler, TCPServer class Handler(BaseRequestHandler): def handle(self): while True: msg = self.request.recv(1024) if msg == b'quit\n': break self.request.send(b'Message received: ' + msg) with TCPServer(('', 8000), Handler) as server: server....

Creating Custom Errors in JavaScript

JavaScript provides a set of 8 error objects that are raised in a try/catch expression based on the type of error encountered. These error objects are: Error EvalError RangeError ReferenceError SyntaxError TypeError URIError If you want to create your own custom errors in JavaScript, you can extend the base Error class. This allows you to handle different error types in a specific way, without relying solely on error messages to determine the type of error....

Cross-component State Management in Svelte: How to Pass State Between Components

In Svelte, handling the state of a single component is straightforward. However, what about passing state between components? In this blog post, we’ll explore different techniques for cross-component state management in Svelte using props, the Context API, and Svelte stores. Passing State Using Props The common strategy in many UI frameworks is to pass state between components using props, also known as “lifting the state up.” When a component needs to share data with another, the state can be moved up in the component tree until there’s a common parent for those components....

CSRF (Cross-Site Request Forgery) - A Comprehensive Guide

CSRF, short for Cross-Site Request Forgery, is one of the most common web attacks, along with XSS and SQL Injection. In simple terms, CSRF attacks trick users into performing unintended actions on a website. These attacks can lead to unauthorized activity, data loss, and other security breaches, making it a topic worth studying and understanding thoroughly. CSRF Using HTTP GET Requests: Let’s begin by exploring the simplest form of CSRF. Imagine you have a database of cars, and a GET request to /api/delete?...

CSS Attribute Selectors: A Comprehensive Guide

Learn how to effectively use CSS attribute selectors in this informative blog post. If you’re new to CSS selectors, I recommend checking out my previous blog post on an introduction to the basic CSS Selectors. There, I cover various fundamental selectors such as type selectors, class selectors, and ID selectors, as well as techniques like combining selectors, targeting multiple classes, styling multiple selectors in one rule, following the page hierarchy with child and direct child selectors, and selecting adjacent siblings....