teleren/devto huggingface dataset:
Build web page/Site by markdown files
Published: 2022-08-18 00:54:00

Dear All,

Now you can use [casual-markdown-page](https://github.com/casualwriter/casual-markdown-page) to, which 
directly use markdown files as web page or web site (ie. markdown-as-webpage).

It is a single html file index.html to load markdown file into web page by the syntax of index.html?file={markdown-file.md}

It is very handy to build static web-site from markdown files, and host on free web hosting. For example,

github (self-host): https://raw.githack.com/casualwriter/casual-markdown-page/main/source/index.html
all-in-one version: https://raw.githack.com/casualwriter/casual-markdown-page/main/source/index-one.html
github page: https://casualwriter.github.io/casual-markdown
github page: https://casualwriter.github.io/

**Usage Guide**

* copy index.html or index-one.html to web server
* copy markdown files index.md and other files (*.md) to the folder

that's it!

* by default, it will load index.md as home page.
* hotkey [alt-k] to show page in dark mode
* for mobile, click on title to show/hide TOC.

It use frontmatter for page configuration (title, menu, navigation), for example

```
-----------------------------------------------------------
github  : https://github.com/casualwriter/casual-markdown 
title   : Casual-Markdown 
style   : #header { background: RoyalBlue } // additional style
menu    :    
  Home            : index.md
  Supported Syntax: md-syntax.md
  md-as-Doc       : md-as-doc.md
  md-as-Page      : md-as-page.md
  md-as-Blog      : md-as-blog.md
  [DarkMode]      : javascript:darkmode()
----------------------------------------------------------

## {{ title }} 

markdown content .....

```

it is the first release, looking forward to your comments for enhancement,

thanks,
I made a stupid magic 8 ball....
Tags: codecademy, cs101, python, beginners
Published: 2022-08-18 00:04:46

So, codecademy has these courses and learning paths which are pretty cool. I decided to try and push further on my self education of python and computer science in general. 
I am taking the codecademy Computer Science Learning path. I already have pretty decent skills(for an operations engineer) with python, so the first section is pretty easy, and quite boring for me. 

The last project on CS101 requires you to make a game, and post it in github, as well as write a blog post about it. Because I already know most of this material, and just want to get it checked off and move on to the next section, I am basically doing the bare minimum here. So keep that in mind, and realize that I KNOW this code and project and what not is pretty dumb. 

Anyway here it is:
https://github.com/digitalirony/codecademy_cs101

It has two functions. No classes. 
First function prompts for, and takes in a question from the user and stores it in 'question'.
Second function doesn't care what the question is....literally no one on earth does. It just gives a random answer from a pre-defined tuple. 

The code runs and prints everything at the end. Pretty stupid.
Word Frequency Counter using NLTK
Tags: nltk, python, nlp, tutorial
Published: 2022-08-17 23:55:00


NLTK is short for Natural Language Toolkit, which is an open-source Python library for NLP.

We want to count the frequency of words for the following text using NLTK.

>  text= "Morocco, officially the Kingdom of Morocco, is the westernmost country in the Maghreb region of North Africa. It overlooks the Mediterranean Sea to the north and the Atlantic Ocean to the west, and has land borders with Algeria to the east, and the disputed territory of Western Sahara to the south. " 


To install NLTK 

```
pip install nltk  
```

If you don't have Jupyter installed type the following commands in your terminal.

```
pip install jupyterlab
```

```
pip install notebook
```

```
pip install voila
```

run Jupyter with

```
jupyter notebook 
```

Import the following libraries.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5m20k31x7pupnoj16n11.png) 
 
Assign the text to a variable. 

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

The following function divides a sentence into words and punctuations.

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

Which you can see in the output.

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

The following code loops over the text tokens and counts the number of times a given token occurred. 
Using lower() we're going to convert the words into lowercase, like this we can avoid considering the same word in uppercase as different.

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

Top 10 most frequent words:

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

Now let's visualize it using Matplotlib.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/es2uyq7r11xilzc7e3gs.png)
You don't need code reviews and PRs
Tags: continuousdelivery, git, ci, tdd
Published: 2022-08-17 23:25:15

