teleren/devto huggingface dataset:
09/03/22 Python GET request
Published: 2022-09-03 08:41:20

Python, pymongo, Flask, mongoDB
So today i was trying to make a function which allows users to upload the pic and saving it. 
Seemed quite simple since I already have done saving the post before. 
However, when I tried to make a new  `@app.route(/)` for the get request, for some reason the response was giving me back the HTML file I have filled in the argument field.

Still I am not sure how to solve this problem correctly, or efficiently but hey I have done it somehow. 

I am thinking that this problem is caused since I already have one 'GET' request for the previous data load, so why not bring all the data at once and just pick and choose the data accordingly to the page? 

Therefore I was able to solve the problem, not feeling great but still happy that it works. 

TL;DR : 1. calling two 'GET' methods didnt seem to work 

2. My solution : load all the data at once under different keys and use them accordingly. 

Cheers.
Brainstorming Applications for AI based Motion Capture
Published: 2022-09-03 08:33:00

Hello everybody,

AI Image processing capabilities have enabled Motion capture without the need for trackers and with a smaller number of cameras compared to traditional Motion Capture Systems. This means that joint movement of the musculoskeletal system can be tracked without the need for additional equipment beyond the cameras themselves. 
 

We, a group of students researching the topic at the Nordakademie Business School in Germany, are interested in possible new use cases and user groups that might benefit from this tracking technology. 

 

Do you have ideas as to what this technology could be of benefit for? We are thankful for any kind of input, the more creative the better.
Custom react loading screen with tailwindcss
Tags: tailwindcss, react, minimal, loading
Published: 2022-09-03 08:25:06

tailwind css has an `animate` class which you can use to accomplish some fun things 

### minimal custom react loading screen

```ts
import React from 'react'

interface LoadingProps {
size:number
}

export const Loading: React.FC<LoadingProps> = ({size}) => {

return (
  <div className="w-[50%]  flex-center h-10">
    <div
      style={{ width: `${size}px`, height: `${size}px` }}
      className="animate-spin">
      <div className="h-full w-full border-4 border-t-purple-500
       border-b-purple-700 rounded-[50%]">
      </div>
    </div>
  </div>
);
}


```

and call it like 

```ts
<Loading size={35}/>

```
viola 

