teleren/devto huggingface dataset:
Como desplegar NestJS en Deta.sh 🚀
Tags: nestjs, deta
Published: 2022-02-27 19:56:10

---
title: Como desplegar NestJS en Deta.sh 🚀
published: true
date: 2022-02-27 00:00:00 UTC
tags: nestjs, deta
canonical_url: https://adrianub.dev/blog/desplegar-nestjs-en-detash
---

![Como desplegar NestJS en Deta.sh 🚀](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fx3qhgo4fw39r6z46kmy.png)

## ¿Que es Deta.sh?

[Deta](https://deta.sh) es una nube gratuita diseñada pensando en la experiencia del desarrollador y del usuario, nos ayuda crear implementaciones de nuestras ideas en la nube más amigable con los desarrolladores, es totalmente gratuita y para siempre.

En esta podemos desplegar aplicaciones hecha con [NodeJs](https://nodejs.org/) y [Python](https://www.python.org/), donde nos proveen un [Micro](https://docs.deta.sh/docs/micros/about) por cada aplicación desplegada.

## Creación del proyecto NestJS

Para comenzar a crear nuestro clonaremos el starter de [NestJS](https://nestjs.com)

```sh
git clone https://github.com/nestjs/typescript-starter
```

Instalamos las dependencias y vemos que nuestro proyecto corra sin ningun error.

## Configurar proyecto

Primero crearemos nuestro punto de entrada en `src/index.ts`:

```ts
import { NestFactory } from '@nestjs/core';
import { ExpressAdapter } from '@nestjs/platform-express';
import { AppModule } from './app.module';

const createNestServer = async (expressInstance) => {
  const app = await NestFactory.create(
    AppModule,
    new ExpressAdapter(expressInstance),
  );

  return app.init();
};

export default createNestServer;
```

Crearemos un archivo llamado `index.js` en el root de nuestra aplicación:

```js
const express = require('express');
const createServer = require('./dist/index').default;

const app = express();
let nest;

app.use(async (req, res) => {
  if (!nest) {
    nest = express();
    await createServer(nest);
  }
  return nest(req, res);
});

module.exports = app;
```

## Desplegar proyecto

Para poder desplegar nuestra aplicación necesitamos correr los siguientes comandos.

### Compilar

Escribe el siguiente comando en la terminal para compilar tu proyecto:

```sh
yarn build
```

### Iniciar sesión en Deta

Para iniciar sesión en Deta necesitamos correr el siguiente comando:

```sh
deta login
```

### Crear un Micro

Creamos un nuevo micro desde una carpeta anterior a nuestro proyecto:

```sh
deta new --node nombre-del-proyecto
```

### Deploy 🚀

Y por ultimo desplegamos el proyecto ejecutando el siguiente comando en el root de la aplicación:

```sh
deta deploy
```

Luego puedes visitar la url creada por Deta y sacar provecho

Ejemplo: https://7dug2x.deta.dev/
{% embed https://github.com/adrian-ub/nest-deta %}
Section 4.1 - AWS Certified Cloud Practitioner Study Guide
Tags: aws, cloudskills, examprep, cloud
Published: 2022-02-26 23:48:13

**This series is intended to be a personal study guide. Information may not be comprehensive or accurate. I am sharing it in case others find it useful. Please feel free to comment if any information is inaccurate.**

[Return to Exam Guide](https://dev.to/aidutcher/aws-certified-cloud-practitioner-study-guide-exam-guide-outline-233o)

**<u>4.1 Compare and contrast the various pricing models for AWS (for example, On-Demand Instances, Reserved Instances, and Spot Instance pricing)</u>**

[Selecting the Best Pricing Model](https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/select-the-best-pricing-model.html)

- _Identify scenarios/best fit for On-Demand Instance pricing_
     - Short term workloads
     - Workloads that spike periodically
     - Unpredictable workloads that can't be interrupted
     - Pre-production workloads that can't be interrupted but aren't long enough for discounts
- _Identify scenarios/best fit for Reserved-Instance pricing_
     - _Describe Reserved-Instances flexibility_
          - Discounts up to 72% for commitment to a minimum of resources
          -  Available for RDS, Elasticsearch, ElastiCache, Amazon Redshift, and DynamoDB
          - Pricing options of no upfront, partial upfront, and all upfront
          - Terms of one or three years
          - Can be purchased in a Region or a specific Availability Zone
     - _Describe Reserved-Instances behavior in AWS Organizations_
          - [Reference documentation](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ri-behavior.html)
          - AWS Organizations treats all the accounts in the organization as one account
          - All accounts in the organization can receive the hourly cost benefit of Reserved Instances that are purchased by any other account
- _Identify scenarios/best fit for [Spot Instance](https://aws.amazon.com/ec2/spot/) pricing_
     - Uses unused EC2 compute capacity
     - Can be combined with On-Demand and Reserved Instances to optimize savings
     - Discounts of up to 90% off On-Demand prices with no long-term commitment required
     - Can be interrupted with a 2-minute warning if EC2 needs the capacity back, or the Spot Instance price exceeds your configured price
     - Ideal for:
          - Workloads where there is a queue or buffer in place
          - Workloads with multiple resources working independently to process the requests
          - Workloads that are fault-tolerant, stateless, and flexible
          - Non-critical workloads such as test and development environments

[Return to Exam Guide](https://dev.to/aidutcher/aws-certified-cloud-practitioner-study-guide-exam-guide-outline-233o)
Day 1 - Clearing my mind #1
Tags: discuss, blog, mentalhealth, career
Published: 2022-02-26 23:46:42

So I had just gotten over covid and it was hell. I had a 103 fever and it took me about a month to fully recover so I can start back on my Sophia Credits again. I am starting this journal so I can keep evaluating my daily mindset.

Right now I am listening to [coderadio](https://coderadio.freecodecamp.org/). Shout out to free code camp! They have been a big help getting me started with programming and I suggest everyone start there if you are trying to get into the tech space.

I also started a new job at the supermarket out here in Cuba, MO. I left because of low hours and pay. I like it here more because I only have to stock and I don't have to be a cashier. I am an introvert and don't like to talk to strangers because of my social anxiety. A lifetime of having to deal with other humans in abusive group homes and foster homes will do that to you.

I am happy that I have been accepted into the National Society of Leadership and Success (NSLS) program. I just got the email this morning.

On the 5th of March, I plan to ask my girlfriend to marry me and I also find out if we have a kid on the way. I am hoping for a yes to both. We have been trying to have a kid for a year now.

Anyway, Stay awesome everyone, and thanks for reading if you did. This is not really for anyone but me so I can get some stuff out of my head.

Website: [NodeRealm.com](https://noderealm.com)
Work Twitter: [NodeRealm Twitter](https://twitter.com/noderealm)
Personal Twitter: [AaronACombs Twitter](https://twitter.com/AaronACombs)
Discord: [NodeRealm Discord](https://discord.gg/sdRD4g5mC3)

~ Aaron Pinedo (Soon to be Combs)
My aim in coding as a web developer
Tags: tutorial, programming, productivity, discuss
Published: 2022-02-26 23:23:24

> My aim as a developer during coding is to keep my codes sleek and always human-understandable.

```
 * * *
```

> My daily task is to be equipped with the right knowledge and tools to enable me achieve these as I code.

```
 * * *
```

**Stay Blesssed**
`Mr. Paul Ishaili C.`
Taxi driver web template made with NextJs and Tailwindcss
Tags: nextjs, tailwindcss, react, javascript
Published: 2022-02-26 23:06:40

Demo : https://driver-up-company.vercel.app/
Github: https://github.com/waelhassine/DriverUP-Company
**Page Demo**
- Home Page.
- Services
- About Us
- Contact

**Getting started**

- Recommended node js 14+ and npm 6+

- Install dependencies: npm install or yarn install

- Start the server: npm run start or yarn start
**License**
Distributed under the MIT License. See LICENSE for more informatio
So you made a typo in the console...
Tags: bash, cli, commandline, basics
Published: 2022-02-26 22:59:30

So here is a cool thing you can do in #bash or in any #cli or #commandline that I am aware of.

Here is an example, lets create an arbitrary BASH command with a nice obvious typo in it. I'll create some generic files:

```
touch cyan-swatch.txt maagenta-swatch.txt yellow-swatch.txt black-swatch.txt
```
Oops, I made a boo-boo, see it? I mis-spelled the word `magenta`.

So, most people know you can press the ↑ up-arrow and it will show your last-typed command. But then you have to scroll alllll the way over to where you made the typo and manually remove the extra letter or whatever it is you have to do. But there is a better way!

Wouldn't it be cool if there was a way to tell the CLI, _"Hey, I need you to replace this thing with this thing in my last command."_

Here it is:
```
^maagenta^magenta
```
This command will take the last command, substitute the first string `maagenta` with `magenta`, and run the command again.
unexpected EF BB BF
Tags: ssh, bom, utf8
Published: 2022-02-26 22:58:23

Got this little funny hiccup while setting up a remote Ubuntu server.

As soon as I created the user account, I decided to add my public key to `authorized_keys` so I could log in without password. Since Windows doesn't have `ssh-copy-id`, I ran this nifty command in PowerShell:
```
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh {SERVER} "cat >> .ssh/authorized_keys"
```

My public key was copied to `authorized_keys`, perfect! But on the next login I still got the password prompt. What the..? 

I ran `ssh` with `-vv` key to get more info, rechecked everything twice, and finally noticed that the newly added key had some extra characters.
And no, these were not CRLF. This time it was a mysterious EF BB BF sequence also known as [BOM](https://en.wikipedia.org/wiki/Byte_order_mark):
```
> 00000000: efbb bf73 7368 2d72 7361 2041 4141 4142  ...ssh-rsa AAAAB
```
After I removed them, `ssh` recognized my key and everything worked as expected. Don't I just love this stuff!


A couple more useful commands:
```
xxd myfile # hex dump myfile
diff -y <(xxd myfile1.bin) <(xxd myfile2.bin) # compare binaries
```
Task Force 5.0 Second Week
Tags: taskforce, bootcamp, codeofafrica, awesomity
Published: 2022-02-26 22:48:47

We started off with some more codewars challenges, though I consider myself an algorithm genie, some of the katas proved me wrong. on our way home I, Elvis, and Nicolas my Task-Force 5 colleagues, started going through different ways to solve the challenges, and by putting our thoughts together we were able to get passed our difficulties and accomplish our work in time.

always asking or providing assistance requires communication skills. the first step is to hear out the other party, Wiseman once told me `The devil lies in the details`.
while listening you should always, communicate back either verbally, with short words, or with empathetic acts to confirm that you're following one's words, and later ask questions if any. as a developer I get 

![This is time](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y7q48vu0irjqoqb42kw3.jpg)
It was week was Time for new changes, `Winston Churchill said "To improve is to change"`. I have been using `GITHUB` as a professional version-control tool for quite a while now, and I didn't see myself having to change from it, anytime soon. 
Yannick `Awesomity Co-Founder` introduced us to GitLab, and walked us through all the perks it brings to the table and how it is easy to set up and get running. 
At first, I was not on board with the idea, but later on, when he assigned us a task and told us to use GitLab instead, it gave me the opportunity to come out of my comfort zone and learn once something new.

![Group Presentation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rq7w22zbttqoll1op2fw.jpeg)
lastly, I was amazed by our presentation on Friday, which we were told to prepare for in less than 3 hours. we quickly got into teams, and suddenly everyone was focused on preparing their material for the presentation. This shows a great quality of how responsible, dedicated, and attentive good Engineers can be we assigned a task, and concluding The hard work paid off because every group had a great presentation and were able to answer all the questions asked by the audience
Lo que aprendí lanzando un producto digital
Tags: product, webdev
Published: 2022-02-26 22:25:30

Cuando llevas un tiempo programando, ya has realizado varios cursos, viste tutoriales para clonar otras aplicaciones te das cuenta de lo mucho que avanzaste en tus habilidades y ahora puedes crear cosas que otras personas pueden usar.

Aquí van mis aprendizajes y consejos después de haber construido [Konto](https://www.kontope.com/) (plataforma para ahorrar costos de suscripción compartiéndolos con otras personas):

1. **Tendrás que diseñar**

    Y si no diseñaste interfaces antes quizás te cueste, para eso la inspiración ayuda. Puedes buscar diseños de otros productos que hagan algo parecido o diseños de la temática de tu idea en Dribbble y Behance.

    Diseño es más que solo diseñar una vista, diseñar un producto es también definir las funcionalidades en base a lo que quieres resolver.

    En el siguiente hilo te cuento cómo puedes diseñar un producto en 6 pasos:

    {% embed https://twitter.com/nestoredduardo/status/1490832605448912896?s=20&t=ZDWen_qlFsEaNDnR5sWUyA %}

    Cuando le agarres el flow al diseño podrás prototipar cualquier idea que se te ocurra!!!

2. **Resuelve los problemas paso a paso**

    En este proyecto me encontré con varios inconvenientes (era mi primera vez utilizando Firebase sin estar copiando código de un tutorial y tenía que hacer cosas que no había resuelto antes)

    Mi mayor consejo es ir paso a paso, así pienses que hay un chingo de cosas faltantes. 
    Lo que hice fue ir página por página haciendo lo necesario para que estas funcionen.

3. **Las estimaciones no siempre funcionan**

    Algo que pasa cuando te encuentras con un problema nuevo es que no sabes estimarlo, por ejemplo, una feature es que el usuario se pueda unir al grupo y suena simple psdt: No lo fue 😤.

    Además las ideas de lo que falta vienen cuando ya lo estás haciendo y créeme que el cerebro se plantea todas las posibilidades del multiverso.

4. **¿Tenía que hacer marketing?**

    Decidí probar el producto con mis compañeros de la universidad, somos 160 y si 4 se registraban y pagaban por el servicio iba a considerar la prueba un éxito. Eso no pasó, pero me ayudo a superar el miedo al rechazo. Luego de eso no tenia ni idea de como conseguir usuarios.

    Así que amigos devs, si queremos que nuestros productos sean usados debemos aprender a hablar con los usuarios y marketing.

    Si lo haces bien y creas un producto que mucha gente use...no sé que pasa, espero descubrirlo y compartirlo con ustedes.

> Keep building, keep dreaming 🦄
Riot Games Client UI clone with HTML and CSS
Tags: css, html, flexbox
Published: 2022-02-26 22:21:53

---
title: Riot Games Client UI clone with HTML and CSS
published: true
description:
tags: CSS, HTML, Flexbox
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7p0bvptws1x18hzfeir.png
---

Hey guys! I'm coming to this post to introduce you this clone UI of the Riot Games Client that I developed with HTML and CSS. In this project you will see how to implement responsive layout with media queries and input animation.

## Desktop

![Riot Games Client clone desktop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7p0bvptws1x18hzfeir.png)

## Mobile
![Riot Games Client clone mobile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdijqlwskwjuc8i8ii5c.png)

## Input animation
![Input animation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xnkum824bkb7bxa4ljd1.gif)

You can check this project in my [Github](https://github.com/luansilvae/riot-client-clone) and [view demo website](https://riot-client-clone-two.vercel.app/) deployed on Vercel.

I hope you guys enjoy it as much as I enjoyed developing this project. Thanks for reading. 💜
Why did I use JHipster?
Tags: jhipster, webdev, beginners, java
Published: 2022-02-26 22:03:52

---
title: Why did I use JHipster?
published: true
description: I have been thinking that we type a lot of boilerplate code demanded by the technology before the business logic code.
tags: jhipster,webdev,beginners, java
canonical_url: https://renanfranca.github.io/2022/02/24/why-did-i-use-jhipster.html
series: My ❤️ JHipster
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3re5a1uw5vpw1j7m3lfg.jpeg
---

I have been thinking that we type a lot of boilerplate code demanded by the technology before the business logic code.

Even though, as a backend developer, using Spring Boot Annotation, Lombok and maven archetype project doesn't completely solve this issue. Why didn't we already automate the development process itself?

After some research I found JHipster wich is a rapid application development plataform for java web applications and microservices.

### Some of the JHipster options:

• Generate simple monolith web applications

• Generate complete microservice architecture

• Generate domain model (entities)

• Generate Continuous Integration (CI)/Continuous Deployment (CD) pipelines

• Deploy to the cloud or containers

### I am using JHipster because I am tired of:

• Create/Type entity classes

• Create/Type Repository, Services and Controllers classes with CRUD code

• Create integration test for CRUD operation 

• Create DTO classes

• Create Mapper classes

• Configure liquibase

• Configure Security

• Configure spring application yml for each environment
 
  * Database connection 

  * Spring profiles

  * Set framework/library properties

• Manually keep spring boot and the project dependencies updated

• Create yml files to deploy on Kubernetes

**I hope you have the time to try out [JHipster](https://www.jhipster.tech/)**. If you have any questions or just want to say something, please, use the comment section 😊
My Second week experience while in the taskforce 5.0 at CodeofAfrica and Awesomity lab.
Tags: mobile, flutter
Published: 2022-02-26 21:58:42

 **what experience and challenges, did you face in the second week of the taskforce?**

My second week in the taskforce to my experience, I was more comfortable and connected with the team, It was more smooth for me than l was in the first week.

However the challenges l faced in the second week was the introduction of a new course about Gitlab, DevOps, Documentation and we had an opportunity to learn soft skills with Hans(co-founder of Code of Africa) that l had no knowledge about, difficult to graspe and yet essential to know in the tech world. 

These two terms Gitlab and DevOps can be described in definition as;
GitLab is an open source code repository and collaborative software development platform for large DevOps. As for Devops, it is the combination of software development and IT operation

Currently, I keep pressing on to gaining more understanding  to the above terms and looking forward to grasping it regardless how it has been difficult within these session. 

In summary, my second week was more relaxing, interactive and team playing than the previous week regardless the challenges of new courses that came off difficult and challenging so far but occasionally, l know I will finally gain the understanding of the course by the end of the session.__
Codecademy Final Project: Flower Data Search
Tags: codecademy, algorithms, python, codenewbie
Published: 2022-02-26 21:31:22

The final project for Codecademy's data structures and algorithms course in computer science is to make recommendation software. I chose flowers as my topic and types based on flower name, color, life cycle, and season as the categories the user can search for. The flower data includes these categories for every flower and I stored the flower data in a binary search tree using keys of the flower types that apply to every flower.   

## Python Code
The program is written in VS Code and split into six files: the tree node and binary search tree class files, the flower data and flower data BST files, the main program file, and a title image file. 

The flower data BST file builds a binary search tree from the flower data file's flower type keys and data list values and the main program file runs the flower data search through five functions. The `get_list_values()` function and `merge_sort()` algorithm implement an autocomplete based on the beginning of a word and output flower types the user can search for. 

If the user picks a flower type other than flower name (color, life cycle, season, or pet safe), the `user_choice()` function will ask about the other categories to filter their results and if the user picks a flower name, there will only be one data entry to search for. 

The final `flower_data_search()` function asks for the beginning of a word, calls the functions that retrieve and sort flower types, asks for a flower type search word, calls `user_choice()` if necessary, and prints the flower data through the BST's get method. The user can search multiple times and exit the search at one of the exit questions.

See code on [GitHub](https://github.com/cli-cd-ca/recommendation_prgrm)
SvelteKit: Dynamic routes, static renderer
Tags: svelte, devops, webdev
Published: 2022-02-26 21:28:06

I asked the following question on the Svelte discord, but was able to solve it before anyone had a chance to look at the question (classic).

# Question
I have a sveltekit app where I've defined a page as dynamic with the following svelte.config.js
```js
import adapter from '@sveltejs/adapter-static';
...
const config = {
	kit: {
		prerender: {
			entries: [
				"/",
				"/portfolio"
			],
		},
    }
    ...
}
```

because the page `/blogs` and `/blog?file=/some/blog/file.md` are populated by a fetch call to a rest API.

if I don't include the `kit.prerender.entities` I get the following error when I run `npm run build`

> Error: Cannot access url.searchParams on a page with prerendering enabled

The issue is, that when I refresh the page, or route directly to the `/blog?file=/some/blog/file.md` it renders the index page instead of the blog page.

How should I fix this?

Here's an example https://mframe.ca/blog?file=About%20this%20blog.md
- note it should render the blog, not my index page
- you can route to that blog ("About this blog") through https://mframe.ca/blogs

Here's how the `/blog` page works

# Answer
you have to run it in "SPA" mode. by providing a fallback to the adapter
```js
adapter: adapter({
	pages: 'build',
	assets: 'build',
	fallback: 'index.html',
	precompress: false
}),
```

The issue was that it was looking for a /blog/index.html file but it of course wasn't there.

# A better way to selectively prerender
```
<script context="module">
	export const prerender = true;
</script>
```
add this to the pages that you want to prerender, those without this declaration will not be prerendered. you will of course still have to 'run it in "SPA" mode' as noted above.

This is cleaner than the above solution of editing the 
`congif.kit.prerender.entities` in`svelte.config.js`


# More
#### Read more about the blog here: 

https://dev.to/marcdaframe/github-as-a-cms-for-your-blog-fhh

#### View the source code for the blog here:

https://github.com/MarcDAFrame/SvelteGithubBlog