teleren/devto huggingface dataset:
Dendron - A Hierarchical Tool for Thought
Tags: pkm, notes, tooling
Published: 2020-11-01 17:51:49


Dendron is a note-taking tool I've been thinking about building for much of the last decade. 

All note taking tools help you put notes in, but after a point, they all make it difficult to get your notes back out. Dendron helps you find your notes no matter how many notes you have and works better the more notes you have. 

Dendron works by taking a [hierarchal first approach](https://www.kevinslin.com/notes/3dd58f62-fee5-4f93-b9f1-b0f0f59a9b64.html) to note taking. It provides users with flexible hierarchies that can be used to create, manage, and reference any amount of notes. 

Dendron starts with the foundation of flexible hierarchies and builds on top of this foundation with other constructs such as tags, backlinks, and note references (a means to embed notes within other notes). This is so to arrive at a usable centers between purely networked notes (which are often too flexible) and purely hierarchal notes (which are often too rigid). 

You can read more about our methodology and try out our tool by visiting our [site](http://dendron.so/).

ps. We officially launched on product hunt today. Would love to hear feedback and comments on our [product hunt page](https://www.producthunt.com/posts/dendron)!
My First HacktoberFest
Tags: hacktoberfest
Published: 2020-11-01 17:50:26




### [Intro Heading]
<!-- If you are new to the DEV community, introduce yourself and share a bit about why you joined DEV and decided to participate in Hacktoberfest this year.  --> 

I graduated this year from electronics engineering. Since my childhood, I was always fascinated with Sci-Fiction movies and always thought, can these things be made for real? Gradually, I startedf exploring the domain of AI and got really into it. During a project when I was stuck at dead-end, I was helped by a friend of mine. He introduced me to the world of Open-Source. When I dived into this ocean, it was overwhelming and also quite scary! But this HacktoberFest helped me get confidence with Open_Source Contributions. 

I found repositories to contribute from the well detailed and planned work of Otacilio Neto, his github repo: https://github.com/OtacilioN/awesome-hacktoberfest-2020, helped me a lot in finding suitable repositories. I contributed to python repositories and java repositories. In Python repositories, I contributed by adding different mini-projects done by me. In Java projects, I added practice code for Java which used the concepts of Objects and Classes. Both the repositories for beginners in Python and Java respectively!   

This HacktoberFest was my gateway to Open-Source COntribution. I look forward to contribute more in the community and also aspire developers in my peers to participate in such events. 

Thanks a lot to Digital Ocean and the contributing event organizers, for the awesome swags!
Hacktoberfest 2020: github-slug-action Maintainer
Tags: hacktoberfest, maintainer, opensource, githubaction
Published: 2020-11-01 17:49:47

---
title: Hacktoberfest 2020: github-slug-action Maintainer
published: true
description: Hacktobertfest report as maintainer on github-slug-action
tags: hacktoberfest, maintainer, oss, githubaction
series: Hacktoberfest 2020 report
---

>In addition of my participation for the 4th time in a row, This year report will focus on my activity as Maintainer.

Some projects ideas can start from a colleague tweet.

{% github rlespinasse/github-slug-action no-readme %}

This idea behind `github-slug-action` is one of them (tweet in French)

{% twitter 1191827751751299074 %} 

From this `SLUG` variable need, I start to develop my first GitHub Action. Using docker-based container and some bash script with `sed` or `cut`, I create the first version of this action quickly.

## master end-of-life

{% twitter 1254456661886066689 %}

After sometimes, `github-slug-action` start to be used by multiples projects and some enhancements have been asked.

This lead to a version bump to `2.x` due to a breaking change in April 2020. Due to that breaking change, I take the decision to change my branching strategy to adopt a `vX.Y` branch naming to better manage this type of change.

The `master` branch have been depreciated
{% github https://github.com/rlespinasse/github-slug-action/issues/15 %}

A removal of the `master` branch have been plan 6-months later. This work is complete.
Some repositories still used the `master` branch and a pull-request to migrate have been created of each of them during October before the `master` branch deletion.

**TIP**: Use [`Dependabot`](https://dependabot.com/github-actions/) to manage versions of used GitHub Actions in your workflows

## Docker-based GitHub Action limitation

{% github https://github.com/rlespinasse/github-slug-action/issues/16 %}

Currently, a docker-based GitHub Action can only run on Linux-based workflows.

In order to manage Windows-based and Macos-based workflows, the action need to be rewrite as Javascript-based action. In September 2020, [@Ameausoone](https://github.com/Ameausoone) have took up the challenge to migrate to Typescript.

Thanks you.

## GitHub Action CVE

During the Hacktoberfest, the GitHub Action have been impacted by a [CVE](https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures) on one of the GitHub Action core feature that been in used : [GHSA-mfwh-5m23-j46w](https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w).

Thanks you [@boolooper](https://github.com/boolooper) for the reporting.

On maintained branches, all impacted versions have been updated to fix this CVE and an advisory have been created on the project : [GHSA-7f32-hm4h-w77q](https://github.com/rlespinasse/github-slug-action/security/advisories/GHSA-7f32-hm4h-w77q).

## Before Hacktoberfest 2020

Thanks to [@Ameausoone](https://github.com/Ameausoone), [@m4rcs](https://github.com/m4rcs), and [@php-coder](https://github.com/php-coder) for yours contributions before this year event.
Hacktoberfest 2020: drawio-cli and drawio-export Maintainer
Tags: hacktoberfest, maintainer, opensource, drawio
Published: 2020-11-01 17:49:31

---
title: Hacktoberfest 2020: drawio-cli and drawio-export Maintainer
published: true
description: Hacktobertfest report as maintainer on drawio-cli and drawio-export
tags: hacktoberfest, maintainer, oss, drawio
series: Hacktoberfest 2020 report
---

>In addition of my participation for the 4th time in a row, This year report will focus on my activity as Maintainer.

Earlier this year, I want to be able to automatically export diagrams from a `drawio` file. This need lead to the creation of 2 new open-sources projects :

{% github rlespinasse/drawio-export no-readme %}{% github rlespinasse/drawio-cli no-readme %}

The `drawio-cli` project is responsible to generate a docker image with a **raw** cli of drawio (thanks [drawio-desktop](https://github.com/jgraph/drawio-desktop)) for that.

The `drawio-export` project use the `drawio-cli` project to enhance initial export capabilities.

## Support latest version of Drawio-desktop

At the beginning of Hacktoberfest, [@danquash](https://github.com/danquah) start working of this [issue](https://github.com/rlespinasse/drawio-cli/issues/4)

After an awesome work on debugging the version bump issues, he have create 2 pull-requests (1 on each project)

{% github https://github.com/rlespinasse/drawio-cli/pull/5 %}{% github https://github.com/rlespinasse/drawio-export/pull/29 %}

Thanks to him.

## Enhancements on drawio-export

Some `enhancement` issues have been [available for contribution](https://github.com/rlespinasse/drawio-export/contribute) during this Hacktoberfest 2020.

This new `--on-changes` option, to improve the speed of diagrams generation, have been develop by [@Nico385412](https://github.com/Nico385412).

{% github https://github.com/rlespinasse/drawio-export/pull/34 %}

Thanks to him.

## Before Hacktoberfest 2020

Thanks to [@bogaertg](https://github.com/bogaertg) and [@Decat-SimonA](https://github.com/Decat-SimonA) for yours contributions before this year event.
Check if a value is an array
Tags: javascript, webdev, beginners, codenewbie
Published: 2020-11-01 17:43:23

```js
const arr = [1, 2, 3];
console.log(typeof arr); // object
console.log(Array.isArray(arr)); // true
```
---
**Thanks for reading 💙**  
Follow **@codedrops.tech** for daily posts.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript  
**[codedrops.tech](https://www.codedrops.tech/)**
Windows 10 with MacOS-like key bindings
Tags: windows, productivity
Published: 2020-11-01 17:42:43


As someone who's been using Mac for a while, I find it pretty annoying to switch between my work Mac and my home Windows PC. There's a lot of tiny differences in keyboard shortcuts and micro-interactions that just make using Windows so awkward.

Here's the list of what this article will help you to set up:
* Use Cmd instead of Ctrl
* Use Caps Lock to switch keyboard layout
* Use Option+Left/Right to jump a word (unlike Ctrl+Left/Right on Windows)
* Use Option+Backspace to delete a word (unlike Ctrl+Backspace on Windows)
* Quit programs on Cmd+Q instead of Alt+F4
* Use F10, F11, F12 for Volume control
* Invert scroll wheel direction
* Have something like Spotlight


## Apps
PowerToys: https://github.com/microsoft/PowerToys
SharpKeys: https://github.com/randyrants/sharpkeys

## Keyboard Mappings
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7l3sov1qp4cbnh3dx926.jpg)
Swap Cmd (Win) and Ctrl with SharpKeys
Left Ctrl → Left Windows
Left Windows → Left Ctrl

## Set Key Mappings with PowerToys Keyboard Manager
Caps Lock → Win + Space (Change keyboard layout with Caps Lock)
F3 → Win + Tab
F12 → Volume Up
F11 → Volume Down
F12 → Volume Mute

## Set Shortcuts in PowerToys Keyboard Manager
Alt + Backspace → Ctrl Backspace
Alt + Left → Ctrl Left
Alt + Right → Ctrl Right
Ctrl Q → Alt F4
Ctrl Shift 4 → Win Shift S (screenshot)


## Add "Spotlight" to Windows: PowerToys Run
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k2n8zf3mhdtt1d7jub63.png)
Windows Start Menu search panel does the job most of the time, but I still miss the convenience of Spotlight's position in the center of the screen. Fortunately, PowerToys includes a feature named Run - and it looks and works (almost) exactly like Spotlight on a Mac.

Choose PowerToys Run in the sidebar, and use these settings:
- Enable: true
- Shortcut: Ctrl + Space
- Clear the previous query on launch: true
- Disable drive detection warning: true


## Reverse scroll wheel direction
These settings will bring "natural" scrolling direction to your Windows mouse. If you're lucky and never had to get used to the Mac-style scrolling, skip it.

- Source and detailed instructions: https://appuals.com/how-to-reverse-the-scrolling-direction-in-windows-10/
- Open Device Manager, find your mouse, find its Device Instant Path
- Open Registry Editor, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID. Find the folder that matches the Device Instant Path of the mouse
- Under Device Parameters set FlipFlopWheel to 1
Restart
Request Prometheus API from Robot Framework
Tags: robotframework
Published: 2020-11-01 17:27:27

<sub><span>Photo by <a href="https://unsplash.com/@i_m_polo">Ildefonso Polo</a> on <a href="https://unsplash.com/s/photos/meter">Unsplash</a></span></sub>

Having Prometheus to use for local test is great. It can be achieved [using Prometheus in a docker-compose](https://dev.to/antoinega/docker-compose-sample-with-prometheus-4cpb).

But it could be cool to use it along with integration testing. So let's request Prometheus at the end of the tests.

Prometheus exposes a REST API that can be queried.

# Query

Prometheus has at least [2 API that can be queried](https://prometheus.io/docs/prometheus/latest/querying/basics/) :
/api/v1/query and /api/v1/query_range .

Using the sample project from previous blog, we can make this call 
http://localhost:9090/api/v1/query?query=delta(dotnet_total_memory_bytes[2h]) that will gives us this response:

```json
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"instance":"app:80","job":"application"},"value":[1604065760.49,"14929036.50833937"]}]}}
```


# Request 

Robot Framework has a [library](https://github.com/MarketSquare/robotframework-requests) that can be leveraged to request REST API and consumes response.

```python
*** Settings ***
Library           RequestsLibrary
Library           SeleniumLibrary


*** Test Cases ***
GET the delta of total memory
    Create Session 	prometheus 	http://localhost:9090   
    ${resp}= 	Get Request 	prometheus 	/api/v1/query?query=delta(dotnet_total_memory_bytes[2h])
    Should Be Equal As Strings 	${resp.status_code} 	200
    Should Be True  ${resp.json()['data']['result']['result'][0]['value'][0]} < 2000000000
    [Teardown]
```


Hope this helps !
Is there a topic you wish there was an article about?
Tags: beginners, webdev, javascript, discuss
Published: 2020-11-01 17:10:21

I'm a senior frontend/fullstack engineer and also a team lead of 7 people. I know stuff about browsers, devtools, js, html, css, building layouts, frontend frameworks, backend servers, writing good APIs, optimizing stuff, writing readable code, deploying the app to a server, automating deployment pipelines, etc. You name it.

I want to start writing articles and my question to you is: 
 * What is the topic you wish there was an article about?
 * What topics most of the articles only scratch the surface? 
 * What do you think is cool, but you don't know how to do?
Jenkins & JUnit Integration with the API Tests
Tags: api, javascript, testing, tutorial
Published: 2020-11-01 17:04:01

In this post, we'll take a look at how to integrate API tests with [Jenkins](https://www.jenkins.io/) as well as add [JUnit reporting](https://junit.org/junit5/) with it. 

#### Installation / Setup
- You can check out this [video](https://youtu.be/ID0YM8iVL5M) to install Jenkins locally
- Publish API tests to GitHub 

#### Setup Test Job
- Create a new freestyle test job
- Add the necessary Source Code Management details (example - repository URL and Jenkins credentials)
- In the build step (choose either Windows batch command or shell command), add the steps you use to run your tests locally. For example -
```javascript
npm install // to install all the packages
npm test // to run your tests
```
- In the post-build step, choose the JUnit report option and add your report path, example - `test*.xml`
- Save changes and Build the project

You should see a successful build as well as JUnit reporting along with it, similar to this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zx19qvropfiyml4srlmb.png)

There you go, now you have Jenkins as well as JUnit reporting setup for your API tests 🙌

***

#### Check out this video to see how to integrate Jenkins and JUnit reporting with the API tests we have created so far as well as how to store environment variable in Jenkins:

{% youtube SCv4BH9pDJA %}

You can also clone the [GitHub repo](https://github.com/automationbro/JavaScript-API-Automation-Tests) to access this code

***

#### To learn more about API testing, check out my free tutorial series here - 
https://www.youtube.com/watch?v=ZSVw3TyZur4&list=PL6AdzyjjD5HDR2kNRU2dA1C8ydXRAaaBV&ab_channel=AutomationBro
***

I hope this post helped you out, let me know if you have any questions in the comments below! 

Happy testing! 😄 

...

Subscribe to my [YouTube](https://www.youtube.com/channel/UCjugV5pnY6WjvTGYm7U1ucg?sub_confirmation=1) channel
Support my work - https://www.buymeacoffee.com/automationbro
Follow [@automationbro](https://twitter.com/automationbro) on Twitter
Mental health in the Dev community
Tags: beginners, webdev, codenewbie
Published: 2020-11-01 17:03:16

For those who started out coding during the pandemic, it can be a bit hard. Especially if you were laid off because 'you were new to the company'(Trying to reduce the budget, they say). On top of that, It can be overwhelming to learn something completely different from the previous career you had. If you a single parent, it because even more overwhelming to balance learning to code and family. Pull off last nights or early mornings before everyone gets up. 

If you want to join a community that supports mental health among Devs join => [Devs Helping Devs on discord](https://discord.gg/JrTKvYf). At times when there is a lot of uncertainty, you need people who are positive and believe in you, even when you can't.

#### I wanna know, how you still keep that fire burning and pushing to learn code against all odds? (Do it in the comment section🤗)
I love taking time to relax and go for walks alone when I am overwhelmed or anxious about something. It gives me time to analyze the situation and come up with a realistic solution. This rejuvenates and helps me to clearly think about the next step. (Mostly for coding challenges or when I am learning something new.) 

  
####Stay positive, push through the hard times and remember `WHY` you started your journey in the first place. We are all in this together.❤
Docker Container Security: Attacking Docker Vulnerabilities
Tags: docker, informationsecurity, dockervulnerabilites
Published: 2020-11-01 16:57:43

Docker is one of the most widely used container-based technologies. It is a tool that helps to create, deploy, and run applications by using containers.

Containers make it easy for the developers to build the application with all its dependencies and libraries and ship it out as one package. But with new technologies come new vulnerabilities.

Below are the few attacks related to docker, its vulnerabilities, and mitigations explained. 

1. Privilege Escalation in a host using docker
2. Dangling volumes
3. Exploiting Docker Private Registry
4. Accessing Docker Secrets In Environment Variables
5. Exploiting Docker Daemon API
6. Container Escape Using Privileged Flag

A more detailed version along with how you can avoid these vulnerabilities is published at https://beaglesecurity.com/blog/article/docker-container-security.html
Hacktoberfest2020 
Tags: hacktoberfest, digitalocean
Published: 2020-11-01 16:41:23

This was my first time in this Hacktoberfest2020 and it was awesome. 

If people here take the open-source contribution seriously can actually see what they are capable of and they can do so much more.

People learn to use Github and know about the features that are used in it and create repositories for the same and believe me this wholesome is fun.

Encourage yourself and keep striving and yes..keep forking😁😁
Deploy angular project to Gitlab pages using gitlab.ci
Tags: angular, gitlab, javascript, typescript
Published: 2020-11-01 16:35:33

### You can support me

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fv8jyjdsb975y5ztsl2e.png)](https://www.buymeacoffee.com/grdtech)

## How to deploy your gitlab repo to gitlab pages, using gitlab.ci

First of all, I am assuming.. 
1. You already have your Angular project ready.
2. You have already setup your Gitlab account.
3. You have already Gitlab repository ready.

When you creates your Gitlab repository at that time CI/CD pipeline is automatically build for you and set up for you by default by Gitlab account. 

**What is benefit of CI/CD ?**
Once, everything is ready and setup correctly, When you push your code to remote repository, at that time one script is running parallelly, That script is creating your project and building your project automatically, and if everything is passed correctly, then production build code is ready to deploy to Gitlab pages, and your new code is published and ready to serve. Here, We are creating Gitlab ci.yml file.

**[ Step 1 ] : Create .gitlab-ci.yml**

Open your angular project. Inside root of your project [ at your package.json file ] create new file called ".gitlab-ci.yml". Inside this file add below script code.

```javascript
image: node:12.19.0
pages:
  cache:
    paths:
      - node_modules/
  script:
    - npm install -g @angular/cli@10.1.3
    - npm install
    - npm run buildProd
  artifacts:
    paths:
      - public
  only:
    - master
    - pages
``` 
First of all, 
1. "image:" is docker image and that image pulls node.js version 12.19.0.
2. Then inside "pages:", we are setting path of node_modules.
3. Inside "script:" first of all we install angular-cli. version is based on your angular project so change it accordingly.
All pages projects are served from "public" folder so we have to change path of it too.
We only deploy master branch and pages branch, any other branch will not detect inside CI/CD pipeline.

**[ STEP 2 ] Add new scripts inside "package.json"**

```javascript
"buildProd": "ng build --base-href=/your-repo-name/",
```
here, you need to change base-path and base-path is based on your gitlab repository. To check gitlab repository base path at gitlab.com... settings -> pages and inside this path see Your pages are served under: section like https://grdtech.gitlab.io/pizza-shop 
above /pizza-shop/ is your-repo-name

**[ STEP 3 ] update output path inside angular.json file**

```javascript
"outputPath": "public",
```
After following above steps, if everything is okay then after some time your project is deployed to your pages path url like https://grdtech.gitlab.io/pizza-shop



[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fv8jyjdsb975y5ztsl2e.png)](https://www.buymeacoffee.com/grdtech)
I Develop in Virtual Machines
Tags: devjournal, environment
Published: 2020-11-01 16:31:42

I am a JavaScript developer, and I use Virtual Machines for all of my development.

My set up:
- Hardware:
  - Lenovo ThinkPad T460s with:
    - 20 GB of RAM
    - 500 GB SSD hard disk
- OS:
  - Debian 10
- Virtualization Software:
  - native kvm/qeum

I set up a base VM and a separate VM for each of my projects.  

The base VM has:
- OS
- IDE (for me this is [atom](https://atom.io/))
- git
- wget
- curl
- [Postman](https://www.postman.com/)
- [Flameshot](https://github.com/flameshot-org/flameshot)(screenshot software)

I will then clone the Base VM, rename it, and set it up for the desired project. I also take periodic snapshots for easy recovery.

**My reasons:**
- Less risk to my laptop.

I have been known to do **bad** (unintentional) things with my code.  Like that day that I somehow set up a Node.js server that spawned itself and used up all my ports in about 10 minutes.  Having my dev environment separate from my actual laptop meant that I still had a working laptop, and I could restore the VM from its snapshot.

- Less bloat on my laptop.

Let's face it, I really don't want node, npm, mysql, mongodb, git, ...ect on my day to day laptop.  They take up space and processing power (even when idling in the background).  Having them on separate VM means they are running only when I need them.  And when I no longer need them, I can delete the VM.

- Specific configurations for specific projects

Each project in its own VM means I can fine tune the environment without disrupting any other project.  This makes it easier to track down bugs, and prepare the work for deployment.

- Easy transfer.

If and when I need to move to new hardware, I can easily take my dev environment with me, instead of spending hours setting it back up again.  I know for some that is part of the excitement of new hardware, but not for me.

There you have it - a brief stroll through my development set up.