teleren/devto huggingface dataset:
Izyum 🍇 - not only a wonderful city, but also a nice SSG tool
Tags: opensource, ssg, typescript, cli
Published: 2022-09-17 03:05:03

### The task

I a task of creating the cli tool that would convert the plain .txt text to the html format. The task includes converting the first lint of text to the title and other paragraphs to html styled paragraphs. 

### Tech stack

I decided to go with the node.js and typescript for implementing this task. I considered the javascript too, but decided to do typescript, because I wanted to have some types and better intenseness :). 

### The process of initial version implementation 

It took me about the 5 hours to write the first workable version of the this tool (spent most of the time trying to setup the typescript for the cli development 🥲) 

### Finding the partner 

It was pretty difficult to find the partner to do the peer-review, but I think the reason for that is that I started to find them 3 hours before the deadline. Taimoor Dawami came in clutch and agreed to do the peer-review, even though he already had somebody he did it with too (such a nice guy). Interesting fact: the name Taimoor and my name Tymur are pretty muc same names, but just translated from different languages and the pronunciation is identical. 

### Issues

Taimoor find several issues and highlighted them for me, and these finding are very valuable. One of them was the fact that [app made a run-time error if user doesn't provide any path to file/folder](https://github.com/Myrfion/izyum/issues/1). I didn't fix them all yet, since I have some time till the due day which is on Sunday, but I am on my way. 

### What I learned

To be honest, the one thing which I definitely learned is how to make cli tools with typescript 😀. Additionally, I worked a little bit with markdowns, which I didn't do much before. (Spoiler: I did my readme.md with html, not sure if it is considered to be a bad practice or no, writing this most with markdown tho. 

### Github repo

Here is the link to the github repo: https://github.com/Myrfion/izyum

### PS

The Izyum is the name of the wonderful city in the Kharkiv Region in Ukraine that was recently liberated. Slava Ukraini! 🇺🇦

### PSS

Izyum also means raisin in Russian/Ukranian 🍇
C/CPP and the NISTIR 8397 Standard, Minimum Verification Tests for Cybersecurity
Tags: c, cpp, security, programming
Published: 2022-09-17 02:14:19

I’m a fan of Herb Sutter. He is a wonderful teacher and information sharer. During CPPCon 2022 talk (which you must listen) he said something that I’ve never heard before. A presidential directive which discourage usage of C/C++. So I find it, Executive Order (EO) 14028, Improving the Nation’s Cybersecurity, 12 May 2021 signed by US president Joe Biden. In it National Institute of Standards and Technology (NIST) was directed to recommend minimum standards for software testing with in 60 days and NIST developed NISTIR 8397, Guidelines on Minimum Standards for Developer Verification of Software. 
In this standard They recommend the following eleven todo list: 

1. Threat modeling to look for design-level security issues 
2. Automated testing for consistency and to minimize human effort 
3. Static code scanning to look for top bugs 
4. Heuristic tools to look for possible hardcoded secrets 
5. Use of built-in checks and protections 
6. “Black box” test cases 
7. Code-based structural test cases 
8. Historical test cases 
9. Fuzzing 
10. Web app scanners, if applicable 
11. Address included code (libraries, packages, services)

NIST consulted National Security Agency (NSA) while developing it. So they get the best help they can get. It’s a pretty good list. In fact your code should have already been tested with them. But this is another story.
So what all of this has to do with C and C++  ? In Section 3.2 Supplemental: Memory-Safe Compilation C and C++ is directly referenced.

> 3.2 Supplemental: Memory-Safe Compilation
**_Some languages, such as C and C++, are not memory-safe_**. A minor memory access error can lead to vulnerabilities such as privilege escalation, denial of service, data corruption or exfiltration of data.
Many languages are memory-safe by default but have mechanisms to disable those safeties when needed, e.g., for critical performance requirements. **_Where practical, use memory-safe languages_** and limit disabling memory safety mechanisms.
For software written languages that are not memory-safe, consider using automated source code transformations or compiler techniques that enforce memory safety.

What this means is, you are actively encouraged not to use C/C++. Every firm that have a contract with government or regulated, will act accordingly. In the future one can expect the "Where practical" changed to "Must". And I think I’m not the only one that will predict in the future a change like this will happen.
Any good news? Herb Sutter show a new leaner C++ compiler with new syntax that has security features by default as an experiment. All hope is not lost, yet.

The standard is at [https://doi.org/10.6028/NIST.IR.8397
](https://doi.org/10.6028/NIST.IR.8397)

Cover photo:(U.S. Air Force photo/Senior Airman Timothy Taylor)
How to handle a Sequelize promise within a for loop?
Tags: express, sequelize, javascript, webdev
Published: 2022-09-17 01:48:30

I am having trouble querying within Express with Sequelize. I am first querying all QuizAttempts by a user, and then I am querying Articles to refrence the article name to match it to the quiz attempt. (Joins are way over my head). My problem is, I am getting "null" returned when I console.log "Article Data".

```
exports.home = async (req, res) => {

    const quizAttempts = await QuizAttempts.findAll({
        raw: true,
        where: {
            user_id: req.user.id
        }
    }).then(async (data) => {
        for (let i = 0; i < data.length; i++) {
            const queryName = await Articles.findOne({
                raw: true,
                where: {
                    id: data[i].article_id
                }
            }).then((articleData) => {
                console.log(articleData);
            })
        }
    })
}
```
I've been told to use `Promise.all()` in this particular case but I am not fully understanding how I would do so while still retaining the value of `i`. Any help is appreciated!
How to Run Web Dev Project Online on a Server with VSCode?
Tags: webdev, question, javascript
Published: 2022-09-17 01:42:53

Hi,

I'm following this [tutorial](https://youtu.be/-Bk4siyhvDE) on making a translator with HTML/CSS/JS/PHP and I notice the person is using Apache XAMPP to run the program. First, I tried running my code with Live Server but I realized it isn't suited to run this kind of program (same thing with "open in default browser" option). I kept getting a

> POST http://127.0.0.1:5500/process.php 405 (Method Not Allowed) error 

![405 error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/efw2txiey6jm32xj6rlq.png)

with Live Server; however, I'm expecting "Hello Everyone." to print on console (from 13:14 to 13:39 in video).

If it helps, here's my files so far - 

- assets
   - js
      - [app.js](https://pastebin.com/pW7jaPku)
      - [jquery.min.js](https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js) (downloaded into project)
   - css
      - style.css (empty)
      - [tailwind.min.css](https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.7/tailwind.min.css) (downloaded into project)

[index.html](https://pastebin.com/Zx5M7iqL)
process.php (only contains the text "hello everyone.")

Because of the 405 error, I tried downloading XAMPP but ran into some issues and then decided to look for alternatives. So far I came across one called Community Server Connectors but I'm not exactly sure how I'd use it and if it works with web dev programs.

How would I run the program without XAMPP? Are there any options that can run my program without errors, just like in the video? Thanks!
HttpClient 'GET' - Angular Simplified
Tags: httpclient, angular, api, beginners
Published: 2022-09-17 01:20:43

Hey, friends.

Today I want to break down Angular's method of calling APIs. I'll be doing an article for each CRUD operation, so keep your eye out and make sure to follow! 
This is the basics, and you can find more info on Angular's website. I won't get into the nitty gritty of why and how things work here. As a beginner, sometimes too much information is a bad thing. So let's start simple and grow from there!



**Step 1**:

Time to import!

In your app.module file...
```javascript
import { HttpClientModule } from '@angular/common/http';

@NgModule({
  imports: [
    BrowserModule,
    HttpClientModule, <-- add to imports here
  ],
```

In your .ts file...

```javascript
import { HttpClient } from '@angular/common/http';
```

**Step 2**:

Next we need to add to our constructor.

In your .ts file...

```javascript
constructor(private http: HttpClient) {}
```

**Step 3**:

Now it's time to call our API! 

Here's our main functionality.  Inside of the get parenthesis, we are going to put our URL or anything that needs to be sent over.  Consider subscribe to be what actually plugs us in to the service. If you don't have it, we won't have the power to turn this function on. It'll give us back the data we need so we can use it elsewhere.

```javascript
functionName() {
 this.http.get().subscribe()
}
```

Now add your URL to it.

```javascript
myUrl = 'https://www.heythisiscool.com/1'
functionName() {
 this.http.get(myUrl).subscribe()
}
```

Next, you can do stuff in your subscribe parenthesis. You could console.log to see what you get back.

```javascript
functionName() {
 this.http.get(myUrl).subscribe(data => {console.log(data)}
}
```
Or you can put data in a variable.
```javascript
myVariable;

functionName() {
 this.http.get(myUrl).subscribe(data => {myVariable = data})
}
```

You can also do multiple things on subscribe. These things won't happen until the call is complete, so it's handy in many situations.
```javascript
myVariable;

functionName() {
this.http.get(myUrl).subscribe(data => {
  myVariable = data,
  console.log(data),
  callAnotherFunction(),
  setAVariable = true
  }
}
```

There's many other things to cover with get requests, so many sure to follow for the nitty gritty in the future!

Best wishes,
Julie
When to use ?? and || in JavaScript and TypeScript
Tags: javascript, typescript, programming
Published: 2022-09-17 00:26:17

In this short post, I want to share a simple way to remember when to use `??` and `||` when checking values in JavaScript and TypeScript code.

_Note: You can read this post on [Medium](https://javascript.plainenglish.io/when-to-use-and-in-javascript-and-typescript-74533943d5f9) too_

## When to use `??` when checking a value?

The `??` is an or operator where the left side must be empty before returning the right side.

The question mark `?` is like asking yourself, “Does the value exist?”

```js
var ?? varMustBeEmptyToReturnThisVar
```

### Examples

Suppose you get an object where some properties are optional.

```js
const obj0 = { required: 0 };
const { optional } = obj0;
console.log(optional ?? 'no optional property exists');
// returns 'no optional property exists'
```

Be careful when the property returns a [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) value.

```js
const obj1 = { required: '' };
const { required } = obj1;
console.log(required ?? 'no required property exists');
// returns ''
```

## When to use `||` when checking a value?

The `||` is an or operator where the left side must be [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) before returning the right side.

The vertical bar `|` is like putting up a barrier where only [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) values can stay on the left side.

```js
var || varMustBeFalsyToReturnThisVar
```

### Example

Suppose you get an object where some properties are falsy.

```js
const obj2 = { required: '' };
const { required } = obj2;
console.log(required || 'required property is falsy');
// returns 'required property is falsy'
```

## Conclusion

I sometimes misuse the `??` and `||` and thought I should write this reminder to myself. Hopefully that helps you too.

### Before you go

These are other articles you might enjoy.

[Stop Installing Node.js and Global Npm Packages, Use Docker Instead](https://betterprogramming.pub/stop-installing-node-js-and-global-npm-packages-use-docker-instead-42597990db13)

[Five scary Linux commands you should not run](https://medium.com/geekculture/five-scary-linux-commands-you-should-not-run-4222773188bb)

[How to Remove Sensitive Data and Plaintext Secrets From GitHub](https://betterprogramming.pub/how-to-remove-sensitive-data-and-plaintext-secrets-from-github-ca8ca0b7675a)

[How to use CryptoJS and Cookies to Work with Secrets in Postman](https://javascript.plainenglish.io/postman-secrets-cookies-cryptojs-4051db70e8c2)

<hr>

_Photo by [Towfiqu barbhuiya](https://unsplash.com/@towfiqu999999) on [Unsplash](https://unsplash.com)_
AWS Certified Solution Architect – Associate
Tags: aws
Published: 2022-09-17 00:21:21

---
title: AWS Certified Solution Architect – Associate
published: true
date: 2022-09-17 00:19:06 UTC
tags: AWS
canonical_url: https://jamienordmeyer.net/2022/09/16/aws-certified-solution-architect-associate/
---

Woot! This last Wednesday, September 14th, 2022, I finally picked up the first of two AWS certifications that I plan on getting, which is the Certified Solution Architect – Associate certification. It was a fairly difficult 2-hour exam. I know the material pretty well, but for anyone that has taken the SAT tests here in the U.S., the questions were very similar to those on an SAT. Many of the questions would have 2 answers that were both TECHNICALLY correct, but one was, naturally, MORE correct.

For anyone studying to take this exam or any of the other AWS exams, you owe it to yourself to take AT LEAST 2 practice exams prior to taking the actual exam. Running through these practice exams ABSOLUTELY helped me prepare for the real thing. Even then, I honestly wasn’t completely prepared. There were a couple questions that were about topics that my training material did not cover, and as much as I hate to admit to it, I had to make an educated guess on. So definitely… take those practice exams!

Next up for me will be 2 or 3 weeks of a break from studying, then moving on to studying for the Certified Developer – Associate exam. The recommendation that I’ve heard from both my training site and other folks that already have these certifications is to get one shortly after the other since there is a lot of overlap. I’ll target spring of 2023 for getting the Developer cert.
Algorithms Improvement
Published: 2022-09-17 00:12:13

For large computing problems, 43 percent of algorithm families had year-on-year improvements that were equal to or larger than the much-touted gains from Moore’s Law. In 14 percent of problems, the improvement to performance from algorithms vastly outpaced those that have come from improved hardware. The gains from algorithm improvement were particularly large for big-data problems, so the importance of those advancements has grown in recent decades.

The single biggest change that the authors observed came when an algorithm family transitioned from exponential to polynomial complexity. The amount of effort it takes to solve an exponential problem is like a person trying to guess a combination on a lock. If you only have a single 10-digit dial, the task is easy. With four dials like a bicycle lock, it’s hard enough that no one steals your bike, but still conceivable that you could try every combination. With 50, it’s almost impossible — it would take too many steps. Problems that have exponential complexity are like that for computers: As they get bigger they quickly outpace the ability of the computer to handle them. Finding a polynomial algorithm often solves that, making it possible to tackle problems in a way that no amount of hardware improvement can.
Dspyt AI : Uniswap Portfolio Tracker
Tags: python, javascript, machinelearning, github
Published: 2022-09-16 23:55:13

Dspyt AI is the Uniswap powered Dapp that utilizes on-chain data to model potential price fluctuations in real-time.

{% embed https://youtu.be/26d_qFPztuQ %}

We combine a browser–based frontend that gives users the ability to determine price averages for any ERC20 contract through the combination of a machine learning model and the Graph.

Dspytai also offers simple, free to use downloadable price prediction data in both text based csv format and image based png and svg formats that are extendable to an NFT.

## Current Technical Implementation

Dspytai is built with a combination of React Components and Flask and is hosted on Vercel and Heroku. It utilizes The Graph hosted service to query Uniswap data using Python.

Due to observations of small discrepancies in data, we have focused on reliability of the data feed for the machine learning algorithm and subsequent price predictions.


## Resources

[GitHub mono repository](https://github.com/dspytdao/dspytai)

[Back End with python](https://github.com/dspytdao/Heroku_Graph_ML)

[Algovera Proposal](https://forum.algovera.ai/t/dspyt-ai-uniswap-portfolio-tracker/184)

[How to illustrate log returns vs simple returns Blog Post](https://dspyt.com/simple-returns-log-return-and-volatility-simple-introduction)

[Advanced Realized Volatility and Quarticity Blog Post](https://dspyt.com/advanced-realized-volatility-and-quarticity)
And here comes Prom UI!
Tags: devops, showdev
Published: 2022-09-16 23:35:45

Today I'm really happy to show you **[Prom UI](https://github.com/Adaendra/prom-ui)**!

## What is Prom UI?

It's a standalone web app to display Prometheus and/or Thanos datas.

It's completly based on the code from **[Prometheus](https://github.com/Adaendra/prom-ui)** but I've extracted all the UI code, create a Dockerfile to be able to deploy it and I've added a configuration to let you define from which prometheus API you want to retrieve your data.

---

## Why I did it?

For a simple reason, I've multiple prometheus to manage, some of them are managed on the cloud, so it's easier for me to have only one UI to see all the data combined with **[promxy](https://github.com/jacksontj/promxy)**. *(A prometheus proxy)*

---

So I hope you will enjoy it! 

Have a nice day!
Ranger File Manager For Newbies (Easy Edition!)
Published: 2022-09-16 23:25:25

## What is ranger file manager?
ranger is a file manager like Dolphin in Linux or Finder in MacOS that runs in the console or terminal, thought for productivity.
## General Usage

### How to Install Ranger?
Linux Debian
```js
$ sudo apt install ranger
``` 
Linux Arch Based 
```js
$ sudo pacman -S ranger
``` 
MacOS
```js
$ brew install ranger
```
### How to open Ranger File Manager?
 
After being installed just type "ranger"
```js
$ ranger
```
<div style="display: flex; justify-content: center;">
<img src="https://user-images.githubusercontent.com/45242501/163754661-fd7082db-3e71-4494-bd01-aa00b0c76d2c.gif" width=500>
</div>
<br>
<hr>
### how to quit or exit Ranger?
You can quit ranger in the following ways:

| Command | Description | 
|-------|--------|
| q | exits ranger | 
| Q | exits ranger |
| ZZ | exits ranger |
| ZQ | exits ranger |
| :exit | exits ranger |
| :quit | exits ranger |


## How to move around between files?

| Command | Description | 
|-------|--------|
| h | moves one directory to the left | 
| [n]h | moves n directories to the left, example: 3n | 
| l | enters the right | 
| [n]l | jumps n directories to the right, example: 3l | 

<br>

<div style="display: flex; justify-content: center;">
<img src="https://user-images.githubusercontent.com/45242501/163777507-7b33c51d-d692-467c-9201-182daa921f17.gif" width=500>
</div>
<br>
<div style="display: flex; justify-content: center;">
<img src="https://user-images.githubusercontent.com/45242501/163777858-291ca9f2-ef83-4fba-8bbf-117ce7fae871.gif" width=500>
</div>
<br>

| Command | Description | 
|-------|--------|
| j | moves the selector down | 
| [n]j | moves the selector down n time, example: 2j | 
| k | moves the selector up | 
| [n]k | moves the selector up n time, example: 3k | 

<br>

<div style="display: flex; justify-content: center;">
<img src="https://user-images.githubusercontent.com/45242501/163778791-5314c1b0-554b-4c0f-87b2-c286976b8ba0.gif" width=500>
</div>
<br>

<div style="display: flex; justify-content: center;">
<img src="https://user-images.githubusercontent.com/45242501/163779323-ee77c4ca-3933-43f3-87bb-9b0790a2a8c6.gif" width=500>
</div>
<br>

| Command | Description | 
|-------|--------|
| gg | Move to the top of the list | 
| G | Move to the bottom of the list | 

<br>

<div style="display: flex; justify-content: center;">
<img src="https://user-images.githubusercontent.com/45242501/163779731-91f847d1-2717-4274-8122-0c0e4d0b9cfa.gif" width=500>
</div>
<br>

<div style="display: flex; justify-content: center;">
<img src="https://user-images.githubusercontent.com/45242501/163779952-5e9b7f19-36cc-4d06-a10a-343a8e1dc9a3.gif" width=500>
</div>
<br>
The smartest trick in the book
Tags: webdev, api
Published: 2022-09-16 23:12:05

I was thinking of ways we could keep re-using deals and offers, but unfortunately some require a phone number and we can't keep re-using a phone number, so I did some research and it turns out you can use a [disposable number platform](sms-man.com)

Turns out these actually work! So that is one extra way you can keep re-using good offers that require a phone number
areBracesValid UDF for ColdFusion/CFML
Tags: cfml, coldfusion
Published: 2022-09-16 22:59:37

## Useful to determine if braces are correctly matched before processing. Helps reduce SQLi. 

I was using a version of [smartSearch](https://cflib.org/udf/smartSearch) from [CFLib.org](https://cflib.org/) that I had updated with some simple regex detection for [SQLi](https://owasp.org/www-community/attacks/SQL_Injection) strings, but it wasn't catching everything. I considered disabling the [bracket matching](https://en.wikipedia.org/wiki/Bracket_matching) feature and rejecting any query search terms that attempted to use `(` or `)`, but then considered that I should validate so that the feature could still be used since it is beneficial when not being exploited.

I couldn't find any UDFs on CFLib or other ColdFusion/CFML snippets to validate brackets in a string. _(If there's existing code, let me know. I wasn't able to find it.)_ I read a couple recommendations on StackOverflow indicating that it shouldn't be validated using regex, so I wrote a UDF that reduces & validates braces in a string and returns a Boolean response. This allows us to determine whether we can safely use the string when generating a SQL search string (or use `1=0` as a fallback).

## Source Code

https://gist.github.com/JamoCA/a35ffaabc00e0339a9996e27825159a7

{% gist https://gist.github.com/JamoCA/a35ffaabc00e0339a9996e27825159a7 %}