teleren/devto huggingface dataset:
Pushing a docker container to Amazon Elastic Container Registry
Tags: aws, docker, cloud, programming
Published: 2022-11-06 14:39:58


## **Hi, Devs!**

First of all, go to [AWS Console](https://aws.amazon.com/pt/console/) and access on search field: Amazon ECR. Access the option view push commands.


![AWS ECR](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aoi3t5a7eqq4sedovqnm.png)

Execute the login command in your local console in your machine:

```cmd
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin<idaws>.dkr.ecr.us-east-1.amazonaws.com
```

After build your docker image before tag it:

```cmd
docker build -t <namebuild> .
```

```cmd
docker tag <namebuild> <idaws>.dkr.ecr.us-east-1.amazonaws.com/<namebuild>
```

Now you could push it:

```cmd
docker push <idaws>.dkr.ecr.us-east-1.amazonaws.com/<namebuild>
```

You'll see in the list your image, now you could just refers the image name to others AWS services like Kubernetes.

![AWS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u1ox6n1479ema42vcaau.png)

**That'all!**

**Contacts**
Email: luizcalaca@gmail.com
Instagram: https://www.instagram.com/luizcalaca
Linkedin: https://www.linkedin.com/in/luizcalaca/
Twitter: https://twitter.com/luizcalaca
Setup VS Code for Competitive Programming with C++ and Live Input Output from file
Tags: vscode, cpp, competitive, programming
Published: 2022-11-06 14:25:03

Today I’ll share with you a very easy way to get vs code working with automatic file input and output for C++ Programming.

Prerequisites — VS Code and MinGW C++ compiler installed on your system. If you don’t have this then install it before hand. You can always refer to the internet if you face any problem.

Now, lets set up vs code for live input and output from file. For this we require a bash shell installed on our system. I prefer Git Bash. Then, I’ll share a folder which is already set up, you just need to download it and start using right away. Let’s see it step wise.

Step 1: Download and install Git on your system. This is the direct link for git: https://git-scm.com/downloads

Step 2: Double click on the exe file and install it.

Step 3: Now Download the zip file from this link: https://github.com/GulshanAnand/VSCodeSetup

Click on green code button and click on download zip.

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

Step 4: Extract the zip file.

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

You’ll see a folder named CP in the extracted folder. This is the folder which will contain all your C++ source code files.



Step 5: Cut and Paste the CP folder to your desired location.

Step 6: Now, right click on CP folder > Show more options > open with code.

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

You’ll see something like this:

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

You can create multiple cpp files inside the ‘codes’ folder.

Step 7: Double click on rough.cpp and input.txt file. Now right click on input.txt tab and click on split right.

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

Step 8: Now put the cursor inside the input.txt file and double click on output.txt file to open it. Right click on output.txt tab and split down.

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

Make sure your workspace looks like this or you can also set this up in your own way.

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

Now you can write your code paste the input in the input.txt file and run the code by pressing CTRL+SHIFT+B, the output will be saved to the output.txt file.

Note : Make sure that your cursor is inside the cpp file that you want to run and then run the code.

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

This is out final result, enjoy working with your new setup, hope you liked it.
Portfolio with more than just technical content, vision and values
Published: 2022-11-06 13:59:01

In this post, I will discuss my policy for updating my website.

https://moeki.dev/

It was to let visitors to my website know what I have in mind when I'm developing.

What I want people to see on my website are the people they may work with in the future or the people they work with in the community on a daily basis. What they really want to know is if I am someone they can be with and be inspired by.

My technical interests and skills do not tell you what I am thinking. So I put my vision and values on the website.

> ## Technology for Living Your Own Way
> I have been saved by technology. However, it has not saved my life or solved my problems. It has nurtured my creativity. Photography, music and software. Without computer technology, I would never have been able to actually put the ideas in my head into reality. It was a world where we could show our photos to many people without exhibition, and where we could make music without playing an instrument. I want to give back to computer technology.

In describe of my vision, I have included the story of how I came to it. Maybe someone who reads it will have a similar story and relate to it. Others may disagree with my view of technology. But that's okay. I wanted the website to have a role in communicating my character to visitors. I would be very happy if visitors took some kind of action (whether like or dislike). Also, knowing someone's vision allows us to discuss the vision behind a particular action instead of just criticizing it.

> ## My Five Values
> 1. Starting with myself to improve my team
> 2. Starting with my neighbors to create a culture
> 3. Making minimal product first to get feedback
> 4. Looking at our daily development
> 5. Solving our own problems in our own way

"My Five Values" proclaims to visitors the way I work. It is important to know what kind of work style the people you work with prefer, because there are a way of working that suits some people and not others. It allows you to acknowledge and accept that your team's values and your personal values may not be perfectly aligned. 
For example, when matching a team with an individual, the most important thing is to strongly identify with each other's values and to acknowledge that our values will never be in complete agreement with each other.

Technical interests and skills may perhaps be important in a temporary business exchange. I am not saying they are not important at all, and I love technology. I also have a strong desire to share it. But don't limit the content of your portfolio website to just that. Find people who not only trust your skills, but who share your way of working.

Thank you for reading.
Why Do We Have Visceral Reactions To LOC Metrics?
Tags: career, codereview, programming
Published: 2022-11-06 13:53:58

I have an almost fight-or-flight response to someone mentioning lines of code a developer commits over a period of time as some kind of measure of their performance. 

In my attempt to constantly improve my own human condition, I like to examine instincts like this to figure out where they're coming from. With all of the Twitter layoffs there's been plenty of mention of them in the news, and for some of us, I think certain metrics can actually provoke a trauma response. 

I'd been mulling over that earlier this morning when I noticed this tweet from Tracy Chou:

{% twitter 1589240102362152964 %}

She's not wrong, and she's also someone I know to be awesome when it comes to work done to make software development better for everyone, so why was my initial reaction to what she wrote dripping with anxiety?

It's the same anxiety I felt on many occasions when an inexperienced manager was using lines of code as a *primary* metric for renewing contracts; this led to a great deal of pain for me and my family. You can guess what happened, right? We associate benign things with terrible memories all the time, why should data be any different?

A competent manager would have looked at me and said "how is all that refactoring going?" after looking at how I was committing, and what I was working on. 

In fact, this whole Twitter thing has really been triggering for a lot of people that worked tech in the late 1990s and early 2000s. We thought we'd gotten past harmful patterns that caused typically benign things - like random data taken out of context - to hurt us. It wasn't just lines of code, managers who never wrote code found all kinds of ways to make work miserable for anyone that still cared about what they did.

I think humans having time to heal from a few decades of very abusive employment practices is absolutely necessary, however inconvenient it may seem to billionaire chaos agents, and I hope the rest of the industry works to speak out.

It's not about lines of code, or even metrics - it's about patterns of abuse that developers were promised would finally be a thing of the past.

Just something to keep in mind: resentment is real, and irrational. And yes, reacting to responsible uses of that metric is acting out of bias, but it's also acting out of real hurt and for some, trauma. 

My advice to myself is: don't get lost in what should or shouldn't be scary to people, it's better to just avoid things that trigger people. We're not going to have a shortage of people looking on in horror for a while, so it matters what we pay attention to. Please, remember and prioritize the human.

If nobody minds how it's used, then it's just benign data. Again, it's not about the data, it's about triggers that can be associated with certain unreasonable metrics.

Chaos agent billionaires are the reasons why we can't have nice things, and often simultaneously why we have them; the only way through it is to remember the human.
How To Open and Add ICS Files to iPhone Calendar.
Tags: ipad, iphone
Published: 2022-11-06 13:34:52

Apple not allowing users to directly be able to add a calendar event file(.ics file) from whatever app they received it actually a pain in the ass of many, and i guess you are one of the many, hence your appearance under this article.

However, there is a way around it; Follow these few steps to easily attach your calendar event file to your iPhone Calendar app other than copying the event details one by one.

1. Attach the .ics file to an email and send(could be to yourself).

2. Open that email on your iPhone and click that attachment, You will see an option to "Accept", "Maybe" or  "Decline" the calendar event to your calendar, Click "Accept" and close the Mail app.

3. Now open the Calendar app on your iPhone and navigate to the day which the event is supposed to be found, now click on the event if found and repeat the latter actions in step 2.

**Boom you are done!!!**

I hope this helped, Kindly leave your thoughts, corrections and suggestions in the comments.

Thanks!

Connect with me : 
[Twitter](https://twitter.com/jonathan_a_edem)
[Instagram](https://www.instagram.com/jake__graphics/)
DTO as a record
Tags: java, programming, record, j2ee
Published: 2022-11-06 13:27:58


With DTOs we're dealing with immutable data more often than not, which means that once an object is created, we cannot change its content.

To accomplish this in Java, we create a class with private, final fields and public accessors.

Take a SpaceShipDTO class for example

```
final class SpaceShipDTO {
    final String name;
    final String description;
    final int weapons;
    
    public SpaceShip(String name, String description, int weapons) {
        this.name = name;
        this.description = description;
        this.weapons = weapons;

    }
    String getName() { return name; }
    double getDescription() { return description; }
    double getWeapons() { return weapons; }

}
```
We can easily replace this with a record

```
record SpaceShipDTO(String name, String description, int weapons){ }

```
This record automatically creates 3 private final fields, public accessor methods, a constructor and implementations of equals(), hashCode(), and toString() methods, all generated by the Java compiler.
Stressful: How can we help laid off Devs from Twitter, Strip..etc?
Tags: job, devjournal, help
Published: 2022-11-06 13:09:23

Dear Developers, 

Our dev community is under fire. Big tech companies are firing people to maintain their own budget. 
They should have thought of this before hiring these people. Really it's outrageous that people get fired overnight or to put them on very stressful situation as what happened in Twitter. 
Literally, people are getting fired during their stand ups and they got logged off. In addition, they are requested to provide an update of their work. 
It's neither human , nor professional to put people under this stress. 
Have they ever thought how trust issues these employees will feel? Later, these companies are asking people to be loyal and devoted to their companies. 
[That's why we (Devjour) advocate to make people take care and track  their mental health and productivity.](https://www.devjour.com)

Nevertheless, we need to help Devs from our community. It's an honest question, what shall we do to help Devs during this time? Please let's think together below...
How to Connect to VSCode to Colab - a collection of methods
Published: 2022-11-06 13:05:30

**see here more methods **

**How to Connect to VSCode to Colab**
https://colab.research.google.com/github/JayThibs/jacques-blog/blob/master/_notebooks/2021-09-27-connect-to-colab-from-local-vscode.ipynb

**Is it possible to connect vscode (on a local machine) with Google Colab (the free service) runtime?**
https://stackoverflow.com/questions/59508225/is-it-possible-to-connect-vscode-on-a-local-machine-with-google-colab-the-fre


**How to Use Google Colab with VS Code**
https://www.freecodecamp.org/news/how-to-use-google-colab-with-vs-code/

**Colab + Vs Code + GitHub + Jupyter (Perfect for Deep Learning)**
https://medium.com/analytics-vidhya/colab-vs-code-github-jupyter-perfect-for-deep-learning-2b257ae94d01

**VSCode on Google Colab**
https://amitness.com/vscode-on-colab/



**How To use Google Colab with VS Code**
https://hackernoon.com/how-to-use-google-colab-with-vs-code-mm1k3765
Zero to SaaS - Product #1 Bookmarksy.io the solution
Tags: webdev, javascript, tutorial, beginners
Published: 2022-11-06 13:00:00

The idea for [Bookmarksy.io](http://Bookmarksy.io) started with a simple statement:

“I wish I could get an email of my twitter bookmarks every week so I didn’t stop forgetting them. Something like The Morning Brew” 

So I went on the internet searching for a solution that might already exist that solves my problem. It didn’t. So I went to work.

Setting up a domain name, email list, landing page, social media, The whole nine yards. But having spoken to some people about this problem, I realize there’s something more here.

It isn’t just difficult to remember to re-visit your twitter bookmarks, the entire concept of bookmarks in twitter is broken! A single stream of un-contextualized tweets or threads, sorted in order of most recently added to least recently added. 

A feed that would allow you to categorize, tag and sort these bookmarks more effectively would be much more useful.

After some brainstorming, here’s the feature list I’d like to go to launch with:

- Bookmark aggregation/consolidation
    - Threads condensed to a single, blog post like display with likes, retweets and replies information
- Contextualization
    - Adding categorization and tagging to bookmarks for storage and retrieval
- Bookmark habits/ Analytics
    - Am I actually using my bookmarks in a meaningful way?
- Daily/ Weekly roundup emails
    - The Morning Brew style emails of my bookmarks for low-effort consumption.
- Bookmark cleanup
    - Once I’ve processed my bookmarks in Bookmarksy.io, I can clean them up from my twitter feed.

What do you think? Is this a good idea? Is this something you would use?

As always, if you’d like to be the first to receive updates, sign up to our waitlist [https://bookmarksy.io](https://bookmarksy.io) !
Migrating a Python Flask App from Heroku to Fly
Tags: python, paas, heroku, fly
Published: 2022-11-06 12:59:47

---
title: Migrating a Python Flask App from Heroku to Fly
published: true
tags: python, paas, heroku, fly
# published_at: 2022-11-06 12:57 +0000
---

This is a description of the process that I've been using to get applications running on Fly with a minimum of changes.

The first stage is actually in Heroku, do any version upgrades to dependencies or language runtime as you would normally do on Heroku. I think this makes everything easier rather than trying to upgrade anything while also trying to sort out the deployment.

This may not affect you but I had the dependency `psycopg2` in all of my apps and only `psycopg2-binary` seemed to work during the image process because the postgres client cannot be compiled. I'm not sure why this worked on Heroku.

Once you have an app on Heroku you're happy with run `flyctl launch` and choose your preferred options. This will create the `fly.toml` file which will be used by the CLI for the next commands. If you don't have it you have to specify your application name with the `-a` parameter.

The setup process will ask to overwrite the Procfile and as far as I can tell you should just not let it and keep your current one.

Now divide your Heroku environment variables into things that are actually secrets (such as API keys) and variables that are just settings. The latter can be placed in the environment section of the `fly.toml` file.

For the secrets you can import things you don't want on the command line by creating a file with each line in the form `NAME=value` and then run `cat secrets|flyctl secrets import`. This will trigger a deployment which will be deferred until you've actually uploaded the app code.

Everything else can be set with `flyctl secrets set NAME1=value1 NAME2=value2 ...`. Watch out for any UNIX substitution that may occur and use single or double quotes on the values as needed.

Now run `flyctl deploy` and the application should have an Docker image built and deployed. So far most of my launch failures have been related to not having the right Procfile or environment setup. Use `flyctl logs` to try and work out what is causing any errors.

As of CLI v0.0.429 I have actually had a pretty Heroku-like experience of importing a project and pushing changes and new versions without having to worry too much about the deployment environment. Unlike my [earlier experiences](https://dev.to/rrees/deploying-a-basic-python-flask-app-to-fly-o2f).

I haven't tried setting up a database as part of this process as I choose to migrate all my databases before I started working on the webapps.
help me choose cms
Tags: help
Published: 2022-11-06 12:05:53

Hello. help me decide on cms. I'm leaning towards codelug. I would like to hear your opinion
https://codecanyon.net/item/cloudarcade-html5-or-web-game-portal-cms/28567973
or
https://codelug.com/item/gamepug-arcade-html5-web-game-portal-cms-5
Merge Multiple Array in to single Array
Tags: javascript, programming, react
Published: 2022-11-06 12:05:34

 If you are merging arrays with multiple elements into a single variable, you can use pre-defined javascript operations such as concat , push, and spread operations.

- **concat operation** creates a new array instead of changing existing arrays.
- **push operation** append/adding new element end of an array and returns the new length of the array
- **spread operation** [ES6] combines your arrays and returns a NEW array.

 Rendered performance

Array concat getting significantly time slower than push operation. because it creates a new array and does the additional time spend to copy the first array over again and again.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/df885fmb9uq5cjs47znr.png)
Creating docker image of microservices and ApiGateway
Published: 2022-11-06 11:53:58

In this article, We are going to dockerize the microservices and apigateway. In last post we have learned about creating microservices and apigateway.
Now, Lets start with apigateway. First create a Dockerfile and .dockerignore file in an apigateway.


![docker apigateway](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pboow0bmv60doghyf4r.png)

Now run a command in a terminal.
> docker build -t dev-apigateway -f Dockerfile .

It will create an image file named dev-apigateway.

Now follow the same step and create a Dockerfiles and .dockeignore files for products and orders microservices.

Products dockerfile should look like this
```
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS base
WORKDIR /app
EXPOSE 80

ENV ASPNETCORE_URLS=http://+:80

FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
WORKDIR /src
COPY ["Products.csproj", "./"]
RUN dotnet restore "Products.csproj"
COPY . .
RUN dotnet build "Products.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Products.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Products.dll"]
```

After creating dockerfile run docker build command.
>docker build -t dev-orders -f Dockerfile .


Orders dockerfile should look like this
```
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS base
WORKDIR /app
EXPOSE 80

ENV ASPNETCORE_URLS=http://+:80

FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
WORKDIR /src
COPY ["Orders.csproj", "./"]
RUN dotnet restore "Orders.csproj"
COPY . .
RUN dotnet build "Orders.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Orders.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Orders.dll"]
```

After creating dockerfile run docker build command.
>docker build -t dev-orders -f Dockerfile .

Now we have a 3 images in docker desktop. We will push those images in docker hub. First create an account on a docker hub. Open a terminal and type docker login. It will ask you to type username and password. Once your login Succeeded then run following commands to push images to docker hub.

> docker tag dev-apigateway siddharthborge99/dev-apigateway

> docker push siddharthborge99/dev-apigateway

In a same way push orders and products images in docker hub. After pushing all images in docker hub. It should look like this.

![Docker hub](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjmy4c7a50rz1zzqpy4u.png)

As you can see in above picture that we have all three images is available. We are going to use those images in deployment on kubernetes.