PRs & Code reviews are a blocker and bottle-neck for value generation. Allow me to explain.

A Pull-request was a feature created to allow maintainers of an open source project to receive changes from unknown contributors. It solves a trust problem, allowing the maintainer to review code before rejecting or accepting changes.

Developers working together as part of a team don't have trust issues. Otherwise, it is a different problem in which PRs are not the solution. At best, the issues of a team are about quality and norms.

Automating testing and practices like TDD, CI, and CD can solve quality problems. Automated tests create faster feedback loops when compared to a PR waiting for review and the usual back & forth with comments.

Testing Driven Development helps developers to design their code better and enable testability. Tests are created to support the acceptance criteria in the stories. When they all pass, developers are free to merge the code and move to the next story.

Continuous Integration reduces the chances of merge conflicts. It supports the idea that any code in the main branch is working software ready to ship to production. Pipelines produce feedback and help to avoid regressions.

Continuous Delivery accelerates teams by avoiding branch strategies. Everything is merged into the main branch and continuos tested. Code is deployed into production often, and feature flags can be used to allow for tests in production or canary releases

Pair Programming or Mob Programming eliminates the need for code reviews. Code is reviewed as it is produced. Disagreements can be solved on the spot instead of async through comments. Knowledge is shared, avoiding silos.

Norms can be enforced with code static analysis tools as part of the pipeline and pre-commit hooks. Quality gates can be added to implement minimum thresholds. Developers can focus on value generation rather than reviewing code that is faulty in style but functionally correct

For regulated markets, compliance and regulations can be satisfied without code reviews in most cases with modern Quality practices.

Unless you are developing an open source project, you should seek to stop doing PRs & Code Reviews. It will accelerate time-to-market and help to improve the product further with more frequent customer feedback.
10 GitHub repositories to Become a React Master 👨‍💻💯
Tags: react, webdev, github, javascript
Published: 2022-08-17 23:05:00

I came across a couple of GitHub repositories that will make you a React Pro in no time! If you're new to React or are already familiar with the framework and want to advance, you should check out these GitHub repositories.

