teleren/devto huggingface dataset:
2 commands you should know if you use VSCode
Tags: vscode
Published: 2022-10-19 04:48:48

I think many of you are using vscode. Of course, I'm also using it everyday to write code and read code.

Recently I needed to reformat a Mac that I use for work.

As many of you know, setting up a Mac is troublesome.

But we can automate that process easily with [ansible](https://www.ansible.com/).

I was wondering that I could include vscode extensions in that automation process?


The answer was `Yes` 🎉🎉🎉

We can use `code` command to install extensions.

To be honest, I didn't know about that until quite recently lol.


In this post, I will introduce 2 commands to you!

## 1 code --install-extension <extension_name>
This command can install an extension.

```zsh
$ code --install-extension vscode-icons-team.vscode-icons
```

## 2 code --list-extensions

This command shows you the list of extensions you installed.
If you use this command with `|`
```zsh
$ code --list-extensions | xargs -L 1 echo code --install-extension
code --install-extension aaron-bond.better-comments
code --install-extension astro-build.astro-vscode
code --install-extension bradlc.vscode-tailwindcss
code --install-extension capaj.vscode-exports-autocomplete
code --install-extension ccimage.jsonviewer
code --install-extension Dart-Code.dart-code
code --install-extension Dart-Code.flutter
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension esbenp.prettier-vscode
code --install-extension formulahendry.auto-close-tag
code --install-extension foxundermoon.next-js
code --install-extension GitHub.copilot
code --install-extension GraphQL.vscode-graphql
code --install-extension GraphQL.vscode-graphql-syntax
code --install-extension ionutvmi.path-autocomplete
code --install-extension jpoissonnier.vscode-styled-components
code --install-extension JuanBlanco.solidity
code --install-extension kamikillerto.vscode-colorize
code --install-extension lacroixdavid1.vscode-format-context-menu
code --install-extension mikestead.dotenv
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-python.python
code --install-extension ms-vscode.cmake-tools
code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.cpptools-extension-pack
code --install-extension ms-vscode.cpptools-themes
code --install-extension oderwat.indent-rainbow
code --install-extension shardulm94.trailing-spaces
code --install-extension slevesque.shader
code --install-extension Souche.vscode-mindmap
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension TaiyoFujii.novel-writer
code --install-extension twxs.cmake
code --install-extension usernamehw.errorlens
code --install-extension vscode-icons-team.vscode-icons
code --install-extension wix.vscode-import-cost
code --install-extension wwm.better-align
```
Termux logo in python
Tags: termux, python, chiki1601
Published: 2022-10-19 04:46:34

Hello friends...

I created Termux logo using Python...

which is shown below:


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

I am glad that I am implementing Python turtle graphics by making various logos🥳🥳🥳🥳🥳
Example Meta Framework Where Client + Server Code Self-Split Within the Same File
Published: 2022-10-19 04:38:05

The below is the beginings of a meta framework that would allow client side code to be rendered via server code by being taking apart from the AST running on the same file.

{% embed https://gist.github.com/reggi/da769b879c48a542f743f6fe6363c724 %}
161 days streak on Leetcode🥳🥳🥳🥳
Tags: chiki1601, misspoojaanilkumarpatel
Published: 2022-10-19 04:36:20

I completed today 161 days strak on Leetcode.....🥳🥳🥳🥳
I am glad that my consistency is increased...and I become a regular person since 161 days...


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

I maintained my consistency for 161 days!
Getting Started on Elixir and Ecto Part 2
Tags: elixir, database, tutorial, github
Published: 2022-10-19 04:17:53

## Database Setup and Connection

> - NOTE: config/config.exs credentials should be correct to be able to make a successful database connection.

```
Run this command : mix ecto.create
Expected response : The database for Taskers.Repo has been created.
```

> - Generate a migration file for our task table, this is a single step in the process of constructing your database.

```
Run this command : mix ecto.gen.migration create_tasks

This command will create a migration file in priv/repo/migrations.
```

{% embed https://gist.github.com/itskenzylimon/a70c7dbdc31b3a15155625ff10413beb %}

When defining the schema, Data Types need to be clearly stated. Types are split into two categories, Primitive types, and Custom types. We will cover the primitive type since its the most used one, in the next section.

> NOTE: The naming convention for tables in Ecto databases is to use a pluralized name.

```
To create tasks table in our database
Run this command : mix ecto.migrate

To undo the changes in the migration incase of misstakes
Run this command : mix ecto.rollback
```
Diameter of Binary Tree
Tags: javascript, leetcode
Published: 2022-10-19 03:47:21

Given the root of a binary tree, return the length of the diameter of the tree.

The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.

The length of a path between two nodes is represented by the number of edges between them.

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

Input: root = [1,2,3,4,5]
Output: 3
Explanation: 3 is the length of the path [4,2,1,3] or [5,2,1,3].

```js
/**
 * @param {TreeNode} root
 * @return {number}
 */
var diameterOfBinaryTree = function (root) {
  let max = 0;

  function maxDepth(root) {
    if (root === null) return 0; // if our root(num) is null then there is no path. return 0/null
    let left = maxDepth(root.left); // Assign the left  of tree to LEFT; this will be easier to call it instead of writing "maxDepth(root.left)" each time
    let right = maxDepth(root.right); //Same above

    max = Math.max(max, left + right); //if the path doesn't go through the root we just get the max of them
    return Math.max(left, right) + 1; // the path goes through the root so we add 1(for the root)
  }
  //since we don't know if the path will go through the root or not we will have to get the max between(path that visits the root, or the path that doesn't go through the root.)
  maxDepth(root);
  return max;
};

```
An error occurred when trying to authenticate to the FCM servers
Tags: firebase, messaging, javascript, node
Published: 2022-10-19 03:07:17




The error message again: `

```
'An error occurred when trying to authenticate to the FCM servers. Make sure the credential used to authenticate this SDK has the proper permissions. See https://firebase.google.com/docs/admin/setup 
```
This error message is about enabling Cloud Messaging and Firebase Cloud Messaging - they are two different services, and both have to be enabled.

Note that yours might not be these two if you are working on a project that requires different services. However, the issue is about enabling required Firebase service.

![Firebase authentication error log](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evvczy6eee5g5pdiezk9.png)


![menu to click to manage api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abbfvjkcnxrl0z5289ab.png)


![Button to Manage project api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hiviw54hichyurr0a5bp.png)


![button to enable the api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nx4pcm4mqzwxf9pg79c6.png)


![cloud messaging enabled](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1tspiz7ripbnwezhl7b4.png)


--------------------

tweet {% embed https://twitter.com/wahabind %} for further assistance!
Working with Django Models
Tags: django, python
Published: 2022-10-19 02:42:03

**Defining a model**

To define the models for your app, modify the file models.py that was created in your app’s folder. The str() method tells Django how to represent data objects based on this model.

```
from django.db import models
"""A topic the user is learning about."""
class Topic(models.Model):
    text = models.CharField(max_length=200)
    date_added = models.DateTimeField(
    auto_now_add=True)

    def str(self):
         return self.text

```
Defining a model with a foreign key

```
class Entry(models.Model):
    """Learning log entries for a topic."""
    topic = models.ForeignKey(Topic)
    text = models.TextField()
    date_added = models.DateTimeField(
    auto_now_add=True)
    def str(self):
        return self.text[:50] + "…"
```

**Activating a model**

To use a model the app must be added to the tuple INSTALLED_APPS, which is stored in the project’s settings.py file

```
INSTALLED_APPS = (
    --snip--
    'django.contrib.staticfiles',
    # My apps
    'learning_logs',
)
```
**Migrating the database**

The database needs to be modified to store the kind of data that the model represents.

```
python manage.py makemigrations learning_logs
python manage.py migrate
```

**Creating a superuser**

A superuser is a user account that has access to all aspects of the project.

`python manage.py createsuperuser`

**Registering a model**

You can register your models with Django’s admin site, which
makes it easier to work with the data in your project. To do this, modify the app’s admin.py file.

```
from django.contrib import admin
from learning_logs.models import Topic
admin.site.register(Topic)
```

[Django Cheat Sheet](https://simplecheatsheet.com/tag/django-cheat-sheet/)
Install Django
Published: 2022-10-19 02:39:12

It’s usually best to install Django to a virtual environment, where your project can be isolated from your other Python projects. Most commands assume you’re working in an active virtual environment.

Create a virtual environment

```
$ python –m venv v
```
Activate the environment (Linux and OS X)

```
$ source v/bin/activate
```
Activate the environment (Windows)

```
venv\Scripts\activate
```
Install Django to the active environment

```
(venv)$ pip install Django
```

[Django Cheat Sheet](https://simplecheatsheet.com/tag/django-cheat-sheet/)
Intro to C++ into Javascript
Tags: javascript, webdev, beginners, programming
Published: 2022-10-19 02:27:34

I've learned C++ before and it's very useful to note that in comparison, if you provide more than one argument in console.log, then it automatically prints out the arguments with a space in between rather than having to place multiple arguments and having to string a space in between each argument(It may have changed since I took it in 2014). It was very different going from having to #include the dev tools I was planning to use or having to type out the using namespace std; into int main ();. Using console.log, returning, or even just calling what I want returned rather than having to write cout >> " "; is also a lot better looking in my opinion. I found it interesting to see that Mozilla Firefox was one of the first browsers that had DevTools.
No.1 Rookie Mistake Tech startup Founders Do
Published: 2022-10-19 02:10:03

## Hey there!

Have you always wanted to become a** tech startup founder **or build your own** SaaS?**

Or you already have one and are not sure if it will ever be *successful*.

Well… You can decide whether it's going to be successful or not, by avoiding this *#1 rookie mistake 💯*

When you talk about building a *tech startup* or *SaaS* what's the **first thing** that comes to your mind?

Most of the **time**, you start thinking about the product or what you have to offer.

> That's where you fail.

## Yesterday

 I was having a chat with my team and I asked them the question – If I gave you 30 days to prove that your tech *startup/SaaS* is going to be successful, what would you do?

The *answers *that came from the *marketing team* and the software *development team* was completely different.

The software development team's answer was…
 > We would try to find competitor apps, see where we can find create an edge and build an MVP of the app in 30 days.

The marketing team's answer was… 
> We would build a landing page or something and promote it on social media to see if there is an interest among people for the idea.

Both teams were wrong ❌

The correct answer is quite simple and is just 2 words.

> Can you take a guess?

⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐

**It's "Paying Customers".**

## If 
If you cannot get a single* paying customer* for your supposed SaaS, then it's never going to be successful because you're never going to generate revenue from the SaaS.

There was this video by   [NoahKagan](https://www.youtube.com/watch?v=Lz8qWI1ixGs&ab_channel=NoahKagan)– Founder of a *multi-million dollar SaaS* "AppSumo" on building a Million Dollar Startup in 24 Hours.

> In his *video*, the first thing he did was *analyze *the business idea and figure out a business model and the second most important thing he did was get a few paying customers.

It can either be your* friends, colleagues,* or anyone you believe could get value from your **SaaS**.

If you manage to make *$100* in the first week by pitching the idea without actually having the app, then its a matter of time until you build an *MVP* and scale your *SaaS * to $1000/month, $10,000/month, and even $100,000/month 🚀

Let me give you a **challenge** 🔥

  1. Brainstorm 5 SaaS/Startup Ideas by yourself and write it down.

2.   Figure out a business model (way to generate revenue for the business) – It can be a monthly subscription, a one-time fee, or whatever you think suits best.

3.   Pitch it to your friends/family and try to make $100 in the first 7 days before you even start focusing on building the product

4.   If you succeed in making $100, build an MVP and share it with your paying customers. Get feedback from them, and improve.

5.  Launch your startup 🚀

**📝 Note**: Keep in mind that it doesn't have to be **$100**, it can either be **$50** or even **$500** it just depends on how much valuable the product is going to be for a customer.

Looking forward to hearing your SaaS/Startup ideas ❤️

Love your beautiful face,
AWS: Create VPCs, Subnet's, NatGateway and InternetGateways with Terraform
Tags: aws, terraform
Published: 2022-10-19 01:01:30

**Install Terraform and create a custom VPC**

I am learning to create Infrastructure with Terraform from scratch, I decided to apply what I learned and be able to share it with you.
Any comments on how to improve these instructions let me know.
I hope you find this helpful

The instructions below are for Windows .

1. Install VSCode from https://code.visualstudio.com/
2. Install Terraform from https://chocolatey.org/install
3. Install GIT from https://git-scm.com/downloads
4. Install AWS CLI from https://awscli.amazonaws.com/AWSCLIV2.msi

We will proceed to configure our AWS Credentials with CLI.
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html

After having the necessary tools, we will proceed to clone the repository.
https://github.com/lguerraq/AWS-VPC

We will open the cloned folder with VSCode.

We will place the name of the configured profile in the Credentials file (/.aws/credentials)
```
variable "profile" {
  description = "Profile for providers"
  type        = string
  default     = "NameProfile"
}
```
With the aforementioned we will proceed to apply the Terraform commands for the deployment.

```
### Init terraform
 *  terraform init

 ### Validate terraform
 *  terraform validate

 ### Fmt terraform
 *  terraform fmt

### Plan terraform by environment
 *  terraform plan -var-file environment-vars/prd.tfvars

### Apply terraform by environment
 *  terraform apply -var-file environment-vars/prd.tfvars

### Destroy terraform by environment
 *  terraform destroy -var-file environment-vars/prd.tfvars
```
https://www.terraform.io/cli/commands

Until the execution of Terraform apply we will validate that our VPC was created correctly.

To destroy the VPC we will execute Terraform destroy.
Day 13
Tags: blog, showdev, nextjs, firebase
Published: 2022-10-19 00:59:24

# MILESTONE

I created my first full-stack app without an tutorial or anything. I created a application where you can search for meals and save or delete those meals. When you click the meal title it gives you information about the meal including a YouTube video for you to reference. Overall I am so proud of myself because this is the first full stack project that I have every made that includes a database and a front-end. [Click me to go to the page!](https://meals-saver.vercel.app)
What occurs if the agreement is canceled?
Tags: education, writing, assigments
Published: 2022-10-19 00:37:17

Even if we try our best, there are times when we have to part ways. It doesn't suggest that you were a bad client or that the ghostwriter you hired was below average. Sometimes timelines don't work, communication breaks down, or personal issues come into play. Understanding what will happen to your idea and research is a crucial first step in protecting your intellectual property (not to mention, it will help the [memoir ghostwriter services](https://www.ghostbookwriters.org/services/memoir-writing) to know what happens with the work they have completed up to that point).
TDD en NodeJS, guía de tests con Jest, inyección de dependencias, test unitarios, y test de integración con superTest
Tags: javascript, spanish, node, tdd
Published: 2022-10-19 00:15:49

Test driven development con NodeJS y jest. Inyección de dependencias, test unitarios, test de integración con superTest, para probar absolutamente toda la cadena

¡Lleva tu código escrito en NodeJS al siguiente nivel escribiendo pruebas unitarias y de integración con Jest! Una herramienta potente y flexible creada por Facebook que facilita la escritura de pruebas unitarias y de integración.

Repositorio: [https://github.com/dennysjmarquez/tdd-en-nodejs-guia-de-tests-con-jest](https://github.com/dennysjmarquez/tdd-en-nodejs-guia-de-tests-con-jest)

{% embed https://stackblitz.com/edit/tdd-en-nodejs-guia-de-tests-con-jest?file=README.md&view=editor %}
HELLO WORLD! 👋🏾 😀
Tags: beginners, cloud, career, devops
Published: 2022-10-19 00:11:54

É com prazer que eu, [Sergio Francisco](https://dev.to/srgfrancisco), anuncio a [EdukTI](https://edukti.com). 🎉

Sou **Arquiteto e Engenheiro de Nuvem com mais de uma década de experiência** na área de Infraestrutura de TI e apaixonado por aprender e ensinar.

Criei a EdukTI para ensinar Cloud Computing de maneira simples e descomplicada.

Minha missão com este projeto é transmitir meu conhecimento para pessoas que desejam iniciar, migrar ou progredir dentro do mercado de computação em nuvem.

Neste espaço, eu vou te ensinar Cloud Computing e DevOps de maneira simples e descomplicada, através de tutoriais, guias, análises, entre outros tipos de conteúdo.

Leia a página abaixo para saber mais sobre esse projeto:
🔗 https://edukti.com/sobre/

E, claro, já segue a EdukTI nas redes sociais para não perder nenhum conteúdo! 😉

[LinkedIn](https://www.linkedin.com/company/edukti/)
[Instagram](https://www.instagram.com/edukti/)
[Facebook](https://www.facebook.com/edukti1)
[Twitter](https://twitter.com/edukti1)
[GitHub](https://github.com/edukti1)
[Dev.to](https://dev.to/edukti)
LinkedIn Learning: GitHub Advanced Security
Published: 2022-10-19 12:56:26

---
title: LinkedIn Learning: GitHub Advanced Security
published: true
date: 2022-10-19 00:00:00 UTC
tags: 
canonical_url: https://devopsjournal.io/blog/2022/10/19/LinkedIn-Learning-GHAS
---

My LinkedIn Learning course on GitHub Advanced Security (GHAS) has been released! In this course I teach you all about the features of Advanced Security:

- Dependabot
- Code scanning
- Secret scanning

You can watch it with a LinkedIn Learning account (30 day trial is available) with this link: [GHAS on LinkedIn Learning](https://www.linkedin.com/learning/github-advanced-security/github-advanced-security?autoplay=true).

# Teaser for the training:

[![Link to the teaser video](https://devopsjournal.io/images/2022/20221019/20221019_LIL_Teaser_Still.jpeg)](https://youtu.be/HTfi5NnZbmA)
Ibis Template
Tags: documentation
Published: 2022-10-19 18:58:51

---
title: Ibis Template
published: true
date: 2022-10-19 00:00:00 UTC
tags: documentation
canonical_url: https://jamessessford.com/blog/ibis-template
---

In my last post I described getting started with Ibis and how it was making writing documentation an easier task for me.

However, as with most tasks, I was looking for a way to improve my workflow with it and speed up the process and so built a template that I can use as the basis for all of the documentation I'm writing.

[https://github.com/jamessessford/ibis-template](https://github.com/jamessessford/ibis-template)

The main features of the template are the VS Code extension recommendations, allowing me to see the PDF from within VS Code rather than having to open the file in a separate reader, and the auto build task for Ibis when I'm updating content in the document.
Delete Old GitHub Forks
Tags: github, forks, gh
Published: 2022-10-23 23:16:35

---
title: Delete Old GitHub Forks
published: true
date: 2022-10-19 00:00:00 UTC
tags: GitHub, forks, gh
canonical_url: https://justin.poehnelt.com/posts/delete-old-github-forks/
---

Was browsing through my GitHub repositories and realized I have an embarrassing number of forks.  A lot of these contain code that is either out of date or not even valid anymore. I used the following to quickly cleanup these repositories that I created before `2021-01-01`.

```sh
gh search repos \
  --owner jpoehnelt \
  --created="<2021-01-01" \
  --include-forks=only \
  --json url \
  --jq ".[] .url" \
| xargs -I {} \
  gh repo delete {} \
    --confirm
```

You may need to refresh your auth with the `delete_repo` scope.

```sh
gh auth refresh -h "github.com" -s "delete_repo"
```
Startup and ODC, a match made in heaven
Published: 2022-10-18 11:47:05

A lot of startups in the USA are looking for ways to accelerate their growth. And one way to do that is to have an office in India. Having an ODC in India can help a startup supercharge its growth in several ways. For one, it can help the startup reduce its costs. An ODC can help a startup manage its costs in several ways. For one, it can help the startup get access to talented engineers at a fraction of the cost of hiring them in the USA. Additionally, an ODC can help a startup save on costs related to office space and other infrastructure costs.

 Additionally, having an ODC in India can help a startup better manage its resources. A lot of startups in the USA are finding it difficult to manage their resources effectively. This is because they are spread out across different time zones and locations. Having an ODC in India can help a startup better manage its resources by bringing them all under one roof. Additionally, an ODC can help a startup save on travel costs and other associated costs.

Another advantage of having an ODC in India is that it can help a startup tap into a vast pool of talent. India is home to a large number of talented engineers and other professionals. Having an ODC in India can help a startup tap into this vast pool of talent and get access to the best resources. Additionally, an ODC can help a startup save on training and other associated costs.

Additionally, an ODC can help a startup scale its operations quickly and efficiently. Startups in the USA often find it difficult to scale their operations quickly. This is because they have to set up new offices and hire new staff. Having an ODC in India can help a startup scale its operations quickly and efficiently without incurring a lot of additional costs. Additionally, an ODC can help a startup expand its reach quickly and efficiently.

Thus, we see that having an ODC in India can help a startup supercharge its growth in several ways. An ODC can help a startup reduce its costs, better manage its resources, tap into a vast pool of talent, and scale its operations quickly and efficiently.


Accoty.com helps in building and managing ODCs in India.