teleren/devto huggingface dataset:
How do you all create your resumes?
Tags: discuss, beginners, resume, coverletter
Published: 2022-08-09 04:44:00

- 1. Google Docs to PDF
- 2. Resume IO 
- 3. Other 


I use [Resume.io](https://resume.io/?ref=mpiypt).

{% embed https://resume.io/?ref=mpiypt %}

It's my resume https://resume.io/r/Lk77wPAj6

Drop 👇 your tool or your resume. 👋
Blog Engine with Fresh: Environment Variable & Database
Tags: javascript, webdev, react, fresh
Published: 2022-08-09 04:23:00

{% embed https://dev.to/sokhavuth/table-of-contents-41pd %}
GitHub: [https://github.com/Sokhavuth/deno-fresh](https://github.com/Sokhavuth/deno-fresh)
Deno Deploy: [https://khmerweb-fresh.deno.dev/](https://khmerweb-fresh.deno.dev/)
<br/>

```js
// setting.js

function setting(){
    const configure = {
        site_title: "Multimedia",
        page_title: "Home",
        message: "",
    }

    return configure
}


import { config } from "config";
await config({export: true});
const secret_key = Deno.env.get("SECRET_KEY");
 
 
import { MongoClient } from "mongodb";
const client = await new MongoClient();
await client.connect(Deno.env.get('DATABASE_URI'));
const mydb = client.database(Deno.env.get('DB_NAME'));
 
 
import { connect } from "redis"
const myredis = await connect({
    hostname: Deno.env.get('REDIS_URI'),
    port: parseInt(Deno.env.get('REDIS_PORT')),
    password: Deno.env.get('REDIS_PASSWORD'),
});


export { setting, secret_key, mydb, myredis }
```

```js
// import_map.json
{
  "imports": {
    "$fresh/": "https://deno.land/x/fresh@1.0.2/",
    "preact": "https://esm.sh/preact@10.10.0",
    "preact/": "https://esm.sh/preact@10.10.0/",
    "preact-render-to-string": "https://esm.sh/preact-render-to-string@5.2.1?external=preact",
    "setting": "./setting.js",
    "config": "https://deno.land/std@0.147.0/dotenv/mod.ts",
    "jwt": "https://deno.land/x/djwt@v2.2/mod.ts",
    "mongodb": "https://deno.land/x/mongo@v0.30.1/mod.ts",
    "redis": "https://deno.land/x/redis@v0.26.0/mod.ts",
    "bcrypt": "./bcrypt.ts",
    "cookies": "https://deno.land/std@0.150.0/http/cookie.ts"
  }
}
```

```
// .env
 
SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DATABASE_URI=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DB_NAME=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
REDIS_URI=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
REDIS_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
REDIS_PORT=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
Về vaniweb
Published: 2022-08-09 04:06:42

VaniWeb là nhà cung cấp các dịch vụ chuyên nghiệp cho Website và Digital Marketing tốt nhất, tận cùng tận cùng Việt Nam.

Thương hiệu: Vaniweb 

Địa chỉ:  611A Nguyễn Ảnh Thủ, P. Tân Chánh Hiệp, Quận 12, Thành phố Hồ Chí Minh 770000

Điện thoại:  098 247 21 12

Trang web:  https://vaniweb.com

Hashtag: 

#vaniweb #thietkeweb #website #digitalmarketing #seo #ads #google #dichvuseo #thietkewebgiare #thietkewebchuanseo #quantriwebsite #suachuawebsite #nangcapwebsite #seowebsite

Dịch vụ của chúng tôi
Dịch vụ website
Thiết kế website: https://vaniweb.com/dich-vu/thiet-ke-website/

Thiết kế web chuẩn SEO: https://vaniweb.com/dich-vu/thiet-ke-web-chuan-seo/

Thiết kế web giá rẻ: https://vaniweb.com/dich-vu/thiet-ke-web-gia-re/

Chăm sóc và quản trị website: https://vaniweb.com/dich-vu/cham-soc-website/

Sửa chữa - Sửa lỗi website: https://vaniweb.com/dich-vu/sua-chua-website/

Nâng cấp website: https://vaniweb.com/dich-vu/nang-cap-website/

Dịch vụ phát triển marketing online
Dịch vụ SEO website https://vaniweb.com/dich-vu/seo-website/

Mạng xã hội và phương tiện truyền thông khác của Vaniweb
Youtube - https://www.youtube.com/channel/UCH0as5WNFJTwFRNdVhGj6DA

Facebook - https://www.facebook.com/dichvuthietkewebgiarehcm

Tiktok - https://www.tiktok.com/@vaniweb.com

Pinterest - https://www.pinterest.com/vaniweb/

Twitter - https://twitter.com/vani_web

Myspace - https://myspace.com/vaniweb

Google Doanh nghiệp Vaniweb - https://goo.gl/maps/98DcuEZVduzGdeMC9
823. Leetcode Solution in
Tags: cpp
Published: 2022-08-09 03:44:32

```
class Solution {
 public:
  int numFactoredBinaryTrees(vector<int>& arr) {
    constexpr int kMod = 1e9 + 7;
    const int n = arr.size();
    // dp[i] := # of binary trees with arr[i] as root
    vector<long> dp(n, 1);
    unordered_map<int, int> numToIndex;

    sort(begin(arr), end(arr));

    for (int i = 0; i < n; ++i)
      numToIndex[arr[i]] = i;

    for (int i = 0; i < n; ++i)  // arr[i] is root
      for (int j = 0; j < i; ++j)
        if (arr[i] % arr[j] == 0) {  // arr[j] is left subtree
          const int right = arr[i] / arr[j];
          if (numToIndex.count(right)) {
            dp[i] += dp[j] * dp[numToIndex[right]];
            dp[i] %= kMod;
          }
        }

    return accumulate(begin(dp), end(dp), 0L) % kMod;
  }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/binary-trees-with-factors/
[DESABAFO] Cansada mas focada...
Tags: productivity, braziliandevs, blog
Published: 2022-08-09 00:35:55

A mais de 6 meses embarquei em uma viagem - até o momento sem volta - para a Espanha com a minha noiva e meu enteado em busca de uma qualidade de vida, o que, para mim, estava impossível de encontrar em São Paulo.

São 2:30 da madrugada e neste exato momento estou questionando o porque os meus olhos não fecham - e eu fico escrevendo coisas aleatórias - mesmo eu ter feito tudo o que eu me propus a fazer.

Eu estou cansada mas extremamente focada. Focada no sonho da tão desejada "liberdade financeira". Mas, na real? Eu tô cansada.

Quem não está neste nível, onde escutamos os famosos darem dicas de produtividade? Eu escuto, e estou cansada, porém focada.

Fiz uma lista de itens a serem realizados amanhã: mercado, limpeza da casa, cozinhar, inserir conteúdo, atualizar o site, iniciar a estrutura de outro site e criar um novo contrato de manutenção. Eu estou tomando banhos gelados (para refrescar os 37 graus), mas estou cansada porém focada 

Ninguém te ajuda? Claro que ajudam! Um leva o cachorro na rua, o outro arruma o quarto, um limpa a geladeira e o outro guarda a louça, um varre e o outro passa o pano... E mesmo assim estou cansada, porém focada.

Se eu vou tirar uma lição disso? Sim, eu vou mas hoje, eu só estou cansada, porém focada.
Tencent Cloud Lighthouse Instance Just Right for You
Tags: webdev, server, devops, gamedev
Published: 2022-08-09 03:31:44

**1. What is Tencent Cloud Lighthouse**

A Tencent Cloud Lighthouse instance is just as easy to create, network-isolated, and stable as a Tencent Cloud CVM (Cloud Virtual Machine) instance. In addition, it offers differentiated yet targeted capabilities for SMEs and individual developers, such as ease of mastery with fewer concepts/parameters and more developer/application-friendly features.

**2. Ease of Mastery with Fewer Concepts**
Lighthouse is designed with fewer concepts than CVM for you to master it more effortlessly. Furthermore, its technical implementation is transparently simplified to just two core parameters: application environment and instance bundle. The former is delivered as application and system images, while the latter includes the bundle type and fee information and internally encapsulates a diversity of CVM concepts, including AZ, model, VPC, bandwidth, and data transfer plan.

**3. More Developer/Application-Friendly Features**
Lighthouse is inherently designed and developed to be closer to applications and developers. Unlike CVM, it is more about application deployment rather than resource creation; therefore, you can always select an appropriate image first and then configure resource parameters, easily and quickly.
Lighthouse works well with various mainstream applications that can be swiftly created and managed. For SMEs and individual developers, it offers a selection of popular application images, such as WordPress, LAMP, Node.js, and ASP.NET.

**4. Virtualization and Quick Creation**
Based on Tencent Cloud VStation's powerful capabilities of centrally scheduling and managing heterogeneous resources (KVM, bare metal, microVM, etc.), Lighthouse features fast and smart scheduling and high reliability, especially when it comes to large-scale clusters. As Lighthouse is delivered mainly through application images, Tencent Cloud CBS snapshotting can be readily used to create a Lighthouse instance in seconds when a snapshot rollback is triggered.

Read more at: https://www.tencentcloud.com/dynamic/insights/sample-article/100316
Dev Journal - Day 1 - Odin Project - Rock Paper Scissors
Tags: webdev, beginners, codenewbie, odinproject
Published: 2022-08-09 03:25:00

**Understanding the Problem**
Rock Paper Scissors is a game played between 2 players, and for the purpose of this project, a user and the computer. For a single game round, each player simultaneously selects one of Rock, Paper, or Scissors. A winner is determined according to the following rules:
- A selection of Paper beats Rock
- A selection of Rock beats Scissors
- A selection of Scissors beats Paper
- else if both players make the same choice, the game is tied.

**Pseudocode**
```
1. Computer randomly plays “Rock”, “Paper” or “Scissors”
2. User inputs “Rock”, “Paper” or “Scissors”
3. Compare both player selections and assign a winner
4. If Rock and Paper are played, Paper wins
5. If Rock and Scissors are played, Rock wins
6. If Paper and Scissors are played, Scissors wins
7. If both selections are the same, game is a tie
8. Ensure Player’s selection-input is case insensitive
9. Ensure Player’s selection-input is case insensitive
10. Play 5 game rounds and determine final winner

```

**Concepts That Helped**
1. Array & String manipulation
2. Functions
3. Familiarity with conditional statements and comparisons
4. String manipulation to ensure case-sensitivity validation using toLowerCase()
5. Loops to keep count of multiple rounds and stop at 5 rounds
6. Googling, Grit and Github

**[Link to Project Code] (https://github.com/iBrendan/top-rock-paper-scissors)**

**Challenges & Learning Moments**
1. Had no trouble creating the functions but struggled somewhat with looping them and displaying the score. Referenced previous attempts and discussions in the Odin Project server
2. Learned Array & String manipulation as well as array.length property
Blog Engine with Fresh: Boilerplate Code
Tags: javascript, webdev, react, fresh
Published: 2022-08-09 03:10:00

{% embed https://dev.to/sokhavuth/table-of-contents-41pd %}
GitHub: [https://github.com/Sokhavuth/deno-fresh](https://github.com/Sokhavuth/deno-fresh)
Deno Deploy: [https://khmerweb-fresh.deno.dev/](https://khmerweb-fresh.deno.dev/)
<br/>

```js
// routes/index.tsx
 
/** @jsx h */
import { h } from "preact";
import { setting } from "setting";
import { Handlers, PageProps } from "$fresh/server.ts";
import Home from '../components/front/home.jsx';
 
 
export const handler: Handlers = {
  async GET(req, ctx) {
    const config = setting();
    config.message = "Welcome to Fresh framework!";
    return await ctx.render({ "setting": config });
  },
}
 
 
export default function Template(props: PageProps){
  return (
    <Home data={props.data} />
  )
}
```

```js
// components/front/home.jsx
 
/** @jsx h */
import { h } from "preact";
import Base from "../base.jsx";
 
function HomeJsx(props){
    return(
        <div>{props.data.setting.message}</div>
    )
}
  
 
export default function Home(props){
    props.data.page = HomeJsx;
    return(
        <Base data={props.data} />
    )
}
```
```js
// components/base.jsx

/** @jsx h */
import { h } from "preact";


export default function Base(props){
    const Page = props.data.page
    return(
        <html>
          <head>
            <meta charSet="UTF-8"/>
            <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
            <title>{props.data.setting.site_title} | {props.data.setting.page_title}</title>
            <link href="/styles/base.css" rel="stylesheet" />
            <link href="/fonts/setup.css" rel="stylesheet" />
            <script src="/scripts/jquery.js"></script>
          </head>
          <body>
            <Page data={props.data} />
          </body>
        </html>
    )
  }
```

```js
// setting.js

function setting(){
    const configure = {
        site_title: "Multimedia",
        page_title: "Home",
        message: "",
    }

    return configure
}

export { setting }
```

```css
/* static/styles/base.css */

:root{
    --background-light: #26f8ad;
    --background: lightgrey;
    --background-dark: #149165;
    --body-font: 14px/1.5 Vidaloka, OdorMeanChey;
    --link: #17a372;
    --color: black;
}
  
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a{
    text-decoration: none;
    color: var(--link);
}

a:hover{
    opacity: .7;
}

.region{
    max-width: 1100px;
    margin: 0 auto;
}
  
body{
    color: var(--color);
    font: var(--body-font);
    background: var(--background);
}
```
First impression of TailwindCSS. How much CSS should I know?
Tags: tailwindcss, beginners, css, codenewbie
Published: 2022-08-09 02:57:44

**After a 6 month Dive into CSS/SCSS, Tailwind is a godsend.**

Back when i started with CSS, I made a goal not to move on to anything else until I had a well-rounded understanding of how it really works. I spent time learning complex selectors, flexbox, box-model, animations, units, containers, etc. Had I not made the investment, I don't think i could use or appreciate Tailwind this much on first impression.

After learning how to style and make individual sections responsive I (foolishly) began building my first portfolio project with CSS. Architecture, and the need to build so many custom classes was such a time drain. 

Luckily a buddy of mine told me that i could probably get a grasp on tailwind, implement it, and build my project more quickly than continuing with just pure css. Immediately, I was concerned that I wouldn't be able to build on my CSS knowledge while using it.  My worries were put to rest this evening when  I saw that I was still able to create and integrate my own css along side their massive library. I've only spent a few days with it, but it's like there are new conveniences around each corner. It's like spring time after a long winter.

**I wouldn't recommend  starting tailwind unless you have a solid grasp on CSS.**
As you will most likely hit unneccessary stumbling blocks.
On a side note I truly wonder how many people take the time to understand css early, and if it was the best use of my time. I guess time will tell. I'm just alarmed at how often i hear mention of people only spending a week, or month with CSS, and declare that they have "Learned it". I can't say I blame them. I could have 5 months of JS under my belt by now. On that same token, taking that time taught me how to be a better learner. I'm hoping it all pans out when the JS headaches begin...
Self-Taught Dev Journey - The Beginning
Tags: webdev, beginners, codenewbie, odinproject
Published: 2022-08-09 02:55:00

**Introduction**
For the last few months, I've been learning web development using The Odin Project as my primary curriculum. I've made my way through the Foundations HTML/CSS section, and loved it so far. I'm now currently going through the Foundations JavaScript section. Unfortunately, my self-learning can sometimes be a sombre, scatterbrained, siloed approach. So I'd rather take an approach that encourages connecting with others and public learning. As such, I'm excited to document my journey here on dev.to and to help me 

- maintain accountability and consistency, 
- leverage the knowledge and network of the wider developer community here, and 
- [learn in public](https://www.swyx.io/learn-in-public)  

**Why Programming?**
Why does software development appeal to me? Why all the learning? Among other things, it will alllow me to
- Increase my creativity and ability to logically solve problems
- Increase my neural plasticity and
- Continue on a lifelong path of learning, and eventually cascade that knowledge to others


**Resources and Approach**
- [The Odin Project](https://www.theodinproject.com) - Primary
- Scrimba, Jonas' JS Course and FreeCodeCamp - for reinforcing obscure concepts
- [Full Stack Open] (https://fullstackopen.com)
- Build projects


**Goals**
- Start a software developer job within the next year.


**Takeaways**
There's a ton(!) of things to learn and it's easy to get distracted, so my approach will focus on familiarity and comfort with key programming concepts, understanding JavaScript, using a JS framework, building projects for my portfolio, and then a job search. Thankfully, The Odin Project and Full Stack Open encourage that laser focus.

I expect to run into mental blocks and learning roadblocks but I'll show grit and doggedness to keep going till I meet my goal. 

I'm confident it's about to be a worthwhile ride...
Table of Contents
Published: 2022-08-09 02:38:00

<dl>
    <dt><h2>A. Introduction</h2></dt>
    <dd><h4><em>1. <a href="https://dev.to/sokhavuth/boilerplate-code-5gc3">Boilerplate Code</a></em></h4></dd> 

<dd><h4><em>2. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-environment-variable-database-49ci">Environment Variable & Database</a></em></h4></dd>

<dt><h2>B. Login Page</h2></dt>

<dd><h4><em>1. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-building-login-page-4j6k">Building Login Page</a></em></h4></dd>

<dd><h4><em>2. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-creating-superuser-ojf">Creating Superuser</a></em></h4></dd>

<dd><h4><em>3. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-authenticating-user-4gia">Authenticating User</a></em></h4></dd>

<dt><h2>C. Admin Post Page</h2></dt>

<dd><h4><em>1. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-building-post-page-1imp">Building Post Page</a></em></h4></dd>

<dd><h4><em>2. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-logout-functionality-17k7">Logout functionality</a></em></h4></dd>

<dd><h4><em>3. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-creating-post-item-3njj">Creating Post Item</a></em></h4></dd>

<dd><h4><em>4. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-query-post-item-54d5">Query Post Item</a></em></h4></dd>

<dd><h4><em>5. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-editdelete-post-item-27hn">Edit/Delete Post Item</a></em></h4></dd>

<dd><h4><em>6. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-paginating-post-item-1kfe">Paginating Post Item</a></em></h4></dd>

<dt><h2>D. Frontend Pages</h2></dt>

<dd><h4><em>1. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-home-menu-header-5509">Home Menu & Header</a></em></h4></dd>

<dd><h4><em>2. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-listing-posts-on-homepage-1hag">Listing Posts on Homepage</a></em></h4></dd>

<dd><h4><em>3. <a href="https://dev.to/sokhavuth/blog-engine-with-fresh-building-single-post-page-5cfh">Building Single Post Page</a></em></h4></dd>

</dl>
MariaDB Quick-tip #8 - All foreign key constraints
Tags: mysql, sql, mariadb
Published: 2022-08-09 02:27:26

## MariaDB tips and tricks

This is part of a series of quick tips and tricks I have accumulated over the year, that I think can be useful for others.
If you have similar short tips and tricks please leave a comment.

### All foreign key constraints

A well designed database relates its tables to each other using foreign key relations in order to ensure data integrity. But when the database has hundreds or even thousands of tables it can be a huge challenge finding all the tables related to a specific table you may have to modify.
The query below will find all the foreign key constraints between columns with a specific column name.

```sql
SET @DatabaseName := 'test_db';
SET @ColumnName := 'dept_no';

SELECT concat(rc.unique_constraint_schema, '.', rc.referenced_table_name) AS `Primary table`,
       concat(rc.constraint_schema, '.', rc.table_name) AS `Foreign table`, 
       rc.constraint_name AS `Constraint name`
  FROM information_schema.referential_constraints rc
  JOIN information_schema.key_column_usage cu ON rc.constraint_schema = cu.table_schema 
       AND rc.table_name = cu.table_name
       AND rc.constraint_name = cu.constraint_name
 WHERE rc.constraint_schema = @DatabaseName
   AND cu.COLUMN_NAME = @ColumnName
 ORDER BY rc.constraint_schema,
       rc.table_name;
```

![DBeaver screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/meyex6z722pdbj72g7dg.png)
rm -rf in Nodejs?
Tags: node, nodejstip, javascript
Published: 2022-08-09 01:49:00

With the 𝗳𝘀𝗣𝗿𝗼𝗺𝗶𝘀𝗲𝘀.𝗿𝗺 method you can delete both files and directories. It's modeled on the standard POSIX 𝗿𝗺 utility.

If you enable the 𝗿𝗲𝗰𝘂𝗿𝘀𝗶𝘃𝗲 and 𝗳𝗼𝗿𝗰𝗲 options, you would replicate the famous 𝗿𝗺 -𝗿𝗳 command.

The 𝗳𝗼𝗿𝗰𝗲 option silences all exceptions if the path doesn't exist.

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

Did you learn something new today?

Like and share this post, and follow me for more!

![rm -rf](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ls85bwt6h1e4mvsrw9i2.png)
Intermediate HTML and CSS completed
Tags: css, html, beginners, webdev
Published: 2022-08-09 01:20:00

Greetings! It has been around a week since finishing the intermediate HTML and CSS portion of The Odin Project and it has been very enjoyable, to say the least. From learning about frameworks and preprocessors and when to use them to form validation and form basics (styling forms making them easier to read and digest.) This section/course was very fun, I am seemingly enjoying front-end web development a lot more than back-end for now! If you're wondering if I haven't posted about the Sign-up Form was mainly due to not being worthy of posting. The project did not turn out the way I wanted it to, the structure of the page was not up to par along with the readability being lackluster so decided not to post it.

(Here is the form if you're really interested. https://datamoshing.github.io/sign-up-form/)

Onto the last project of the intermediate HTML and CSS portion of the course, Admin Dashboard. This project was a fun one, you really feel like you're getting those CSS reps in with mainly CSS Grid and a bit of flexbox. The grid system was difficult at first figuring out how to structure a webpage so the layout defines the content but after a few videos from the front-end wizard @kevinpowell paired with a few amazing articles from css-tricks specifically https://css-tricks.com/snippets/css/complete-guide-grid/ it made me feel like I've leveled up on CSS.

## Admin Dashboard
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8mfe7lj0be13dat96pr.PNG)

Were off to the JavaScript portion of the Nodejs path! 🏁