teleren/devto huggingface dataset:
Notely - Work Notes | Shine to you manager in 1:1's
Tags: atlashackathon22, vue, mongodb
Published: 2022-12-07 03:29:03

## What I built

I built an application for people to log their work day in terms of tags, highlights, and detailed report. That way you can have a good record of everything you did when you start that promotion conversation.

### Category Submission:

**Search No More** I am utilizing the search capabilities to help users search by tags, and hopefully more in the future.

### Screenshots


![Dashboard screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zwaxf2qjp1xvhifyncqs.png)


![Summary screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4vkwi2x4ekbjzskijbqu.png)


![New log screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ot0sxq2jlkcbyzn9c6az.png)

### Description
 
Create a log of a work day whenever you see fit and then have an ability to quickly search for it and remember what you did that day at a quick glance. 

This is an MVP, I plan to add so much more to make this app even better. For example: custom tags, search by highlights, attachments (praise/good comments etc), tasks accomplished. That way your boss can't say that you have not done enough for a promotion 😇

### Link to Source Code

[Github](https://github.com/mooncakes-dev/atlashackathon22-notely)

### Permissive License

Still deciding since I want to keep working on this. Just don't copy the code and claim its yours.

## Background

I built this application because I often find myself scrambling last minute to remember what it is that I did in the past week/s before my manager 1:1s. Which hinders me getting a promotion if I am not constantly showing all of the amazing things I do, and how I participate in company culture :sunglasses:
This app solves the problem. You log a day with:

- Tags - for search purposes
- Highlights - quick glance reminder
- Detailed report - treat this as a work journal, you can go in detail of your day, what you did, how you felt etc.

I plan on continuing to work on this after and add many more things and features. Ultimately turning this into an ideal lifestyle app for myself.

### How I built it

- Mongo - DB and ease of search
- Express - server and API
- Vue.js - front-end
- Element Plus - component library

### Additional Resources/Info
How To Convert Binary, Octal, and Hexadecimal into Decimals in JavaScript
Tags: javascript, webdev, programming, tutorial
Published: 2022-12-07 03:20:17

Are you struggling with an online calculator when converting binary, octal, or hexadecimal into decimals? Try to use #javascript to do the job. [Let's see how](https://mkdaycode.blogspot.com/2022/12/how-to-convert-binary-octal-and.html
).