[full project code](https://github.com/tigawanna/gitdeck)
[live preview](https://gitdeck-two.vercel.app/)
This week’s newsletter is out! (03-09-2022) - The Gorbachev Short
Tags: javascript, tech, webdev
Published: 2022-09-03 08:17:06

---
title: This week’s newsletter is out! (03-09-2022) - The Gorbachev Short
published: true
description: Another week of great javascript, tech and web development links.
tags: javascript, tech, webdev, discuss
---

The Gorbachev Short

https://markjgsmith.substack.com/p/mark-smiths-newsletter-03-09-2022

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
goent code base walkthrough
Tags: go
Published: 2022-09-03 07:43:21

Hi everyone, I just found an awesome ORM in Go, that is [ent](https://github.com/ent/ent) (go-ent). This library provides a code generation feature. With this feature, we-developers can have code suggestions about fields of the table, and easy to write a query to filter records based on condition, unlike other ORMs in Go like gorm, we have to write the raw condition of SQL query
```Go
db.Where("name <> ?", "Jinzhou").Find(&users)
```

In this article, I will dive into the architecture of the ent framework, ...

Ent's main packages
- cmd: defines commands for the library.
- dialect: handles the dialect support for Mysql, PostgreSQL, SQLite, and Gremlin databases. The package also provides methods for the query builder. 
- entql: provides (Unary, Binary, ... Expr) structs that implement `Stringer` interface, these structs generate the expression from their properties. 
- entc: provides an interface for interacting with entc (ent codegen) as a package rather than an executable
- privacy: provides a set of rules for user schema and deals with runtime evaluation.
- schema: contains structs that are used by developers when defining an ent schema.
Top crypto websites everyone should visit regularly.
Tags: webdev, trading, crypto, programming
Published: 2022-09-03 07:05:22

- [Messari](https://www.linkedin.com/company/messari/) => best research on protocols in the market.
.
.

- [Twitter](https://www.linkedin.com/company/twitter/) => up to date news about the crypto market.
.
.
- [Glassnode](https://www.linkedin.com/company/glassnode/) => on-chain data for market intelligence.
.
.
- [Andreessen Horowitz](https://www.linkedin.com/company/a16z/) => crypto research in depth.
.
.
- [Nansen](https://www.linkedin.com/company/nansen/) => NFT insights and trends with analytics.
.
.
- [FTX](https://www.linkedin.com/company/ftx/) => one of the best crypto exchanges for fiat.
.
.
- [Uniswap Labs](https://www.linkedin.com/company/uniswaporg/) => best DEX currently in crypto
How I passed the AWS Security Specialist Exam by studying for a week
Tags: cybersecurity, aws, security, beginners
Published: 2022-09-03 06:47:39

I was able to only study for a week to pass the AWS Security Specialist exam and this is because I had been immersed in AWS everyday for 3 years as a DevOps engineer. And as a DevOps engineer that was responsible for security. If this seems like maybe your situation then here's the only resource I used to pass.

- [AWS Certified Security Study Guide](https://www.amazon.com/AWS-Certified-Security-Study-Guide/dp/1119658810/ref=sr_1_1?crid=2L7DF0R74H5A2&keywords=aws+security+specialty+study+guide&qid=1662187344&sprefix=AWS+Security%2Caps%2C150&sr=8-1)

In the book there's a link to flashcards and practice exams which I practiced everyday for about ~8 hrs.

There is another link in the book to the official practice test partners of the book and so I did a few of those exams which were much harder than the exams in the book and flashcards. 

I used these harder exams to help me focus in on my weak areas and then went back to the book to supplement my knowledge gaps.

Then, I took the exam and passed on the first try, currently I'm working as a Cyber Security Infrastructure Analyst, so let me know if you have any questions.
Cyber Security Engineer Resume: Here's mine as an Example
Tags: beginners, webdev, cybersecurity, programming
Published: 2022-09-03 06:39:02

I recently obtained my AWS Security Specialist Certification and transitioned to the role of **Cyber Security Infrastructure Analyst** from a DevOps engineer.

Here's what my DevOps engineer resume looked like to land the Cyber Security Job.

`Toul DeGuia-Cranmer

Compliance: SOC 2 Type 1 and 2 Project
* Created Python Lambdas to 
      * Automate collection of infrastructure assets on monthly basis
      * Generate a Delta difference on a monthly basis
      * Reports presented to compliance team on a monthly basis
      * Proposed future enhancements to use AWS Config with AWS Security Hub and AWS GuardDuty to further automate and generate Dashboard with findings

* Created GoLang CLI tool to 
      * Generate reports of accounts with elevated permissions for AWS, GitHub, PagerDuty, Microsoft Active Directory, and LaunchDarkly
      * Azure DevOps to automatically update assigned tickets
      * Automatically add Branch Protections to repositories

* Weekly Tenable Scanning Reports
      * Presented data to Compliance team 

* ECR Scanning for each micro service image
      * Used a python script to scan 300+ ECR repos to remediate broken ECR scanning
      * Changed the platform to enable ECR scanning by default for all newly created repos

* GitHub Enterprise Depend a Bot
      * Worked with HPIT to enable third party package scanning at the codebase level for every PR
      * Created script to scan GitHub Org for CVE vulnerabilities found within the micro-services repos 
      * Presented report to Compliance team

* Automated installation of HPCS required CyberSecurity Agents
      * Updated terraform launch template so that each newly created node would have the required agents

* Anchore 
      * Implemented Anchore to scan Docker files and images per commit 

* Terragrunt / Terraform Infrastructure Pipeline
      * Enabled 200+ developers to provision any piece of AWS infrastructure they needed 24/7 365 days a year
      * Reduced infrastructure resource provisioning time from days to minutes

* AWS WAF Implementation
      * Increased AWS Web Application Firewall (WAF) on AWS Application Load Balancers (ALB) from 0% to 100% in production
      * Inner sourced the WAF into a Terragrunt template that is applied across hundreds of AWS ALB's`

The main thing you'll see is each project is in someway related to security and this is because I informed my manager that is what I'm interested in and they provided me security tasks for the platform.
ES6 Arrow functions quick notes
Tags: es6, javascript, arrowfunction, tutorial
Published: 2022-09-03 06:27:05

1) const x = (x,y) => {return x*y};
2) const x = (parameter) => {return "Hellow World!" + parameter};
3) const x = parameter => {retunr "Hellow World!" + parameter};
3) const x = (par1, par2) => {retunr "when more then one parameters we require parenthesis" + para1 + para2};
4) const x = () => {return "If no use of parameter then"};
5) this keyword always represents the object that defined the arrow function and not the one which called the function like button or etc.
Today I Learned - Don't use sudo with npm
Tags: terminal, linux, sudo, command
Published: 2022-09-03 06:25:54

**문제점:**

- 회사에서 사용중인 프레임워크 버전 업그레이드를 진행하면서, 여러 모듈을 설치하고 삭제하는 작업을 진행함  
- 새로운 모듈을 설치할 때마다 **`sudo`** command를 붙임. 
(이전 부터 yarn을 통해 package를 설치할 때 마다 **Permision Denied** 에러가 발생했기 때문에 별 생각없이 sudo로 설치했었음) 
- 옆자리의 senior 개발자 분께서 sudo로 설치하는 것에 의문을 가짐



**TIL:**
- node module을 설치할 때 부터 sudo command를 사용했기 때문에, 그 이후로 어떤 모듈이든 permission을 요구했던 것!!🚨🚨
- 심지어 npm 공식 사이트에도 아래와 같은 권고 사항이 나와있음.

> **Don't prefix your script commands with "sudo"**. 
If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question.

👉 해당 위치에 설치된 **모든 node_module 제거** + **npm install command 다시 실행**

[reference](https://medium.com/@ExplosionPills/dont-use-sudo-with-npm-still-66e609f5f92)
Spring Boot Feature Flag
Tags: java, springboot, featureflag, docker
Published: 2022-09-03 05:57:06

## What is a feature flag?
A feature flag is a software development process used to enable or disable functionality remotely without deploying code. New features can be deployed without making them visible to users. Feature flags help decouple deployment from release letting you manage the full lifecycle of a feature.

Feature flags go by many names:

- Feature toggle
- Feature flipper
- Conditional feature
- Feature switch
- Feature controls
- Release toggle

## Docker

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

**Dockerfiles** are text documents that allow you to build images for Docker

You will find the project [here](https://https://github.com/imjavedkhan/ConfigCatFeatureFlag)

### Below command to build image
```
docker build -t spring-docker:latest .
```
### Below command to run container
```
docker run --name spd -d -p 8080:8080 spring-docker:latest
```

![Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gg0wva3z3hwxjo5wvqte.png)
Javascript var, let, const difference
Tags: javascript, react, tutorial, beginners
Published: 2022-09-03 05:55:38

Remember three points to distinguish var, let, const.

1. Declaration - Can we redeclare it in same code? 
2. Block Scope - Can value be set up only to block? or it acts like global?
3. Can we reassign value? or can this be declared without value and than after assign value?

By below example we can understand all above points very well.
Note: If you don't know what is scope in Javascript just google it :)

```javascript
var x=9; //Declared 1st time
var x=10; //Declared 2nd time: Allowed here

let v=9; //Declared 1st time
let v=2; //Declared 2nd time: Not allowed as both in same scope (comment down this line and execute in browser console).

const PI; //Declared 1st time without value assign: Not allowed as const needs value assigned at the time of declaration (comment down this line and execute in browser console).
const PI=3.14; //Declared 2nd time: Allwed as it is proper declaration.

PI=3.14159; //Reassign const value: Not allowed (comment down this line and execute in browser console).


function BlockScope(){

console.log('----------block space start-----------');

var x=2; //Declared 3rd time: Allowed here
console.log(x); //x will be 2 over here

let v=3; // Declared 3rd time: Allowed as scope is changed here.
console.log(v); //v will be 3 over here 

const PI=3.1415; //Declared 3rd time: allowed as it follow Scope Principle.

console.log(PI); //PI will be 3.1415

console.log('----------block space end-----------');
}

BlockScope();

console.log(x); //x will be 2 which do not follow block scope (means var do not follow scope principle).

console.log(v); // v will be 9 here (means let follow scope principle).

console.log(PI); // PI will be 3.14 and not 3.1415 as it follow scope principle.

v=12; //allowed and value will be chagned to 12 when you run(3rd point) 


```
How to make a get request using axios with params and read it in backend.
Tags: axios, get, mern, axiosparams
Published: 2022-09-03 05:41:57


Let's see how to make a get request using axios with params and read the request and get params in backend.


**FrontEnd**
```
//take 'docID' as the id of the ducement you search
//take port number as 4200

axios
      .get("http://localhost:4200/api/stock/getProduct", {
        params: { id: docID },
      })
      .then(function (response) {
        console.log(response.data);
      })
      .catch(function (error) {
        console.log(error);
      })
      .then(function () {
        // run anything after the response is arrived
      });
```


**Backend**


```
const router = express.Router();

router.get("/getCusProducts", getProduct);

function getProduct(req, res) {
  let id = req.query.id; //<<<this is how you read params

  Product.findById(id)    // Product is the model
    .then((product) => {
      res.json(product);
    })
    .catch((err) => {
      console.log(err);
    });
}
```
Thương hiệu Nắp hố ga GOAT uy tín, cam kết cao
Tags: naphogagoat, bannaphoga, naphogagang, naphogacomposite
Published: 2022-09-03 05:41:12

Là một trong những đơn vị [bán nắp hố ga](https://naphoga.vn/bao-gia-nap-ho-ga-bang-gang.html) được tin tưởng lựa chọn, đồng hành trong nhiều dự án trên khắp cả nước. GOAT đã may mắn có bề dày kinh nghiệm thương mại và sản xuất để có thể tư vấn giải pháp nắp hố ga tối ưu về giá và chất lượng cho từng công trình.

GOAT nhận sản xuất Nắp hố ga gang và composite theo bản vẽ. Cam kết đúng tải trọng thiết kế cho mỗi đơn hàng.

Ngoài ra, GOAT luôn nỗ lực cải tiến sản xuất, nâng cao chất lượng sản phẩm để kiến tạo nên những giá trị tốt đẹp nhất cho khách hàng của mình. 

Tất cả sản phẩm chính hãng của GOAT bảo hành 12 tháng hoàn toàn miễn phí.

Quý khách quan tâm nắp hố ga gang và composite vui lòng liên hệ GOAT để nhận báo giá nhanh nhất: **0987.382.388**
//===≈===//
**NẮP HỐ GA - SONG CHẮN RÁC GOAT**

Chuyên cung cấp nắp hố ga, song chắn rác, các sản phẩm gang cầu và composite.

Giá cạnh tranh - Giao hàng tận công trình - Bảo hành 12 tháng

Địa chỉ: Nhà số 23, LK 3, KĐT Đại Thanh, Thanh Trì, Hà Nội

Hotline: 0987.382.388

Official Website: 
[https://naphoga.vn](https://naphoga.vn)

Fanpage: [https://m.facebook.com/naphogaGOAT](https://m.facebook.com/naphogaGOAT)
Taylor Method - The best sales language and process for financial advisors
Tags: insurance, sales, coach
Published: 2022-09-03 05:37:24

The Taylor Method is a sales system that helps financial advisors develop a confident, repeatable, and scalable practice to thrive in this business. The method was developed by an active, Top of the Table (Top 1%, MDRT) producer who spent 22+ years perfecting his process to finally make it available for advisors worldwide.

The language and process are product, carrier, language, and country-agnostic. We've served financial advisors all over the world, helping them better serve clientele and build their own million-dollar practice.

[https://www.taylormethod.com](https://www.taylormethod.com)
Devops Parte 1: Creación proyecto .net pruebas unitarias
Tags: devops, testunit, tdd, testing
Published: 2022-09-03 05:22:57

# Creación del proyecto 

**Paso 1:** Crear proyecto .net
- Abra visual studio community
- cree nuevo proyecto Web APi
- Seleccione .net 6, open api 
- * Opcional: en mi caso no usar minimalApi

**Paso 2:** Crear proyecto de test
- Cree nuevo proyecto xUnit
- seleccione .net 6

**Paso 3:** Agregar dependencias en el proyecto de test
- Agregar paquetes nuget coverlet.collector
-- Clic derecho sobre el proyecto -> Administrar paquetes nuget -> buscar coverlet.collector -> instalar
- Agregar paquetes nuget  coverlet.msbuild
-- Clic derecho sobre el proyecto -> Administrar paquetes nuget -> buscar  coverlet.msbuild -> instalar
- Agregar paquetes nuget Xunit.DependencyInjection
-- Clic derecho sobre el proyecto -> Administrar paquetes nuget -> buscar Xunit.DependencyInjection -> instalar

- Resultado final

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

**Paso 4:** Configuración
- Crear api desde un controller que exponga un hola mundo

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

- Crear prueba unitarias asociada al api

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

**Paso 5:** Generación de reporte coverage.xml
``
dotnet test .\microservicio.dotnet.test\microservicio.dotnet.test.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput='coverage.xml' --configuration Release --no-restore
``
967. Leetcode Solution in CPP
Tags: cpp
Published: 2022-09-03 05:13:00

```
class Solution {
 public:
  vector<int> numsSameConsecDiff(int n, int k) {
    if (n == 1)
      return {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

    vector<int> ans;

    if (k == 0) {
      for (char c = '1'; c <= '9'; ++c)
        ans.push_back(stoi(string(n, c)));
      return ans;
    }

    for (int num = 1; num <= 9; ++num)
      dfs(n - 1, k, num, ans);

    return ans;
  }

 private:
  void dfs(int n, int k, int num, vector<int>& ans) {
    if (n == 0) {
      ans.push_back(num);
      return;
    }

    const int lastDigit = num % 10;

    for (const int nextDigit : {lastDigit - k, lastDigit + k})
      if (0 <= nextDigit && nextDigit <= 9)
        dfs(n - 1, k, num * 10 + nextDigit, ans);
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/numbers-with-same-consecutive-differences/
Spotify-clone
Tags: react, javascript, typescript, firebase
Published: 2022-09-03 04:57:55

It has been a while since I have blogged but I have been busy working on myself and more clone apps to build. 

Loving React and JavaScript and thought to clone Spotify app. We all know and love Spotify. I love building apps that I love.


This was extremely fun to create. I was high-key stressed but I believe once you are consistent in everything you do, you can achieve just about anything you desire.

I finally completed my Spotify-clone app using React JS, NextJs, HTML, CSS, JavaScript, hosted on Firebase. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/djvyg4z7qvfgogvnmhy3.png)
Community Management VS Social Media Management
Tags: community, management, socialmedia, technology
Published: 2022-09-03 04:43:05

Community Management is often mistaken as something in which a person interacts with a community on a social media platform to get leads for a business. And along the same lines, social media management is confused as managing communities. But both of these roles are very different and important in their own ways. 

While community managers may do social media management sometimes but that is not their entire job description. Also, social media managers don't just promote their companies' product online, they have a vast set of responsibilities to cover. Let's take a look at the same in this article.

Major difference:

Social Media Manager- They’re the voice of the brand and are responsible for posts, replies and general content.
Community Manager- They will post as a brand ambassador under their own account, and work on developing the community.
Who do they report to?

Social Media Manager- A social media manager reports to the social media/marketing lead
Community Manager-A community manager reports to the community/DevRel lead
Skills needed:

Social Media Manager-Communication, Writing, creativity, efficiency, traditional and digital marketing, agility, analytical skills
Community Manager-Communication, Organisation, Curiosity, Passion and loyalty, Lots of patience, Empathy, Business savvy
Tasks:

Social Media Manager-All things content, Listening and engaging with the brand, Strategy and analytics
Community Manager-Developing community, finding new users, answering questions and engaging current members, getting feedback and working with cross-functional teams.
Goals of each role:

Social Media Manager– More specific and short-term and focus on sales or conversions.
Community Manager– Usually broad and long-term. They center around establishing a strong and supportive community, which can take a long time.

Therefore, these two roles are very different. For small teams, one person may be doing both jobs. However, specialization is beneficial as a team expands, and it’s important to understand how expanding these two jobs can help in development even more.