teleren/devto huggingface dataset:
Redux-like state container in SwiftUI. State composition.
Tags: swift, ios, mobile, programming
Published: 2023-02-18 11:39:15

It is very natural to store your app’s state as a single struct, but it simply can blow up as soon as you add more and more fields to your state struct. We can use state composition to solve this issue. Let’s take a look at the example.

```swift
struct AppState {
    var calendar: CalendarState
    var trends: TrendsState
    var settings: SettingState
}
```
We divide our state into three dedicated pieces and compose them into `AppState`.

---

**Redux** provides a single source of truth, which eliminates tons of bugs produced by multiple states across the app. Best practices. Normalization and composition keep our app state simple and maintainable.

- [State normalization](https://dev.to/sergeyleschev/redux-like-state-container-in-swiftui-state-normalization-108o).
- [State composition](https://dev.to/sergeyleschev/redux-like-state-container-in-swiftui-state-composition-57e5).
- [Reducer composition](https://dev.to/sergeyleschev/redux-like-state-container-in-swiftui-reducer-composition-3j0m).
- [Derived stores](https://dev.to/sergeyleschev/redux-like-state-container-in-swiftui-derived-stores-2d62).

---

**Contacts**
I have a clear focus on time-to-market and don't prioritize technical debt. And I took part in the Pre-Sale/RFX activity as a System Architect, assessment efforts for Mobile (iOS-Swift, Android-Kotlin), Frontend (React-TypeScript) and Backend (NodeJS-.NET-PHP-Kafka-SQL-NoSQL). And I also formed the work of Pre-Sale as a CTO from Opportunity to Proposal via knowledge transfer to Successful Delivery.

🛩️ #startups #management #cto #swift #typescript #database
📧 Email: sergey.leschev@gmail.com
👋 LinkedIn: https://linkedin.com/in/sergeyleschev/
👋 LeetCode: https://leetcode.com/sergeyleschev/
👋 Twitter: https://twitter.com/sergeyleschev
👋 Github: https://github.com/sergeyleschev
🌎 Website: https://sergeyleschev.github.io
🌎 Reddit: https://reddit.com/user/sergeyleschev
🌎 Quora: https://quora.com/sergey-leschev
🌎 Medium: https://medium.com/@sergeyleschev
ChatGPT 3: Google says AI Generated Contents are Against Webmaster Guidelines
Tags: chatgpt, google, webmonetization
Published: 2023-02-18 11:10:33


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/24rzosrha7bgr37s4wi1.jpg)
Are you using AI to generate content for your website? According to Google's Webmaster Guidelines, this could be a violation. As an AI language model myself, I can attest to the importance of producing high-quality, original content. [Click here to learn more about Google's guidelines and how they could impact your website](https://www.steadipulse.com/2023/02/chatgpt-3-vs-google-webmaster-guidelines.html).
8 Effective ways to raise startup capital
Tags: startup, entrepreneur, funding, career
Published: 2023-02-18 11:04:35

Looking to raise startup capital? Check out these eight effective methods that can help you secure the funding you need. From crowdfunding to venture capital, angel investors to bootstrapping, there are plenty of options to explore. [Click here to learn more](https://www.steadipulse.com/2023/02/ways-to-raise-capital-for-startup-business.html)!
Latin x Python: 18/02/23
Tags: webdev, programming, python, latin
Published: 2023-02-18 10:39:55

It's been more than 2 weeks since I started Discipulis, a website whose ultimate aim is to help children around the world learn Latin in a fun way.
My aim for now though is to create a website which can easily generate questions like English-Latin, Latin-English or grammar questions (eg. what case a word is in).
I've added some major updates to the website since then!

---

Features I have added since the 11th of February:
- Added a sorting order for sets (higher priority ones come first)
- Added an english_noun and english_verb page which redirects to the corresponding Latin pages
- Added light mode and switching modes
- Changed the metadata so it’s based on each page and not the whole website
- Added the GPLv3 License to the Repo
- Added a space after the commas in the verb and noun formatting to make it look better
- The same English word can have 2 Latin words for it
- Styled checkboxes
- Added the present passive tense
- Made [the Repo](https://github.com/VulcanWM/discipulis) Public

---

To test out the website yourself, visit https://discipulis.vulcanwm.repl.co
To view the GitHub repo and contribute, visit https://github.com/VulcanWM/discipulis.
Comment below if you have any feedback or feature requests.

---

Thanks for reading.
If you want to support me with this project, make sure to follow me, like this post and contribute to the Repo!
Filament AlertBox
Tags: laravel, filament, opensource, webdev
Published: 2023-02-18 10:29:23

Filament plugin for display a static alert box in your filament forms and widget.

for installation and usage you can see it in the following [documentation](https://koalafacade.github.io/packages/filament-alertbox/).

and there are some preview from alert box:

- as a form
![AlertBox From](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/isf6i2kkszm3ugasc711.png)

- as a widget
![AlertBox Widget](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21yco50pxzdffcco5m4v.jpg)
Advantages of Bullguard Norton Merger
Tags: tutorial, news, html
Published: 2023-02-18 10:20:57

BullGuard was recently acquired by Norton, and now all BullGuard plans have been discontinued and replaced with Norton’s plans. Norton offers many great features, including advanced anti-malware tools, a VPN system optimizer, a gaming booster, and more. Now can use the Norton features in the Bullguard norton merger.

Read more - **[Advantages of Bullguard Norton Merger](https://quicktechy.co.uk/advantages-of-bullguard-norton-merger/)**
Debian in WSL
Tags: wsl, windows, debian, linux
Published: 2023-02-18 10:01:10

This post is my journal on trying debian in WSL and playing around with it as starter.

## Requirements

- Having WSL (WSL2) activated

## Installing Debian WSL

Open Microsoft Store and search for Debian. Get to install and Open after it installed.

![debian wsl microsoft store](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6pzk2uhj91wlc2wccqns.png)

It will launch debian program window. Fill the new user and password to use it.

![debian wsl first initiation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b04vq4093mck869n9p47.png)

## Download Package Information

```
sudo apt-get update
```

![debian wsl apt-get update](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2vfnmva5vv2si5nrq86e.png)

## Checking Debian Version

```
sudo apt-get install lsb-release
```

```
lsb_release -a
```

![checking debian version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7oieven6my7ej3zk9lh5.png)



## Simple Python Server Test in Debian WSL

### Installing Python

```
sudo apt-get install python3
```

![debian wsl installing python](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xc2g329xcr5lidk3ccud.png)

### Verifying Python Installation

```
python3 --version
```

![debian wsl python installation check](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1k5i6zh4d6auew1biun.png)

### Starting a Simple Webserver

Here is the command to start a simple web server in python

```
python3 -m http.server 8000
```

![python simple web server command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/akudruzw5n421q2toeet.png)

Open the `http://localhost:8000` in your browser to confirm if it accessible.

![python simple web server UI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzr6zxagm1t61un0esdx.png)

### Installing Pip (For Further Python Development)

```
sudo apt-get install python3-pip
```

![debian wsl installing python3-pip](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61cj5nd9ep32ea5dxk10.png)

## Browse Files in Visual Studio Code

Install the WSL extension

![VSCODE WSL extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5y3lqlfax8qbinzfjt7.png)

After it installed, you can click the arrow-like icon at bottom-left of VSCode


![VSCODE SSH icon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3oobgmeprwzsnrksfcd.png)

And it will open the menu for SSH connections, pick the `Connect to WSL using Distro` and choose `Debian`


![VSCODE SSH Menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kgm677aqw7nqtg1268wa.png)

It will open a new VS Code window and wait a while for the server connection and then you can browse and manage the files inside the WSL Debian through VS Code. 

You can close the connection to the WSL later by clicking the same arrow-like icon and choose `close connection`.
How to serve angular app to all devices connected to your router ?
Tags: webdev, javascript, angular, beginners
Published: 2023-02-18 09:44:30

Sometimes you might need to see how your site functions on another actual device. Follow these steps to learn how you can do that on angular.

1. Find the IP address assigned by your router to the device on which you are planning to serve the angular app. Use the following commands based on you operating systems.
`$ ifconfig` // for linux
`$ ipconfig` // for windows
In the results you can look for inet followed by the IP address assigned by your router to the device.

2. Then using that IP address use the following command to serve the angular application.
`$ ng s --host=<YOUR_IP_ADDRESS_HERE> --port=<PORT_NUMBER>`
You can replace YOUR_IP_ADDRESS_HERE with the result from step 1 and PORT_NUMBER with any available port number.

3. On another device connected to the same router, type the address `https://<YOU_IP_ADDRESS_HERE>:<PORT_NUMBER>`


Voilà....thats it.
[extra-basic] How to create a SQL Server instance with docker container (linux based)
Tags: docker, sqlserver
Published: 2023-02-18 09:33:26

Hello dears, in this simple article we'll see how to create a SQL Server instance into a docker container (linux based). We'll use the `mcr.microsoft.com/mssql/server:2022-latest` image. Let's go!

1. Create the Dockerfile

```
FROM mcr.microsoft.com/mssql/server:2022-latest

ENV ACCEPT_EULA=Y
ENV MSSQL_SA_PASSWORD=MyStrong@Passw0rd
ENV MSSQL_PID=Developer
ENV MSSQL_TCP_PORT=1433

WORKDIR /src

RUN (/opt/mssql/bin/sqlservr --accept-eula & ) | grep -q "Service Broker manager has started" &&  /opt/mssql-tools/bin/sqlcmd -S127.0.0.1 -Usa -P MyStrong@Passw0rd
```

2. Build our docker image

```
docker build -t henriqueholtz/sql-linux-2022 .
```

3. Run a container with our own docker image

```
docker run -d -p 1433:1433 --name sqlgen henriqueholtz/sql-linux-2022
```

4. Access our container and see make a simple SELECT.

```
docker exec -it sqlgen bash
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "MyStrong@Passw0rd"
> SELECT name FROM master.dbo.sysdatabases
> GO
```

If you are using a Windows with WSL2 (because the docker must be running linux containers), you can also access using the SQL Server Management Studio using the server name `127.0.0.1` for example.


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

Now, with the SQL instance running, you can create your own databases and/or restore from a backup (`.bak`) file.

Crédits: [[Basic] Docker image 🐳 Dockerfile — SQL Server with custom prefill DB scripts](https://medium.com/bright-days/basic-docker-image-dockerfile-sql-server-with-custom-prefill-db-script-8f12f197867a)
Next.js app in production
Tags: nextjs
Published: 2023-02-18 09:27:56

---
title: Next.js app in production
published: true
tags: ['nextjs']
canonical_url: https://sevic.dev/notes/nextjs-production/
---

Consider the following things when the Next.js app is running in production.

- Error tracking and alerting

Error tracking and alerting are crucial in the production environment, proactively fixing the errors leads to a better user experience. [Sentry](https://sentry.io/) is one of the error tracking services, and it provides alerting for unhandled exceptions. You should receive an email when something wrong happens.

Sentry issues show the error stack trace, device, operating system, and browser information. The project dashboard shows an unhandled exception once it's thrown. Run the following commands for integration with the Next.js app.

```bash
npm i @sentry/nextjs
npx @sentry/wizard -i nextjs
```

- `Intl` API is not supported in some browsers. Cover it with a fallback.

- `localStorage` API is not available when cookies are blocked. Cover it with a fallback.

### Boilerplate

Here is the [link](https://sevic.dev/nextjs-starter?ref=devto) to the boilerplate I use for the development.
Entering to the CPP
Tags: cpp, programming, beginners
Published: 2023-02-18 09:05:55

The C++ programming language is apparently very simple and falls into the realm of programming languages that are easier to understand.

Reasons why we should use CPP

The C++ programming language is a widely used programming language worldwide.
C++ can be found on operating systems with all graphical interfaces.
C++ is considered an object-oriented programming language. There is an opportunity to easily change the configured program.
C++ - interesting and very easy to learn.
C++ - you can create programs that are portable and can be adapted to multiple platforms.
Being a programming language close to C++ - C# and the Java programming language, it is very easy to replace.
The C++ programming language is a member of the C programming family, founded in 1985 by Bjarne Stroustrup.
[in progress - blog] Linode + DEV Hackathon
Tags: linodehackathon
Published: 2023-02-18 08:57:32

## What I built


### Category Submission:


### App Link


### Screenshots


### Description
 

### Link to Source Code


### Permissive License


## Background
(What made you decide to build this particular app? What inspired you?)


### How I built it
(How did you utilize Linode? Did you learn something new along the way? Pick up a new skill?)


### Additional Resources/Info


### Blog Entry
##### Feb 18 02:22 PM IST
Finally arrived just in time. Knew about the hacakthon from the start but able to work on it from past few days only. Till now, I have studied Linode and have an idea in mind that I will prbably submit in the Edgeworker category. Lets see how far it can be pushed...
##### Feb 18 09:47 PM IST
And looks like I should've signed up to Linode earlier since payment method is not setting up. I would be building it locally until then.
CodePen Designs - 39 : Interactive particles text create with three.js
Tags: codepen, css, design, webdev
Published: 2023-02-18 08:35:07

### We are excited to introduce our new series that will explore the best design ideas from the Codepen community. 

We will be publishing these each day and hope you find them insightful and inspiring as we showcase some of the most talented designers in this space.

---

---

## Video Tutorial

Don't miss the amazing video we've embedded in this post! Click the play button to be inspired

{% youtube  p6t7Iprd-38 %}

---

---


### Codepen Design - 39 

---

{% codepen https://codepen.io/sanprieto/pen/XWNjBdb %}



---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

5. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)


---
---
PATTERN-THRU-PRACTICAL
Tags: architecture, designpatterns, design, webdev
Published: 2023-02-18 08:30:28

## **MODEL – VIEW – CONTROLLER(MVC)**


What is a Model View Controller?![MVC_Description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/liby7a90a8oewz07f1jn.png)

**MODEL – DATA (BANK HOLDS FINANCIAL DATA IN ITS INFRASTRUCTURE)**
![Model_Data_Bank](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmnbuvm8eyc5b44gtfaq.png)
**VIEW – BANK INTERFACE FOR CUSTOMER(ATM,OFFICE, REPRESENTATIVE)**
![View_ATM_Interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qga7ylq2t2nd34g5u1q3.png)
**CONTROLLER – GETS INPUT FROM CUSTOMERS, OPERATES ON DATA** 
![Controller_BankOfficers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp9ab1vu3hwyf1jm170j.png)
Launching Flasho- Open source customer notifications for developers
Tags: opensource, react, javascript, python
Published: 2023-02-18 08:20:59

Hey guys, we just launched Flasho - an open source tool for developers to set up transactional notifications in minutes with little to no code. You can check out and ⭐ the repo here: [https://github.com/flashohq/flasho]

**How it works**:

- Deploy Flasho on the cloud ([docker or  build from source](https://github.com/flashohq/flasho))
- Connect your PostgreSQL and instantly set up notification triggers from the dashboard.
- Use manual triggers to trigger notifications directly from your codebase

**Why we built it**

Last year when we were building an avatar-based social app, we realised that building notifications took up significant time and development effort (establishing microservices, integrating with a bunch of different service providers etc). And every time we wanted to set up new notifications or make changes to existing ones, we had to make multiple changes across the codebase which was time-consuming and messy. We realised we needed a better way to manage this. Existing solutions were either too expensive or required us to share customer data with third parties. And that is when we decided to build an in-house tool. This tool turned out to be incredibly useful for us. It was a single dashboard to create and manage all our customer notifications across channels. It saved us weeks of developer bandwidth and we could now create and manage notifications without writing any code. We decided to open source this tool and thus [Flasho](https://github.com/flashohq/flasho) was born.

**Next steps**

We currently support Twilio, Sendgrid, Pinpoint, AWS SNS and SES. We will be adding more providers soon. We have SMS and email notifications now. We plan on adding in-app and push soon. We'd love to hear your feature requests.

Our [repo](https://github.com/flashohq/flasho) has instructions for deployment to different cloud providers. We’ve launched this repo under MIT license so any developer can use the tool. We don't intend on charging individual developers. The plan is to generate revenue through a cloud hosted service, priority support etc.

Check it out : [https://github.com/flashohq/flasho] and let us know what you think! Don’t forget to ⭐ the repo if you like it 🙂 Looking forward to your feedback.
How to Capitalize the First Letter in JavaScript
Tags: javascript, tutorial, beginners, programming
Published: 2023-02-18 08:01:10

When programming, it's often necessary to capitalize the first letter of a string. This can be important for formatting names or titles correctly, or for converting user input to a proper format. Luckily, JavaScript offers various approaches for capitalizing the first letter of a string.

The easiest way to capitalize the first letter of a string is to use the `toUpperCase()` method. This method converts a string to uppercase and returns the result. Here's how you can capitalize the first letter of a string using this method:

```js
let str = "hello world"
let capitalizedStr = str.charAt(0).toUpperCase() + str.slice(1)

console.log(capitalizedStr) // "Hello world"
```

We declare a variable `str` with the original string value. Then, we use the `charAt()` method to select the first letter of the string at index 0 and capitalize it with the `toUpperCase()` method. Next, we concatenate this uppercase character with the rest of the string, which we extract using `slice()` method starting at index 1.
Lastly we assign the resulting value to a new variable called `capitalizedStr` and log it to the console.

Another way to capitalize the first letter of a string in JavaScript is to use the `slice()` and `toUpperCase()` methods together. Here's an example of how to use this method:

```js
let str = "hello world"
let capitalizeStr = str.slice(0, 1).toUpperCase() + str.slice(1)

console.log(capitalizedStr) // "Hello world"
```

This method is similar to the previous one, except we use the `slice()` method to extract the first character of the string and convert it to uppercase.

## Capitalize Function

To streamline the code, we can create a utitlity function for the capitalize method and utitlize it whereever needed.

Here's an example:

```js
function capitalize(str) {
  if (typeof str !== "string") {
    return ""
  }

  return str.charAt(0).toUpperCase() + str.slice(1)
}

// Using the function
capitalize("hello world") // "Hello world" ✅
capitalize(12345) // "" ❌
```

Similarly to the previous code examples, the above code capitalizes the first letter of a string. However, it differs by introducing a reusable capitalize function that can be called from anywhere in the application. Additionally, it includes error handling to check the type of the input value using the `typeof` keyword.

_Originally published at [https://geekreflex.netlify.app](https://geekreflex.netlify.app)_
What I've been reading (week 7, 2023)
Tags: watercooler, news, discuss
Published: 2023-02-18 08:00:15

Each week I share a few things that I've been reading. Here's five from this week:

## [How Netlify Uses Storybook for Visual Regression Testing](https://www.netlify.com/blog/storybook-visual-regression-testing)

## [The case for frameworks](https://seldo.com/posts/the_case_for_frameworks)

Laurie Voss's response to Alex Russell's React blog post. I think my view is somewhere between the two of them. React and SPAs were irresponsibly marketed for a decade, and a generation of developers will have started off thinking that Create React App was an appropriate way to build a blog or portfolio site, but I don't think there was much malice behind it, just poor choices at the time and the economic factors that Laurie talks about.

## [Web Applications 101](https://www.robinwieruch.de/web-applications)

At work we're moving from a CSR SPA to a Next.js site, and I imagine some of my team will have never worked on a non-SPA site before. I'm going to take a look at this post and see what bits to borrow when we talk more about the difference between different types of sites/apps.

## [Tackling TypeScript](https://exploringjs.com/tackling-ts/toc.html)

A big free HTML book (paid-for versions also available to support the author) on TypeScript

## [How to create a Next.js app with serverless](https://sst.dev/examples/how-to-create-a-nextjs-app-with-serverless.html)

SST looks like a really interesting project for running Next sites on AWS

---

I also [tweet these as I find them (@philw_)](https://twitter.com/philw_) and post them on my personal site at https://wolstenhol.me/#reading.

What were your favourites? Was there anything you found useful?

{% user philw_ %}