## 1. Awesome React
⭐ 50.3K
A massive collection of nearly everything you need to know about React.
{% embed https://github.com/enaqx/awesome-react %}

## 2. React Bits
⭐ 12.3K
A collection of React patterns, techniques, tips, and tips.
{% embed https://github.com/vasanthk/react-bits %}

## 3. React Developer Roadmap
⭐ 17.4K
An amazing road map to becoming a React developer.
{% embed https://github.com/adam-golab/react-developer-roadmap %}

## 4. React Hooks Cheat sheet
⭐ 750+
A cheatsheet for React hooks with live editable examples
{% embed https://github.com/ohansemmanuel/react-hooks-cheatsheet %}

## 5. ReactJs Interview Questions
⭐ 23.1K
This repository contains almost every React interview question imaginable.
{% embed https://github.com/sudheerj/reactjs-interview-questions %}

## 6. React in Patterns
⭐ 11.6K
A free book that talks about design patterns/techniques used while developing with
{% embed https://github.com/krasimir/react-in-patterns %}

## 7. 30 Days Of React
⭐ 15.6K
This repository provides a step-by-step guide to learning React in 30 days. Before you begin, however, you should be familiar with HTML, CSS, and JavaScript. This repository is intended for beginners, intermediates, and advanced developers.
{% embed https://github.com/Asabeneh/30-Days-Of-React %}

## 8. React World React Apps
⭐ 2.7K
This repository's `/app` directory contains a plethora of open source real-world projects built by highly experienced React developers.
{% embed https://github.com/jeromedalbert/real-world-react-apps %}

## 9. React Coding Challenges
⭐ 2.1K
As the name implies, this repository contains a curation of various React challenges ranging in difficulty level.
{% embed https://github.com/alexgurr/react-coding-challenges %}

## 10. React TypeScript Cheatsheet
⭐ 35.8K
If you're a React developer learning TypeScript, this repository includes a variety of cheatsheets that you'll find extremely useful.
{% embed https://github.com/typescript-cheatsheets/react %}

## Conclusion

That's it for this article.

If you found it useful, consider following me on [Twitter](https://twitter.com/langford_dev) and signing up for my weekly [newsletter](https://www.getrevue.co/profile/langford_dev) for more web developer content.
5 JavaScript Events You NEED To Know 🌏
Tags: javascript, webdev, beginners
Published: 2022-08-17 22:58:04

Everybody has their favourite JavaScript event. No? Just me? Well, either way, here are **5 more** to add to your collection 👇

## [1. `offline` and `online`](dRapkZmErdw)
These events let you know when your user's network connection  drops out or comes back online, respectively. Especially helpful for good UX! 🖼️

{% youtube dRapkZmErdw %}

## [2. `hashchange`](https://youtu.be/B2rsPfwvbUk)
This one is perfect for building single page applications, or updating page content without refresh. #️⃣

{% youtube B2rsPfwvbUk %}

## [3. `transitionend`](https://youtu.be/KbaEQqHo-qY)
You can use this event to react to when a CSS transition finishes - great for building beautiful user interfaces 📑

{% youtube KbaEQqHo-qY %}

## [4. `load`](https://youtu.be/NdKTdc6dLoc)
Maybe you want to do something after an image or page is loaded, or you're just curious how long it takes. Either way, this event will fire off when something loads! 🔃

{% youtube NdKTdc6dLoc %}

## [5. `scroll`](https://youtu.be/V9CY0F4Wc7M)
One of my personal favourites, the scroll event lets you know when the user scrolls down the page. You can do plenty of interesting things with this, but keep handlers for this event light, for performance reasons 🚨🏎️

{% youtube V9CY0F4Wc7M %}

# JavaScript DOM Crash Course
You can find a complete course on the JavaScript DOM which goes over some of the topics covered in this post at the link below 👇
https://www.udemy.com/course/the-ultimate-javascript-dom-crash-course/?referralCode=DC343E5C8ED163F337E1
![Course Thumbnail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/769cuap96tu5s653bzld.jpg)

Happy coding 🤭
Tutorial: How to access Raspberry Pi remotely from anywhere
Tags: linux, devops, raspberrypi, security
Published: 2022-08-17 22:53:00

In this article, we’ll share a brief tutorial to help you access your Raspberry Pi remotely, easily, and fast using a centralized SSH server. We can assure you that our step-by-step guide will make the process much easier.

Once ShellHub can improve your development process, Raspberry Pi boards are a great option to help you achieve success in your projects.

## Requirements

On the Raspberry terminal type the following command to install Docker:

```
sudo apt install docker.io
```

To launch the Docker, run the command below:

```
sudo systemctl enable --now docker
```

Finally, set up the privileges for the current user:

```
sudo usermod -aG docker $USER
```

Now reboot the Raspberry Pi to apply the changes:

```
sudo reboot
```

Now we’re ready to install ShellHub!

### Creating an account on ShellHub

Installing ShellHub on your device is very easy. But before starting to add your devices and enjoy all features available, it’s necessary to create an account on the platform. It’s for free, no credit card is required.

To do that, you only need to access [ShellHub Cloud](https://cloud.shellhub.io/) and register yourself.

After registering, you’re able to add up to 3 devices to your account and access them whenever you need them.

## Installing ShellHub Agent

Now, it’s time to add the ShellHub agent to the RPI. When you access your account, a wizard will appear, showing the following steps to add devices to your account. Just copy the command, paste into Raspberry PI terminal and run it.

Your device will appear on the screen and you will have to confirm identity by clicking on accept button.

And we finished. Now You can access your RPI in an easy, fast, and safe way. If you have any doubts, feel free to check our [documentation](https://docs.shellhub.io) or contact us at contact@shellhub.io.

If you’re curious to know more about Shellhub, follow us on [Twitter](https://twitter.com/ShellHub_) and [LinkedIn](https://www.linkedin.com/company/shellhub-ssh/).
Day 130: Need a plan
Published: 2022-08-17 22:37:19

Hi!
I noticed a issues with focus since last week so i realized one of the issue may be that I have been working with no plan or any kind of time management routine. I'm now getting blocked on tasks with no idea where to start from  more often and it's affecting my productivity so I will need to do something about it. I will need to work thr implementation plan documentation which I haven't filled for a while now. I will also try to have a project management system or just any management system to track progress on some of unfinished tasks I still need to work on 
I will see what to do tomorrow

Signing off...
Drag n Drop / Rock n Roll - (2/100)
Tags: 100daysofcode
Published: 2022-08-17 22:28:00

I should mention that I did a little bit more work after my post yesterday to empty out my creative gas tank, so I 
* added the delete functionality
* added the edit functionality
* did a little bit of styling to the box

And ta-da....
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/funegrluy68khy1a1f9q.png)
 
Okay, I'll admit UX should not be this terrifying for me. In the past, all my personal projects all eventually develop the same style though (b/c of what I'm comfortable with and what I like). I'm not a big fan of wireframing for fun projects, but I did want to at least gather some inspiration.


I love the retro OS pastel look of boxy panels, and would love for the whole app to be configurable so you can have multiple "friends" open at one time, use context menus with right click, and have folders or groups for friends. It even reminds me of the God prayer program from Bruce Almighty. 

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

In order to do this, it seems necessary to have a drag-drop layout aspect. After weighing building my own with Svelte (which I think would be a really fun project for learning) or using a pre-built library, I chose to go with the latter. One of my goals with these 100 days is to finish a project, which I'd like to start with this site.

I did get nervous very quickly finding a library as most of them were for a more drag grid layout, which isn't exactly what I need. Also reading code in svelte is unfamiliar to me right now, and building a whole drag drop action was obviously intimidating. Luckily I found @[neodrag](https://www.npmjs.com/package/@neodrag/svelte) which ended up being a great option. I did a little test run with some fake objects:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8awjhgxio06tfid2tpa4.png)

So end of day 2 and it's looking a lot better!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zvh76seb080dqllhtik2.png)

Accomplished 🎉
* Create drag/drop windows 
* Use svelte:component to dynamically create windows for editing, list, creating friends
* Use eventDispatcher to allow nested elements to create and edit windows at the top level
* Add ids to friends (this needs polishing but will be helpful for future)



Next steps are:
* Styling (which I thought I'd have more time for)
* Common close window functionality 
* Context menu 
* Redesign friends list
Whats the music that brings the best work atmosphere for you?
Published: 2022-08-17 22:18:48

For me, I have a few but I fall back to theses a lot. 

[Spotify Dance Hits playlist](https://open.spotify.com/playlist/37i9dQZF1DX0BcQWzuB7ZO?si=J3_pmqZ7RWuEo-3OZPaMUA&nd=1)
[Spotify Dubstep Classics](https://open.spotify.com/playlist/37i9dQZF1DX4arVIN5Cg4U?si=ho2sgeHmS3uh_iqe1m7dWA)

I would like to see what other people are using. To see what music gets everyone else moving and performing their daily best.

One other trick I use is white noise. This is for when I need absolute focus. I'm sure we've all heard of it by now, but background noise that is designed to help you focus.

Check it out here at [https://coex.dev/tools](https://coex.dev/tools). On the left hand sidebar you'll see a background noise player. Give it a try!
Discord notifications on Google form submission
Published: 2022-08-17 21:47:02

it works in 3 simple steps

## Step 1 Get Webhook

Visit your discord channel and get the webhook url from integration settings

![get webhook url from discord integration and coopy webhook url](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1fwhv8s7iegifrqhe4e.gif)

## Step 2 Open DiscordNotify

Just open the google form and open DiscordNotify App, Click Add and add all the info with message template and press "Add"

![Open DiscordNotify](https://user-images.githubusercontent.com/55942632/185248960-8d79694e-e4bd-4c02-b332-4c6f18af0a44.gif)

## Step 3 Ready to Go 💨

DiscordNotify will do the heavylifting of sending Discord Notifications on you Google Form Submit

![Google Form Submission being sent to discord](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9rpowc6ntet8vgp97dy.gif)
Day 616 : Come Back
Tags: hiphop, code, coding, lifelongdev
Published: 2022-08-17 21:35:29

_liner notes_:
- Professional : Figured out how to get the demo app deployed to Heroku with the one click install button. Tested out some of the routes and looks like everything is working. Going to try one of the demo front ends to make sure everything is working as it should. There was a wider team meeting that I attended. I also got to see one of our interns give a presentation at a meetup. I helped out a little and checked out the code she wrote for her project. Ended the day in a way that I'll have a good start for tomorrow. Oh yeah, I finally booked some flights and hotel for an upcoming trip and maybe it was good that I took time to come back, because I saved like $300!

- Personal : Did some refactoring of my dashboard project. I pulled out some code into a separate component so that I can reuse it. Also got a date and time component working so that I can input them if I'm not pulling data from Meetup and it will do the calculations and fill out the correct fields. Didn't get a chance to work on listing the events though. I still need to stop the chron job so it will stop deleting my events.

![Giant stone spikes with trees on them sticking out of the forest of Zhangjiajie, China](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ctet4g90fkffri64x23d.jpg)

Ordered a new webcam, some lights, and other random things during lunch. Really went down a rabbit hole of YouTube videos and was buying stuff. haha If everything works the way I'm thinking, it should really simplify a live streaming application I put together. Definitely want to do some live streams on these next trips.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube fbH-lZHZHls %}
How-to split a number into equal chunks
Published: 2022-08-17 21:31:14

The other day I had to iterate over a large number of items but to avoid a timeout I could only compute a certain amount at a time. So I had to split the number into equal chunks and a remainder. Here’s an easy way to determine the chunk size:
`$totalNumber = 50321;
$chunkSize = 1023;
$remainder =  $totalNumber % $chunkSize;
$chunks = ($totalNumber - $remainder) / $chunkSize;`

The code return the following values:
$remainder => 194
$chunks => 49
Verification: (49 * 1023) + 194 = 50321

**How does it work?**
In line 5 `$totalNumber` is divided by a modulo operator (“%” is the PHP token for modulo). The operator returns the remainder of the division (194). By subtracting this value from $`totalNumber` it becomes a whole number multiple of $chunks and the division with `$chunkSize` equals the desired number of `$chunks` (line 6).
Now you have the number of necessary iterations and the remaining part.
How to delete a Kubernetes namespace stuck at Terminating Status
Tags: kubernetes, containers, docker, sysadmin
Published: 2022-08-17 21:27:37

---
title: How to delete a Kubernetes namespace stuck at Terminating Status
published: true
description: 
tags: kubernetes,containers,docker,sysadmin
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

After running a command like:

```bash
kubectl delete my-namespace
```
and the command hangs indefinitely after accepting the deletion request, you might find it sitting at `Terminating`:

```bash
$ kubectl get ns/my-namespace
NAME      STATUS         AGE
testing   Terminating    113m
```
This might be due to a [Finalizer](https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/) in the spec, specific conditions to be met during deletion. You can view the finalizers for your namespace:

```json
...
    "spec": {
       "finalizers": [
           "kubernetes"
       ]
    }
...
```
This is what a standard namespace with no other conditions might otherwise look like, so if it's hanging, this is likely way.

You can modify the resource using `kubectl edit ns/my-namespace`, and replace the finalizer with an empty array:

```json
...
    "spec": {
       "finalizers": [
       ]
    }
...
```

 or use the Kube API to update the specification to allow it to finalize manually if this is unsuccessful by dumping the resource:

```bash
kubectl get ns/my-namespace -o json > my-namespace.json
```
and editing that `my-namespace.json` to remove the finalizer, and then making a `PUT` request to the API:

```bash
kubectl replace --raw "/api/v1/namespaces/my-namespace/finalize" -f ./my-namespace.json
```
or using an HTTP client to issue the request (usually will require authentication if not exposing via [`kubectl proxy`](https://kubernetes.io/docs/tasks/extend-kubernetes/http-proxy-access-api/)) using that same json dump:

```bash
curl -k -H "Content-Type: application/json" -X PUT --data-binary @my-namespace.json "https://<Kube API Endpoint>/api/v1/namespaces/my-namespace/finalize"
```
You can then confirm, once you receive a successful response, that the namespace is deleted:

```bash
kubectl get ns/my-namespace
```
which should return no resource.