teleren/devto huggingface dataset:
AWS Case Study: Reddit Migration to Amazon Aurora
Tags: aws
Published: 2021-05-25 15:20:11

<h3>Reason for Reddit migrating to Aurora</h3>

With more than 30% increase in the user base every year Reddit faced challenges in providing quality service delivery to it's users, in this scenario they had to hire more engineers or invest in more resources but they had another option of switching to a fully managed relational database service.
<br>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zs2iq2infnz24p1xvpa1.png)

<h3> About Amazon Aurora:</h3>
Aurora combines the performance and availability of traditional enterprise databases with the simplicity and cost-effectiveness of open-source databases. For Reddit, the migration resulted in higher database reliability, timelier backup restoration and point-in-time recovery, and fast automated failovers, with failovers taking around 30 seconds.
[source: aws.amazon.com]

<h3>Here's what the Reddit Principal Engineer, Jason Harvey had to say:</h3>
<b>"</b>Using Aurora, we could build a longer-term strategy for how we were dealing with data and do more strategic thinking for long-term projects.<b>"</b>  

[source: aws.amazon.com]

Reddit has been operating much of it's infrastructure on AWS since 2009. Using PostgresSQL on AWS EC2 and using AWS S3 to support data that powered Reddit.com and their native mobile apps.
As their user-base kept on increasing drastically this architecture was no more capable and sufficient as per their agile methodlogies and they decided to migrate to Aurora, one of the AWS Serverless services that entirely took the load off managing the EC2 instances.

<h3>The Migration Process</h3>
Reddit began their migration process in Januray 2020. Migrating 24 PostgreSQL databases on EC2 across Aurora was a intimadating task, but native logical replication in Aurora helped to replicate the databases without any transformation.
Once the data was replicated the Reddit team tested Aurora in their production environment for functionality and high performance. Then they performed a write cutover, but the cutover didn't produce any downtime as EC2 and Aurora have the same API.
Aurora also enabled Reddit's engineers faster point in time recovery and backup restoration along with allowance for using data clones to more easily make data available for other teams for analytics and experimentation requirements.

<h3>Major Benefits of the Migration to Aurora</h3>
<ul>
<li>Higher Database Reliability</li>
<li>Faster Backup Restoration</li>
<li>Point in Time Recovery</li>
<li>Fast Automated Failovers</li>
<li>Improved Productivity for Engineers</li>
<ul>

<h3>Thanks for reading, see you in the next blog!</h3>
Pretty printing JSON.stringify
Tags: javascript, json
Published: 2021-05-25 15:08:17

Most of use `JSON.stringify` a lot to avoid the infamous `"[object Object]"`. But did you know that it had a few more arguments?

`JSON.stringify` takes a total of 3 arguments. The first one is the data, the second is a _replacer function_, and the third one is the _indentation_.

The main topic of this article is the third argument. If you provide a string as the third argument, that string will be used as indentation. Here's an example:

```js
JSON.stringify({a: 'B', c: {d: 'e'}})
// => {"a":"B","c":{"d":"e"}}
JSON.stringify({a: 'B', c: {d: 'e'}}, null, "  ")
// => 
// {
//   "a": "B",
//   "c": {
//     "d": "e"
//   }
// }
JSON.stringify({a: 'B', c: {d: 'e'}}, null, "test")
// =>
// {
// test"a": "B",
// test"c": {
// testtest"d": "e"
// test}
// }
```

You can also pass in a number instead. If you do so, that many spaces will be inserted as indentation:

```js
JSON.stringify({a: 'B', c: {d: 'e'}}, null, 2)
// => 
// {
//   "a": "B",
//   "c": {
//     "d": "e"
//   }
// }
```

Hope this helps you while debugging sometime!
How to remove outside borders of a 3x3 grid using CSS, e.g. Tic-Tac-Toe UI
Tags: css, codenewbie, html
Published: 2021-05-25 15:01:43

I was trying to achieve this kind of UI when I tried implementing the Tic-tac-toe game (I know it looks easy to some XD) ![Tic-tac-toe board](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6tqy8u45qvakni32j0a.png)
The challenge was how to properly select the first and last column, as well as the first and last row. I seriously did not want to manually remove the borders of the eight cells.

The data structure of my tic-tac-toe grid is not two-dimensional, but one, so I can easily do the tricks below. Think of my counting as this :
0 | 1 | 2
3 | 4 | 5 
6 | 7 | 8