[![ko-fi](https://cdn.ko-fi.com/cdn/kofi2.png?v=3)](https://ko-fi.com/mkdaycode)
Soi kèo Huesca vs Andorra lúc 1h00 ngày 8/12/2022
Tags: bongdainfo, keonhacai, tysysotructuyen, lichthidau
Published: 2022-12-07 03:09:50

Dự đoán kết quả soi kèo Hạng 2 Tây Ban Nha chuẩn nhất từ các chuyên gia BongdaINFO.
See more: [https://bongdainfo.com/soi-keo-tay-ban-nha/soi-keo-huesca-vs-andorra-luc-1h00-ngay-8-12-2022-i9898/](https://bongdainfo.com/soi-keo-tay-ban-nha/soi-keo-huesca-vs-andorra-luc-1h00-ngay-8-12-2022-i9898/)
Hastag: #BongdaINFO #tysobongda #lichthidau #keonhacai #tysotructuyen
Advent of Code 2022 Video Series: Day 1 - 3
Tags: rust, adventofcode
Published: 2022-12-07 03:09:25

Hey I’m Corey and I’ve been writing Rust in my free time for a few years and recently started streaming some of my coding.

And this year for Advent of Code I thought it would be fun to make a video series of solving each puzzle. These videos will be the first time I’m seeing the puzzles, so you’ll get to see how I solved each puzzle in realtime.

So far I've got the first three days of videos posted! I'll post the rest in this playlist as I solve them: https://youtube.com/playlist?list=PL0FtqJaYsqZ2em34cxsluQfyK1Ej8sG-e

The Github Repo can be found here: https://github.com/coreyja/advent-of-code-2022
Advent of Code Site: https://adventofcode.com/2022

Day 1: Calorie Counting
{% embed https://youtu.be/Hy-trhtOglE %}

Day 2: Rock Paper Scissors
{% embed https://youtu.be/2ZmRad7DEuE %}

Day 3: Rucksack Reorganization
{% embed https://youtu.be/ijesnQhno9E %}
OmeDEV - Talk to Developers! MongoDB Atlas Hackathon 2022 on DEV
Tags: atlashackathon22
Published: 2022-12-07 02:51:07

## What I built

OmeDEV is an Omegle clone that lets you connect "randomly" with stranger developers to have a nice chat.

### Category Submission: Choose Your Own Adventure


### App Link
https://omedev.vercel.app/

### Demo

![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/juvrekoqqgxs8jkyd0ch.gif)

### Screenshots

Dark theme
![Dark theme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3li7m7zkek03e8lklzg.png)

Light theme
![Light theme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/flxvy2d88bb6x7hvkc7t.png)

### Description

When you connect with someone, the chats attempts to be anonymous by searching for the first room available, if it does not exist one will be created for you. The next user will automagically be joined in a FIFO style (First in, First out). To prevent predictions on who will be joining theres a random delay applied to each user. Your messages are sent and received through websocket and only the rooms ids are stored in database for no longer than one day.

### Link to Source Code
https://github.com/mateusabelli/omedev

### Permissive License
MIT

## Background

I wanted the build something beyond my current skills, to imagine something and code it into reality, this project has proven me that it is possible and taught me valuable lessons. I choose to do an Omegle clone because it is my first chat application.

### How I built it

The chat rooms are stored in MongoDB Atlas. It stores the ID for the Pusher presence channel which allows the app to receive events whenever someone joins or leaves the channel.

I've learned a ton but the biggest lesson was to always try to organize the ideas and plan out before coding. This application was built while I was learning about how everything would work, so there was little to no planning in the project.
LinkFree Contribution Planning
Tags: opensource
Published: 2022-12-07 02:49:59

## Overview
This week I want to contribute to the repository called [LinkFree](https://github.com/EddieHubCommunity/LinkFree). It is a free open-source analog to the [LinkTree](https://linktr.ee/), which lets people do small personalised pages with information about themselves, their experience, links to their resources etc. 

## Feature
The feature that they want to implement is creating a Github action that would take Testimonials from somebody's LinkFree page and put them to their GitHub page readme. The issue is described [here](https://github.com/EddieHubCommunity/LinkFree/issues/2302) and you can see some questions I want to clarify with the maintainer. 

## Implementation 
At this point, I am trying to make it clear how this action should look like, where it has to be located, how it suppose to fetch data etc. Since I have never created custom GitHub actions it is a nice thing for me and I am trying to dive into that. Github has pretty good [documentation](https://docs.github.com/en/actions/creating-actions/about-custom-actions) on creating custom github actions.
How to switch Dynamic block definitions in Terraform
Tags: terraform, ecs, fargate
Published: 2022-12-07 02:07:56

The setting of whether or not to enable resources in Terraform can be toggled by using [count](https://developer.hashicorp.com/terraform/language/meta-arguments/count) or [for_each](https://developer.hashicorp.com/terraform/language/meta-arguments/for_each).


Example using count
```
resource "aws_route53_record" "keycloak" {
  count   = var.enable_dns_record ? 1 : 0
}
```

Example using for_each
```
resource "aws_route53_record" "services" {
  // Register only if enable_dns_record = true
  for_each = {
    for name, service in var.service : name => school
    if var.enable_dns_record == true
  }
}
```

Since count cannot be used when switching options using Dynamic block, such as capacity_provider_strategy options for aws_ecs_service resources, it can be realized by defining as follows using for_each.

```
resource "aws_ecs_service" "service" {
  dynamic "capacity_provider_strategy" {
    for_each = var.is_capacity_provider_strategy ? [1] : []
    content {
      capacity_provider = "FARGATE"
      base              = 2 // ALWAYS TWO ARE BOOTED WITH FARGATE
      weight            = 0
    }
  }

  dynamic "capacity_provider_strategy" {
    for_each = var.is_capacity_provider_strategy ? [1] : []
    content {
      capacity_provider = "FARGATE_SPOT"
      base              = 0
      weight            = 1 // From the third unit onwards, boot to FARGATE_SPOT
    }
  }
```
TerraformでDynamicブロックの定義を切り替える方法
Tags: terraform, ecs, fargate
Published: 2022-12-07 02:01:33

Terraformでリソースを有効にするかどうかの設定は、[countを利用する](https://developer.hashicorp.com/terraform/language/meta-arguments/count)か、[for_each](https://developer.hashicorp.com/terraform/language/meta-arguments/for_each)を利用することで切り替えすることができる。

countを利用した例
```
resource "aws_route53_record" "keycloak" {
  count   = var.enable_dns_record ? 1 : 0
}
```

for_eachを利用した例
```
resource "aws_route53_record" "services" {
  // enable_dns_record = true の場合にのみ登録する
  for_each = {
    for name, service in var.service : name => school
    if var.enable_dns_record == true
  }
}
```

aws_ecs_serviceリソースのcapacity_provider_strategyオプションのようにDynamicブロックの定義を使ったオプションを切り替える場合にはcountを利用できないため、for_eachを利用して以下のように定義することで実現できる。

```
resource "aws_ecs_service" "service" {
  dynamic "capacity_provider_strategy" {
    for_each = var.is_capacity_provider_strategy ? [1] : []
    content {
      capacity_provider = "FARGATE"
      base              = 2 // 必ず2台はFARGATEで起動
      weight            = 0
    }
  }

  dynamic "capacity_provider_strategy" {
    for_each = var.is_capacity_provider_strategy ? [1] : []
    content {
      capacity_provider = "FARGATE_SPOT"
      base              = 0
      weight            = 1 // 3台目以降はFARGATE_SPOTで起動
    }
  }
```
Configurando um repositório Maven no JFrog
Tags: jfrog, maven
Published: 2022-12-07 01:35:27

## Criar Conta

### Clique em `START A TRIAL`

![Criar Conta - Step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gvxpskahorryj2cwrg3h.png)


### Clique em `Skip Trial and Start with Free JFrog Instance`

![Criar Conta - Step 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4au9llu6zoe5a24svdeg.png)

## Informe o nome para seu subdomínio dentro da JFrog.io

![Subdomínio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4e8be27rg20ge1nv6ndq.png)

## Crie um repositório Maven

### Clique em `Local Repository`

![Maven - Step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/shuwdlmfqz6r7t0v4028.png)

### Selecione a opção Maven

![Maven - Step 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d3ardj3h8csldc7781q2.png)

### Informe o repository key

![Maven - Step 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3hnymtlin76m7fy48mi.png)

### Repository criado com sucesso

![Maven - Step 7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eb715uhujqy5nfmiud9k.png)

## Visualize os repositories no menu Artifacts

## Visualização de todos os repositories

![Artifacts - Step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jzambo3db8nh93npp14.png)

## Visualização das versões das bibliotecas

![Artifacts - Step 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aws2xx6v350r7egthw3u.png)
Define secret values registered in Secrets Manager in Terraform in environment variables in Lambda
Tags: terraform, lambda, secretsmanager, ecs
Published: 2022-12-07 00:44:10

Setting environment variables in ECS task definition using Terraform can be realized using valueFrom, but I could not find a way to define them in Lambda environment variables, so I verified it.

```
resource "aws_ecs_task_definition" "keycloak" {
  container_definitions = jsonencode(
    [
      {
        secrets = [
          {
            name : "KeycloakSettings__AdminUser",
            valueFrom : "${var.secrets_manager_secret_arn}: KeycloakSettings__AdminUser::"
          }
        ...
        ]
      }
    ]
  )
}
```

The same can be achieved with Lambda by using the [External Data Source](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source) as follows.

```
data "aws_secretsmanager_secret" "keycloak_env" {
  name = var.secrets_manager_secret_name
}

data "aws_secretsmanager_secret_version" "keycloak_env" {
  secret_id = data.aws_secretsmanager_secret.keycloak_env.id
}

data "external" "keycloak_env_secret_json" {
  program = ["echo", "${data.aws_secretsmanager_secret_version.keycloak_env.secret_string}"]
}

resource "aws_lambda_function" "keycloak" {
    environment {
    variables = {
      KeycloakSettings__AdminUser = "${data.external.keycloak_env_secret_json.result["KeycloakSettings__AdminUser"]}"
    }
  }
}
```
TerraformでSecrets Managerに登録されたシークレット値をLambdaの環境変数に定義する
Tags: terraform, lambda, secretsmanager, ecs
Published: 2022-12-07 00:40:44

TerraformでECSのタスク定義における環境変数への設定はvalueFromを利用して実現できるが、Lambdaの環境変数に定義する方法が見当たらなかったので検証してみた。

```
resource "aws_ecs_task_definition" "keycloak" {
  container_definitions = jsonencode(
    [
      {
        secrets = [
          {
            name : "KeycloakSettings__AdminUser",
            valueFrom : "${var.secrets_manager_secret_arn}: KeycloakSettings__AdminUser::"
          }
        ...
        ]
      }
    ]
  )
}
```

以下の通り[External Data Source](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source)を利用することによって同じようなことが実現できる。

```
data "aws_secretsmanager_secret" "keycloak_env" {
  name = var.secrets_manager_secret_name
}

data "aws_secretsmanager_secret_version" "keycloak_env" {
  secret_id = data.aws_secretsmanager_secret.keycloak_env.id
}

data "external" "keycloak_env_secret_json" {
  program = ["echo", "${data.aws_secretsmanager_secret_version.keycloak_env.secret_string}"]
}

resource "aws_lambda_function" "keycloak" {
    environment {
    variables = {
      KeycloakSettings__AdminUser = "${data.external.keycloak_env_secret_json.result["KeycloakSettings__AdminUser"]}"
    }
  }
}
```
A Covid Opportunity
Tags: career, beginners, flutter, codenewbie
Published: 2022-12-07 00:26:56

_An airline pilot turned app developer by necessity_

####An abrupt change of direction####

I won't bore you with backstory - but a small introduction instead. My name is Chris Brislin, I am an experienced airline pilot and an aspiring software developer. 

As the full impact of the COVID-19 pandemic became apparent and the demand for pilots dropped, I realised that it may be prudent to expand my skillset. I thought long and hard about which skills I could fit around my current work and interests. Airline flying means frequent multi-day trips around the country and even the world, but it is rare that we are without an internet connection. Software development seemed like it could fit neatly around my current life.

Thanks to close friends and relatives, I have always had an interest in electronics and software. I have many half baked Arduino projects sitting around as well as a few poorly produced HTML websites that I occasionally inflicted on the public. The skills I had learned from these hobbies were all self taught and were far from best practices. I needed to formalise my skills and learn how to learn! 

After doing some research into available remote courses I came across Australis College's Diploma of Software Development. This course ticked all the boxes for me - fully remote, 18 month duration, and covered a complete set of topics from use of software tools to project management. 

####Ever creeping scope####

The diploma was focused around mobile application development - specifically Android app development using Java, with the capstone project being a completed Android application deployed on the Google Play Store. For my capstone project I elected to build a basic electronic pilots logbook for the following reasons:

1. It met the assessment criteria
2. Currently available products are expensive and pilots are cheap.
3. As a coworker once said to me *"It's a glorified spreadsheet"* - so how hard could it be? (Obvious foreshadowing)

This blog will be about the year following the start of that project as I re-wrote the application 3 times with 3 completely different tech-stacks and accommodated every growing project scope. Be prepared to cringe as this code newbie falls down every trap and re-invents the wheel several times. I look forward to entertaining you!
Arrays in SQL? Yay or Nay?
Tags: sql, postgres, database, design
Published: 2022-12-06 23:21:28

> Photo by Naim Benjelloun

**Disclaimer:** Coming from a dev perspective, _NOT_ DBA.

I'm visiting this topic for an nth time, and decided to illustrate use cases (with and without), and come up with a pros/cons list. 

**Problem:** In a database for a social networking platform, suppose I need to organize the data for a user's friends. 

This can be done in 1 of 2 ways:

**1.** Within a singular table ('user profile')

```
| id | name | friends_id |
--------------------------
| 1  | jess | {3, 4}     |
| 2  | mike |            |
| 3  | raj  | {1}        |
| 4  | sam  | {1}        |
```

**2.** Split into two tables ('user_profile', 'user_friends')

```
| id | name |
-------------
| 1  | jess |
| 2  | mike |
| 3  | raj  |
| 4  | sam  |

| id | user_id | friend_id |
----------------------------
| 1  | 1       | 3         |
| 2  | 1       | 4         |
| 3  | 3       | 1         |
| 4  | 4       | 1         |
```

**PROS:**
- Spatial locality allows us to minimize the number of query calls to the DB which can be a bit of performance booster (i.e. INSERT INTO user_profile (name, friends_id) VALUES ('jess', ARRAY[3, 4]); **VS.** INSERT INTO user_profile (name) VALUES ('jess'); INSERT INTO user_friends (user_id, friend_id) VALUES (1, 3); INSERT INTO user_friends (user_id, friend_id) VALUES (1, 4);)
- Reduces data redundancy (i.e. the multiple records for user id 1 under table 'user_friends')
- Can be especially useful when processing large amounts of data (i.e. PostGIS point data, ML datasets)


**CONS:**
- Breaks database normalization rules like 1NF (First Normal Form) being a multi-valued attribute which introduces CRUD anomalies (i.e. UPDATE user_profile SET friends_id = array_append(friends_id, 2) WHERE id = 1; **VS.** INSERT user_friends (user_id, friend_id) VALUES (1, 2);)
- Breaks database normalization rules like introducing null values where the data _can_ be normalized (i.e. User with id 2 in the first example has 0 friends, consequently nulling the friends_id column. This could've been prevented by introducing the second table 'user_friends'.)
- Does not allow for modularity or new information per entry within the array (What if I wanted to date when each friendship was initiated through the app? Order the data based on this new attribute?)
```
| id | name |
-------------
| 1  | jess |
| 2  | mike |
| 3  | raj  |
| 4  | sam  |

| id | user_id | friend_id | created_at |
-----------------------------------------
| 1  | 1       | 3         | 2020-09-02 |
| 2  | 1       | 4         | 2020-03-20 | 
| 3  | 3       | 1         | 2020-09-02 |
| 4  | 4       | 1         | 2020-03-20 |
```
- Not a lot of SQL Engines and ORMS are optimized to handle arrays and lists (i.e. from experience, the schema file generated by Diesel ORM for Rust tends to mess up on optional array fields, as well as reported issues on migrations to MySQL/SQLite)

What are your thoughts?
In case of error redirect to your mirror at archive.org
Tags: archiveorg, waybackmachine, javascript, 404
Published: 2022-12-07 00:21:10

In case if your site goes down, and you don't have a mirror host for your content, [the wayback machine](http://web.archive.org/) from [archive.org](https://archive.org) provides you with such a thing you can make use of.
Just provide your http server or web framework to detect an error (in PHP you can use the functions [`set_error_handler`](https://www.php.net/manual/en/function.set-error-handler.php) and [`set_exception_handler`](https://www.php.net/manual/en/function.set-exception-handler.php)) and redirect to a page that will redirect you, using Javascript, to the corresponding archived content at the WayBackMachine.

----

The following code does the job:
```javascript
function archiveorgcacheurl() {
	origurl = location.href;
	url = new URL(origurl);
	console.log(url);
	return "https://web.archive.org/web/" + url.protocol + "//" + url.hostname;
}

```
Insert the following code at the bottom of your error page html:
```javascript
<script type="text/javascript">
setTimeout(function() {
	location.href = archiveorgcacheurl();
},5000);
</script>
```
After five seconds, it will redirect automatically to the mirrored copy at the wayback machine.

In case you don't want your users to wait this time lapse you can provide a link or button with the following html snippet:

```html
While the error is not solved you can visit a mirrored copy at <A href="javascript:" onclick="this.href=archiveorgcacheurl()">WaybackMachine Cache Page</A>
<h2>Redirecting you automatically... Please wait...</h2>
```

The complete code for the html page is in the Gist below: 
{% embed https://gist.github.com/digfish/9eee6aafba8cc4925d1c5a930ddcdd52.js %}
Introducing: Siteit v1.0.6
Tags: javascript, beginners, npm, programming
Published: 2022-12-07 00:11:41

Users can officially install  Siteit [using npm](https://www.npmjs.com/package/siteit) and feed it `.txt` or `.md` files to generate a static site. 

---

![animated-logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9y0gizsvbdxqshgxwjy3.gif)

---

It's my first time releasing a package on npm, so please go easy on me, guys! I have been working on this project for over three months. In the beginning, just a few function calls would do minor things, but with every revision, I have improved the way Siteit is, as a static site generator. 
Siteit is a command-line tool that accepts options and arguments, like a typical UNIX command. What makes Siteit different is that it logs coloured feedback, so the user is aware of whether the command was executed successfully. I achieved this using the [`chalk`](https://www.npmjs.com/package/chalk) module. Also, if a user feeds Siteit a directory containing `.txt` or `.md` files, it generates an Index file that lists and links all the other files. Siteit currently supports files in `.txt` and `.md` format.

I ran into issues making the CSS stylesheet work with Siteit post-release. Therefore, I used [Statically](http://statically.io/convert/) to convert Siteit's raw CSS file URL on GitHub into a CDN link. 

Also, I adjusted the CSS styles to enhance readability for various viewports. 

You can view the demo site generated using Siteit version 1.0.6 [here](https://siteit.vercel.app). 

### Installation
To install siteit run the following command
```bash
npm install -g siteit
```

### Usage
```
siteit [option] <file_path>

```

Click [here](https://github.com/SerpentBytes/siteit#usage) to see usage instructions.

I used [NP](https://www.npmjs.com/package/np) to simplify publishing my package to the npm registry. NP automatically runs checks, bumps the version, pushes the updated code on the GitHub repo associated with the project, and publishes the package on npm. 

[Won](https://github.com/Genne23v) was helpful enough in pointing out that the output directory was not being generated.
I had to rewrite my code using relative paths, as resolving to absolute paths was causing that error. 

Overall, it was a great learning experience. I feel more confident publishing packages to NPM in the future.

Sometimes running into errors is more of a blessing than a nuisance. If I had not run into issues publishing my package to NPM, I would have never learned about interesting errors in my code.