For the first row, the top border should be removed, thus: 
```
.board-item:nth-child(-n + 3) {
    border-top: none;
} 
```
For the last column,
```
.board div:nth-child(3n) {
    border-right: none;
}
```

For the first column, 
```
.board-item:nth-child(3n  - 2) {
    border-left: none;
} 
```
 For the last row,
```
.board-item:nth-child(n + 7) {
    border-bottom: none;
}
```

And that is it. Thanks for reading. Check my tic-tac-toe game [here](https://fatrixienicolieopetina.github.io/tictactoe/).
Awesome collections of Resources for fullstack javascript developer
Tags: javascript, github, webdev
Published: 2021-05-25 15:00:06

Hello Developers, In this blog post i will share you some awesome github repos which help you to build future projects with ease


{% github freecodecamp/freecodecamp %}
{% github getify/You-Dont-Know-JS %}
{% github airbnb/javascript %}
{% github trekhleb/javascript-algorithms %}
{% github 30-seconds/30-seconds-of-code %}
{% github goldbergyoni/nodebestpractices %}
{% github thedaviddias/Front-End-Checklist %}
{% github ryanmcdermott/clean-code-javascript %}
{% github tuvtran/project-based-learning %}
{% github sindresorhus/awesome-nodejs %}
{% github leonardomso/33-js-concepts %}

{% github lydiahallie/javascript-questions %}
{% github Leaflet/Leaflet %}
{% github yangshun/front-end-interview-handbook %}
{% github date-fns/date-fns %}
{% github elsewhencode/project-guidelines %}
{% github sorrycc/awesome-javascript %}
{% github mbeaudru/modern-js-cheatsheet %}
{% github ramda/ramda %}
{% github nefe/You-Dont-Need-jQuery %}
{% github verekia/js-stack-from-scratch %}
Deploying A React app on GitHub Pages
Tags: react, github, deployment
Published: 2023-04-23 11:22:25

---
title: Deploying A React app on GitHub Pages
published: true
date: 2021-05-25 14:47:54 UTC
tags: React,GitHub,deployment
canonical_url: https://chrisdevcode.hashnode.dev/github-pages-with-react
---

GitHub offers more than just a host for your code. In this short tutorial, I will walk you through deploying a static react app/project on [GitHub Pages](https://pages.github.com/).

I will be using one of my React projects from GitHub:

[https://github.com/ChrisAchinga/myRepos](https://github.com/ChrisAchinga/myRepos)

> A programmer's learning tool is by practicing --I said that...

Let's Get Started:

**This tutorial assumes you already have your react project setup and ready to deploy**

## Step 1: Install the Dependencies (gh-pages):

I use npm for my projects, so while in your project root directory, open the project on your terminal or cmd (windows).

### Install the _gh-pages_ package as a dev-dependency of the app

```
npm install gh-pages --save-dev

```

## Step 2: Define Homepage in package.json

In the `package.json` file in your react app and add homepage property using the given syntax:

```
http://{username}.github.io/{repo-name}

```

Where {username} is your GitHub username, and {repo-name} is the name of the GitHub repository. Below is an example for my project:

```
"homepage": "http://ChrisAchinga.github.io/myRepos",


{
  "name": "myrepos",
  "homepage": "http://ChrisAchinga.github.io/myRepos",
  "version": "0.1.0",
  "private": true,
}

```

## Step 3: Deploy script in `package.json` file

Now we can add the deploy script in the package.json file. In the existing scripts property, add a predeploy property and a deploy property, each having the values shown below:

```
"scripts": {
  // some code before
  "predeploy": "npm run build",
  "deploy": "gh-pages -d build"
}

```

So your "scripts" should look like this:

```
{
  "scripts": {
    "start": "react-scripts start",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
}

```

## Step 4: Deploy Your App

Update your GitHub repository using git commands:

```
npm run deploy

```

## Step 5: Commit and Push to GitHub

On your project terminal, run the deploy script

```
git add .
git commit -m "gh-pages deploy"
git push

```

Kudos your React app is ready for view... on the URL:

```
https://{github-user-name}.github.io/{repo-name}/

```

https://chrisachinga.github.io/myRepos/

[Deployment Preview](https://chrisachinga.github.io/myRepos/)

### Resources For GitHub Pages

- https://pages.github.com/
Want to compress your pdf files ?
Tags: linux, python, productivity, programming
Published: 2021-05-25 14:41:23

Are you tired of scanning images and trying to shrink them under 25 mbs just so you can send them via email ? Look no further, I am here to save you from this trouble. (that kinda rhymed.)

---

This basic shell script uses *ghostscript* to compress your scanned pdfs significantly. Just yesterday I scanned 100 pages of documents and it was over 90 mbs. I searched for a way to compress them under 25 mbs and voila. Here I was with only 6 mbs of pdfs. *Much wow. Such compression.*

---

**Why** we need it,

- Fast.
- Ez.
- No need to go online. Especially no need to upload company top-secret documents to any website you see on the Internet.
- Possible huge compression without notable loss.

---
Command usage:

`./shrinkpdf.sh in.pdf out.pdf`

#### Don't forget to install *ghostscript*.
---

If you are in a situation exactly like me where there are 100 pdf files under one folder that you want to compress altogether, a simple for loop will suffice.

```python
import os
import subprocess
import sys

infolder = sys.argv[1]
outfolder = "compressed_" + infolder
os.mkdir(outfolder)

for f in os.listdir(infolder):
    subprocess.run(["./shrinkpdf.sh", os.path.join(infolder, f), os.path.join(outfolder, f)])
```

Run this python script,

`python shrink.py pdfs/`

and all of your pdfs will be put under *compressed_pdfs/*.

---

[http://www.alfredklomp.com/programming/shrinkpdf/](http://www.alfredklomp.com/programming/shrinkpdf/)

All the relevant details and more, inside. I humbly wanted to let you know such a useful tool exists.
Swift Performance einrichten und optimieren
Tags: wordpress, cache, geschwindigkeit, swiftperformance
Published: 2021-05-25 18:48:58

---
title: Swift Performance einrichten und optimieren
published: true
date: 2021-05-25 14:35:22 UTC
tags: Wordpress,cache,geschwindigkeit,swiftperformance
canonical_url: https://j0e.org/swift-performance-einrichten/
---

![Swift Performance Einrichten und optimieren](https://j0e.org/wp-content/uploads/2021/05/swiftperformance-einrichten.png)

 Swift Performance einrichten und optimieren – so gehts! Wer Swift Performance gekauft und installiert hat, …

[Swift Performance einrichten und optimieren](https://j0e.org/swift-performance-einrichten/)
Best Hosting for Developer (With Free Trial)
Tags: beginners, webdev, programming, productivity
Published: 2021-05-25 14:24:58

Hi,

If you’re a web developer, you need a web hosting provider that offers the cheapest hosting plan, best hosting features, and as well as excellent support and full backend access.

I recommend 4 web hosting company that can serve you faster and reliably each time so that your website visitors can have a great experience.

## 1. [Cloudways](https://bit.ly/3flm4CY) - 3 Days Free

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0xqzfpfye4kyl7bnn1j.jpg)
 
Cloudways is a managed hosting provider that emphasizes performance and simplicity. From the simple server and application launch to the ongoing server maintenance, Cloudways takes away all the hassles of server management so that you can continue to focus on growing your business.

## 2. [Linode](https://bit.ly/2Tj1eMc) - 100$ Free Credit

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3w2q6qbm0nimcfmcur8.jpg)

Linode is a cloud hosting provider that focuses on providing Linux powered virtual machines to support a wide range of applications. Given its roots, many experts do not see it as a beginner-friendly.

## 3. [DigitalOcean](https://bit.ly/3caXNOn) - 100$ Free Credit

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k1sdwyqk1cflaf1ejjgp.jpg)

DigitalOcean is a cloud infrastructure provider that provides cloud computing services to business entities. It is used to scale by deploying DigitalOcean applications that run parallel across multiple cloud servers without compromising performance.
 
## 4. [Vultr](https://bit.ly/2QQ6EgJ) - 100$ Free Credit

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43vw8jbo6y3kt0caw1nz.jpg)

Vultr provides high-performance SSD cloud servers that boast a global footprint. It aims to create the most reliable and efficient service for launching a blazing fast SSD cloud server.

I tried these 4 hosting presonally for my sites and every hosting perform well but cloud hosting provider doesn't provide contact support only for server, no extra support.
 
If you want good contact support and security in cloud hosting then i recommend [Cloudways](https://bit.ly/3flm4CY).

If you manage complete server and server security from your own then you can go with any hosting listed above but i recommend [Linode](https://bit.ly/2Tj1eMc).

I hope you will choose right hosting :)

Disclaimer - I may receive compensation if you purchase products or services from the links provided in this article.
How to prevent web forms from spam
Tags: spam
Published: 2021-05-25 14:22:07

In the world of today,as a website/blog owner,you tend to receive tons of emails/comments from bots.Different prevention techniques have been taken,this article aims will cover honeypot method.

The honeypot method uses a hidden field on forms,as a trap for "less intelligent" bots who will automatically fill the form.


    <form action="mail.php" method="POST">
    <p>
        <label>Name</label>
        <input type="text" name="first_name">
    </p>
    <p>
        <label>Email</label>
        <input type="email" name="email">
    </p>
    <p id="phone">
        <label>Tel</label>
        <input type="text" name="phone_number">
    </p>
    <p>
        <label>Comment</label>
        <textarea name="your_comment"></textarea>
    </p>
    <p>
        <button type="submit">Submit</button>
    </p>
</form>
 

We then hide the field using CSS,so that visitors(assuming they are human) won't see it.On your CSS file add the following line

   #phone{display: none;}

So here is where the catch is,any submission with not empty phone field,is spam.

if(!empty($_POST['phone_number']))
 die();

Thanks for reading!!.
Practical Angular: The Most Impactful RxJs Best Practice Tip Of All Time (Medium Dev.to auto import)
Tags: rxjs, typescript, webdev, angular
Published: 2021-05-25 14:59:07

---
title: Practical Angular: The Most Impactful RxJs Best Practice Tip Of All Time (Medium Dev.to auto import)
published: true
date: 2021-05-25 14:16:55 UTC
tags: rxjs,typescript,webdev,angular
canonical_url: https://tomastrajan.medium.com/practical-angular-the-most-impactful-rxjs-best-practice-tip-of-all-time-c5d717ec8c4b?sk=abce5f9104a60c1162fa33c79550f15c
---

[![](https://cdn-images-1.medium.com/max/2099/1*1G0DdAxqlG-i4ucDh0kfvg.png)](https://tomastrajan.medium.com/practical-angular-the-most-impactful-rxjs-best-practice-tip-of-all-time-c5d717ec8c4b?source=rss-360cd444e1fc------2)

This easy to follow tip can help YOU and your teammates to simplify and hence improve your projects significantly!

[Continue reading on Medium »](https://tomastrajan.medium.com/practical-angular-the-most-impactful-rxjs-best-practice-tip-of-all-time-c5d717ec8c4b?source=rss-360cd444e1fc------2)
Scrape Any Website Using Curl
Tags: php, curl, website
Published: 2021-05-25 14:15:46

I'm here to tell you How to scrape any website Using PHP cURL method. Here are the basic first line code. Just go through this. You will get idea about scraping. Go Down and check Basic functions of cURL(Client URL Library) .

**curl_init()** : initialize a cURL session. 

**curl_setopt()** : you can set all your options for the transfer.

**curl_exec()** : you can execute the session.

**curl_close()** : you finish off your session.

### Using Above 4 Function, I will fetch [PikaShow](https://pikashow.org) Website details.

`
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://pikashow.org');
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
`
How to Choose Good and Fresh Vegetables that you should know
Tags: vegetable
Published: 2021-05-25 14:08:05

A healthy and fit body is a desire for everyone. To have a healthy and fit body, of course, requires effort that is not easy. In addition to adopting a healthy lifestyle, you also have to be smart in choosing vegetables, because quality vegetables are very good for the health of your body.


If you want to have a healthy and fit body, you are advised to eat more types of foods that contain lots of nutrients and vitamins, one of which is vegetables.

Source:www.rymedia.my.id
Javascript: Alphabet as array
Tags: beginners, javascript
Published: 2021-05-25 14:06:26

Quick and easy way to get alphabetical characters into an array in Javascript.

```  
String.fromCharCode(...Array(123).keys()).slice(97).split('');

// ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
````
Looking for passionate full-stack Ruby on Rails developer in Singapore (GMT+8) time zone
Tags: ruby, rails, hiring, singapore
Published: 2021-05-25 14:04:36

We are a tech company that are reinventing the insurance industry combining data, design, and technology. CoverWallet is expanding across the USA, Europe, and Australia. We have built an incredible team of 400 people (between New York, Madrid, Sevilla, Valencia and Singapore). We are growing our software development team in Spain and Singapore to scale globally within Aon, as the market leader.

We are looking for exceptional fullstack engineers(multiple positions) who love to work with #RubyOnRails #React #RestAPI #CI/CD #Go #scrum

Our systems are built on RoR and we are serving clients on a global scale. We are now building global multitalented platforms so that we can serve new verticals and insure more businesses with our proven end to end digital journeys.

[This](https://charliereese.ca/article/top-50-y-combinator-tech-startups) article contains a list of the top 50 YC software startups (sourced from the October 2019 YC Top Companies page). It contains back-end programming languages used and if you want take your RoR skills to the next level and to join a rocket ship please get in touch with me at `abhay dot bhat at coverwallet dot com`
Não use node.js 10, Angular 12 lançado, Bootstrap 5, Deno 1.1, Playwright, TS 4.3 e muito mais
Tags: javascript, node, react, desenvolvimento
Published: 2021-05-25 14:00:48

Não use mais o node 10! Node 10 chega ao End Of Life, Angular 12 lançado, Bootstrap 5, Deno 1.1, Playwright, TS 4.3, CloudFront Functions, Azure Static WebApp e muitas outras novidades!

As principais novidades da semana, no mundo da tecnologia e do javascript.

Leia a edição desta semana da newsletter em:
https://novidadesjs.substack.com/p/nao-use-nodejs-10-angular-12-lancado

Para se inscrever e receber semanalmente as principais novidades, cadastre-se em:
https://novidadesjs.substack.com/welcome
Object Design Checklist
Tags: codenewbie, webdev, tutorial, programming
Published: 2021-05-25 14:00:44

## This is an index to already published articles on software design.

_There are some rules to follow and embrace to make great software designs. This article will summarize them, serving as an index to full stories._

# Axioms

Build a _MAPPER_

{% post https://dev.to/mcsee/what-is-wrong-with-software-5pa %}

Keep a **bijection** to real entities:

{% post https://dev.to/mcsee/the-one-and-only-software-design-principle-3086 %}

# Corollaries

Do not use **null**

{% post https://dev.to/mcsee/null-the-billion-dollar-mistake-1h1c %}

Avoid **Accidental IFs**

{% post https://dev.to/mcsee/how-to-get-rid-of-annoying-ifs-forever-1jfg %}

Favor **immutability**:

{% post https://dev.to/mcsee/the-evil-powers-of-mutants-1noo %}

Avoid **Setters** and **Getters**:

{% post https://dev.to/mcsee/nude-models-part-i-setters-5c9i %}

{% post https://dev.to/mcsee/nude-models-part-ii-getters-3f2a %}

## Best practices

Avoid **Coupling**:

{% post https://dev.to/mcsee/coupling-the-one-and-only-software-design-problem-2pd7 %}

Fail **Fast**:

{% post https://dev.to/mcsee/fail-fast-48dm %}

Avoid **Meta-Programming**:

{% post https://dev.to/mcsee/laziness-i-meta-programming-32a9 %}

Avoid **Dynamic Code Generation**:

{% post https://dev.to/mcsee/laziness-ii-code-wizards-56p0 %}

Choose **meaningful names**

{% post https://dev.to/mcsee/what-exactly-is-a-name-part-i-the-quest-61k %}

{% post https://dev.to/mcsee/what-exactly-is-a-name-part-ii-rehab-20gd %}

Build a **Theory**

{% post https://dev.to/mcsee/programming-as-theory-building-4l8p %}

Avoid **Accidental** Complexity

{% post https://dev.to/mcsee/coupling-the-one-and-only-software-design-problem-2pd7 %}

Get **Inspired** by Quotes

{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

## Anti Patterns

Do not use **Singleton**:

{% post https://dev.to/mcsee/singleton-the-root-of-all-evil-50bh %}

Avoid Code Smells

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}

## Exercises

{% post https://dev.to/mcsee/how-to-decouple-a-legacy-system-30ke %}

{% post https://dev.to/mcsee/how-to-squeeze-test-driven-development-on-legacy-systems-8m9 %}

{% post https://dev.to/mcsee/how-i-survived-the-zombie-apocalypse-59gj %}

* * *

Part of the objective of this series of articles is to generate spaces for debate and discussion on software design.

We look forward to comments and suggestions on this article.

This article is also available in Spanish [here](https://medium.com/dise%C3%B1o-de-software/guia-para-dise%C3%B1ar-con-objetos-b4b40f2705e5).