teleren/devto huggingface dataset:
Top 10 Reasons Why JavaScript is So Popular in 2022
Published: 2022-01-12 01:59:48

## Top 10 Reasons Why JavaScript is So Popular in 2022
In this blog we are going to see Top 10 Reasons Why JavaScript is So Popular in 2022.
Top 10 Reasons Why JavaScript is So Popular in 2022

## [Click Here](https://codexashish.blogspot.com/2022/01/top-10-reasons-why-javascript-is-so.html) to read this blog

Thankyou
Room
Tags: atlashackathon
Published: 2022-01-12 01:41:11

### Overview of My Submission
#### Application URL
https://room.notawake.co/
#### Summary
A simple Web App to allow your students/event participants to "take a seat" virtually so that you, the instructor, can see their name and their location in the room.

### Submission Category: 
Choose Your Own Adventure
#### Service used
MongoDB Atlas

### Link to Code
{% github tlylt/room %}

### Additional Resources / Info
#### Screenshot
Main Page:
![Screenshots](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31ikxn214yl5tbhbggvy.png)
Individual Room Page:
![Screenshots](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z08cxyzpf8ef0cawpdoe.png)
![Screenshots](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w0bq7ladb9hnmwvj8u3w.png)

#### Demo
![gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vjmn1g7pd7m63anw0hmw.gif)
![gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77ceo4wvv9dpfmnf1iyo.gif)

## Thoughts
I had a lot of fun hacking(and debugging :joy:) this together in a day:)
An attempt was made to access a socket...
Tags: docker, webdev
Published: 2022-01-12 01:34:56

## The Error
Today I tried to fire up a project I haven't run in a long time.  It's a web app, and it happens to launch on a specific port: 50617.

I was frustrated to see this:
> An attempt was made to access a socket in a way forbidden by its access permissions.

## The Reason
I use Docker on Windows with the WSL2 engine, which involves Hyper-V.  Some quick googling revealed that this error usually comes up when you're trying to access a port that has been reserved by something else.  Hyper-V reserves a bunch of ephemeral ports, so it's a common culprit.

To confirm your port has already been reserved, open an admin command prompt and run this:

```cmd
netsh interface ipv4 show excludedportrange protocol=tcp
```

This will show you the ranges that have been reserved.  My port was in one of the ranges. 

## The Soltuion
I found the solution on this [GitHub comment](https://github.com/docker/for-win/issues/3171#issuecomment-873970535), so full props to the author for finding the solution.  I'm just writing this post to help make this easier to find than digging through long GitHub comment chains :)

The gist of it is:

1. Open an Administrator command prompt
2. Stop the Windows NAT Driver service
    ```
    net stop winnat
    ```
3. Create a manual reservation for the specific port you're trying to use (50617 in my case).
    ```
    netsh int ipv4 add excludedportrange protocol=tcp startport=50617 numberofports=1
    ```
4. Start the Windows NAT Driver service
    ```
    net start winnat
    ```
5. Run your project!

## Conclusion
This should get your port reserved and let you get your project running.  If you have additional tips related to this issue, leave a comment!

Thanks!
.webp to .jpg for Product Image
Tags: beginners, ecommerce, python, programming
Published: 2022-01-12 01:17:03

Recently a friend of mine asked me to help him with converting .webp image files to .jpg. Apparently you can't upload .webp files on Shopify. Converting one or two files can be done easily using free services available online, but bulk conversion was a different story. That's right - You need to pay up!

So I did a quick research and found out that I can use the Pillow library [https://pillow.readthedocs.io/en/stable/#](url) for image file conversion.

Let's look at the bare minimum.

```python

from PIL import Image

im = Image.open('image_file.webp')
im.save('image_file.jpg')

```
This code will take in an image file and spit out an image file of your choice.

As mentioned above, I need to a bulk conversion.
Let's bring in the os module to work with files and path.

```python
from PIL import Image
import os

cwd = os.getcwd()
file_path = os.path.join(cwd, 'imgs')
output_path = os.path.join(cwd,'output')
file_list = os.listdir(file_path)

for file in file_list:

    im = Image.open(os.path.join(file_path, file))
    file_name = file.split('.')[0]
    im.save(f'{output_path}\\{file_name}.jpg')
    print(f'{file_name} Done!')



```
I made 'imgs' folder where I have the original image files for conversion(.webp). Then I created 'output' folder for storing my output(.jpg). 

Then I got a list of my input files using the os.listdir() and looped over the list to save each file into .jpg.

Quick and easy!
#13 - Keypad Horror CodeWars Kata (7 kyu)
Tags: javascript, webdev, tutorial, 100daysofcode
Published: 2022-01-12 01:14:28

##Instructions

Having two standards for a keypad layout is inconvenient!

Computer keypad's layout:
![Keyboard Numbers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78zzy3hliihvrtmxdwtj.png)
 

Cell phone keypad's layout:
![Phone Keyboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1y8n41206bdcfo8mnrlg.png)
 
Solve the horror of unstandardized keypads by providing a function that converts computer input to a number as if it was typed on a phone.

**Example:**

> "789" -> "123"

> Notes:
> You get a string with numbers only

---

##My solution:

```javascript
function computerToPhone(numbers){
  const k = ['0','7','8','9','4','5','6','1','2','3']
  const p = ['0','1','2','3','4','5','6','7','8','9']
  return numbers.split('').map(d=> p[k.indexOf(d)] ).join('')
}
```

---

##Explanation
First I did two const variables one with keyboard numbers in order and the phone numbers in order

> const k = ['0','7','8','9','4','5','6','1','2','3']
> const p = ['0','1','2','3','4','5','6','7','8','9']

---

Then splitted the numbers string from the parameter into an array and I mapped that array, in every digit I would search in the phone numbers array the number that it is iterating, searching the index of that number into the keyboard numbers array, and then I just joined that new array, and finally I just returned the result

> return numbers.split('').map(d=> p[k.indexOf(d)] ).join('')

---

**Comment how would you solve this kata and why? 👇🤔**

[My Github](https://github.com/Cesardlr)
[My twitter](https://twitter.com/cesar__dlr)
[Solve this Kata](https://www.codewars.com/kata/5572392fee5b0180480001ae)
LeetCode #136: Single Number
Tags: algorithms, beginners, python, codenewbie
Published: 2022-01-12 01:04:47

By now I’m starting to see how Big O Notation is playing a role crafting a solution to a problem. The basis of the problem is to take a non empty array of integers called nums and to identify the element that only appears once. The only requirement is that the solution must utilize a linear runtime complexity and constant extra space.

 Linear runtime has a notation of O(n) meaning data scales linearly in relation to the amount of input. Constant time is O(1) where the time it takes for the function to perform its task will not be dependent on the amount of input.

To avoid getting overwhelmed, I’ve been trying to break down the steps of a challenge. Doing this helps me see the objectives I need to cover to achieve the solution while keeping my code clean.

```
//step1: count occurences of integers 
//step2: loop through integers
//step3: check to see if their value appears more than once
```

Essentially, what we are doing in these steps is keeping track of a value that doesn’t appear more than once. The counter() method does just that, for counting hashable objects. In this case we are keeping track how many of each integer are present in the array, and the integer that only appears once will be tracked. So now we know we must set a counter and place the array of integers nums as an argument.

```
def singleNumber(self, nums: List[int])
result = Counter(nums)
```

Now we have to extract the integer that only appears once from our counter method. To do so we use a for loop to iterate over the array of integers in nums. In each iteration, the conditional statement checks if there is an integer that only appears once. Since the counter() method is a subclass of a dictionary (which will be covered in a later post!), it checks if there is an integer with only one key in the dictionary with a count of 1. This will bring us to out solution.

```
def singleNumber(self, nums: List[int])
result = Counter(nums)
for i in result:
    if result[i] == 1;
       return i
```

Conclusion:
So far I’m feeling pretty content with transferring languages. Thanks to my bootcamp, the concepts I’ve learned have crossed over to learning Python which has made the adjustment less painful. As daunting as it is learning a new language, I find I learn more from diving into problems and googling if I don’t know the answer. A lot of times, there are handy methods like counter() that I wasn’t even aware of until I searched for them. I’ve been reminded by so many that googling is part of any software engineer’s workflow. There is so much knowledge and information out there, it is impossible to know it all.
At times I feel a bit defeated because I still haven’t been able to solve any of these algorithms yet on my own. But I continue to trust the process despite how painful it can be.
New Year, New Language
Tags: beginners, python, algorithms, codenewbie
Published: 2022-01-12 00:53:07

   The very first language I started off learning was JavaScript. Even before going into my coding bootcamp, I had a familiarity with the basics of JavaScript. As I became formally acquainted with it through the bootcamp, I encountered a lot of the commmon difficulties coders have when using the language. The language itself was more readable than the other languages I knew at the time, but the “anything goes” syntax and code flow of Javascript had me lost. For a while my confidence was truly shaken, and with enough studying I passed my assessment to continue the curriculum and start React/Redux.
   JavaScript quickly reappeared back into my life though React via JSX. Ironically, I found myself enjoying JSX as I began building frontend applications with React and Redux. With my newly found enthusiasm for JSX and in effort to sharpen my skills, I decided to use JavaScript as my chosen language on LeetCode. Immediately I felt the same feeling of confusion when constructing solutions. With the year coming to a close and my comfortability getting less and less, I was in need for a change. I knew I couldn’t truly be a great React developer if my JavaScript skills are lacking. I realized the best thing to do for myself was to take a step back, reteach myself the basics, and in the meanwhile, use a different language.
   Python was always on my list of languages I wanted to learn coming out of my bootcamp. In my job search it became evident how popular the language was and saw it in my best interest to learn in order to be a propspective candidate. An even bigger motivator for me to learn it was the fact that my peers were building projects with it. With the help of my peers I was shown the basics and found the language the most comprehensive to learn and read. An added advantage was how powerful the language is, that I would be able to solve algorithms which brevity compared to solving them in JavaScript. And with my knowledge of prior languages, I knew I was well equipped to understand crossover concepts and terminology.
   So while I continue reimmersing myself in the basics of JavaScript, I look forward to learning Python and other adventures that await! The future LeetCode articles on solution walk throughs will be predominantly done in Python from now on. With that being said, I’m always open to any corrections or other solutions! Thanks for following my articles, looking forward to what this year has in store!
Publications
Published: 2022-01-12 00:50:01

---
title: Publications
published: true
description: 
tags: 
//cover_image: https://direct_url_to_image.jpg
---

- Toru Furukawa (2021). _Stripe Connect Data Models and Fund Flows._ https://zenn.dev/toruf/books/stripe-connect-2021
- Toru Furukawa (2020). _Stripe データのコンセプト._ https://dev.to/torufurukawa/stripe-17n9
- Toru Furukawa (2018). _Twitter 広告と API を組み合わせたインタラクティブなキャンペーン._ https://www.slideshare.net/torufurukawa/twitter-api-121399949
- Toru Furukawa (2013). _Tast failed, then..._, PyCon APAC 2013, https://pyvideo.org/pycon-apac-2013-in-japan/test-failed-then-by-torufurukawa.html
Converting markdown to pdf with pandoc on linux
Tags: linux, blog, cli
Published: 2022-01-12 00:46:34

---
canonical_url: https://waylonwalker.com/til/convert-markdown-pdf-linux/
cover_image: https://images.waylonwalker.com/til/convert-markdown-pdf-linux.png
published: true
tags:
- linux
- blog
- cli
title: Converting markdown to pdf with pandoc on linux
series: til
---

Converting markdown posts to pdf on ubuntu takes a few packages from the standard repos.  I had to go through a few stack overflow posts, and nothing seemed to have all the fonts and packages that I needed to convert markdown, but this is what ended up working for me.

## Installing all the packages

``` bash
sudo apt install \
  pandoc \
  texlive-latex-base \
  texlive-fonts-recommended \
  texlive-extra-utils \
  texlive-latex-extra \
  texlive-xetex
```

## Using pandoc to convert markdown to a pdf.

``` python
# older versions of pandoc, I needed this one on ubuntu 18.04
pandoc pages/til/convert-markdown-pdf-linux.md -o convert-markdown-pdf.pdf --latex-engine=xelatex 
# newer versions of pandoc, I needed this one on ubuntu 21.04
pandoc pages/til/convert-markdown-pdf-linux.md -o convert-markdown-pdf.pdf --pdf-engine=xelatex
```



![results of converting this post to a pdf](https://images.waylonwalker.com/convert-markdown-pdf-linux-result.png)

> Here is an image of what converting this article over to a pdf looks
> like.  The raw markdown is
> [here](https://waylonwalker.com/convert-markdown-pdf-linux.md).
Explain JSX
Published: 2022-01-12 00:23:06

JSX full form is JavaScript XML. JSX allows us to write html directly inside javascript  that makes it easier to write and add html in React.

It is an extension of the javaScript that is translated into regular JavaScript at runtime.

We can write javascript expressions inside curly braces { } .

The expression can be a react variable and it will execute the expression and return the result.

**What we can done in JSX:**

- **Add javascript expression**:  Like we can add or multiply or any calculation in jsx.

```
const App = () => {
 const number = 10;
 return (
  <div>
   <p>Number: {number+2}</p>
  </div>
 );
};

```
- **Add comment**:  we can easily add comment in jsx using this keywords /* and */.

```
{/* <p>This is some text</p> */}

```
- **Use class and id**:  You can easily use class and id in jsx. But you have to use className instead of class in jsx..

```
import React from "react";
import ReactDOM from "react-dom";

const App = () => {
  const id = "some-id";
  return (
    <div>
      <h1 id={id}>This is a heading</h1>
      <h2 className="active">This is another heading</h2>
    </div>
  );
};

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

```
Coding Resources
Tags: resources, programming, webdev, beginners
Published: 2022-01-12 00:22:49

I am going to list some of my favorite resources and bookmarks. You know, I don't see enough of these out there!

•⚬𓈒🎮🛸🫲👾🫱🛸🎮𓈒⚬•

[Learn Reactjs](https://www.freecodecamp.org/news/learn-react-js-in-this-free-7-hour-course/)
[Fullstack Dev Path](https://github.com/shovanch/fullstack-web-developer-path)

![](https://replit.com/@Misslindsey91/coding-resources-unfinished#devlindsey.png)

## [My portfolio](https://lindseyk.dev)
============================================================

* * *

## Course Platforms
----------------

[![Udacity](https://res.cloudinary.com/codelikeagirl29/image/upload/v1679852482/1280px-Udacity_logo.svg_z9srvy.png)](https://www.udacity.com/)
[![codecademy](https://res.cloudinary.com/codelikeagirl29/image/upload/v1679856417/logo-codecademy-social-abfd8450722d675bddedde689f8af624-1-1100x200_wccy3b.png)](https://www.codecademy.com)
[![TeamTreehouse](https://res.cloudinary.com/codelikeagirl29/image/upload/v1679852482/Treehouse28Jan_2015_29_pv5kcn.png)](http://referrals.trhou.se/lindseykdeveloper)
[![freeCodeCamp](https://res.cloudinary.com/codelikeagirl29/image/upload/v1679852482/freeCodeCamp_-_Style_Guide_bissda.jpg)](https://www.freecodecamp.org/)

## Specific Tutorials
------------------

[Build an API with PostgreSQL & Node](https://www.enterprisedb.com/postgres-tutorials/how-quickly-build-api-using-nodejs-postgresql)
[Frontend Masters](https://frontendmasters.com/books/front-end-handbook/2019/)
[Free for Developers](https://free-for.dev/#/?id=apis-data-and-ml)
[Bezkoder](https://bezkoder.com/category/full-stack/)
[Coding the Smart Way](https://codingthesmartway.com/courses/)

============================================================

![toolbox image](https://res.cloudinary.com/codelikeagirl29/image/upload/v1679856298/dan-cristian-padure-noOXRT9gfQ8-unsplash_f5ukdz.jpg)

## Favorite Bookmarks
------------------

[Exercism](https://exercism.org/)
[Readme Generator](https://readme.so/)
[Fullstack open](https://fullstackopen.com/)
[150 Markdown Badges](https://dev.to/envoy_/150-badges-for-github-pnk?signin=true)
[GH for JS Tutorials](https://www.codesnail.com/18-github-repos-to-learn-javascript/)
[Web Dev Tools](https://paperform.co/blog/web-development-tools)
[Side Project Ideas](https://www.codementor.io/@npostolovski/40-side-project-ideas-for-software-engineers-g8xckyxef)
[Webpack Intro](https://www.freecodecamp.org/news/an-intro-to-webpack-what-it-is-and-how-to-use-it-8304ecdc3c60/)
[Beginner JS](https://beginnerjavascript.com/)
[Tracking Your Traffic](https://www.makeuseof.com/tag/6-websites-to-track-a-websites-traffic/)
[CSS Generators](https://webcode.tools/generators/css)
[CSS Media Queries](https://flaviocopes.com/css-media-queries/)
> This guys site is definitely one of my favorites!

I will be periodically editing this list and adding to it!
My first accepted pull request
Tags: opensource, careeradvice
Published: 2022-06-01 09:41:05

---
title: My first accepted pull request
published: true
date: 2022-01-12 00:00:00 UTC
tags: opensource,careeradvice
canonical_url: https://jhall.io/archive/2022/01/12/my-first-accepted-pull-request/
---

Have you ever made a contribution to open-source software?

If not, you really should.

It’s not hard.

I’m not sure when I made my first contribution to open source, but GitHub tells me about my first accepted pull request back in 2014. It was just a small [fix](https://github.com/smtpd/qpsmtpd/pull/76):

```
-#/usr/bin/perl -w
+#!/usr/bin/perl -w
 #
 #
 my $version = "0.1";

```

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Setup CORS in Caddy 2
Tags: caddy, caddyserver, server, cors
Published: 2022-09-17 14:27:50

---
title: Setup CORS in Caddy 2
published: true
date: 2022-01-12 00:00:00 UTC
tags: caddy, caddyserver, server, cors
canonical_url: https://kalnytskyi.com/posts/setup-cors-caddy-2/
---

[Caddy 2](https://caddyserver.com/) is an open source web server with automatic HTTPS. It's a wise choice for pet projects or self-hosted services, since you are free from managing TLS certs on your own and wiring things up can be super annoying.

One missing feature in Caddy 2, however, is cross-origin resource sharing ([CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)) support. For a "batteries included" web server, it's rather surprising. Fortunately, one can use the following [Caddy snippet](https://caddyserver.com/docs/caddyfile/concepts#snippets) to augment any site with CORS headers without repeating oneself over and over again.

You might want to update the list of headers returned by`Access-Control-Allow-Headers` or `Access-Control-Expose-Headers` HTTP headers according to your application needs. Please refer to the CORS documentation to learn more what they are about.

```
(cors) {
  @cors_preflight method OPTIONS
  @cors header Origin {args.0}

  handle @cors_preflight {
    header Access-Control-Allow-Origin "{args.0}"
    header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE"
    header Access-Control-Allow-Headers "Content-Type"
    header Access-Control-Max-Age "3600"
    respond "" 204
  }

  handle @cors {
    header Access-Control-Allow-Origin "{args.0}"
    header Access-Control-Expose-Headers "Link"
  }
}

example.com {
  import cors https://example.com
  reverse_proxy localhost:8080
}
```

The nice part about this snippet is that CORS headers are only returned for HTTP requests with the `Origin` HTTP header. That header is normally used by browsers only, which means you won't see CORS headers in responses for requests sent by `curl` or _your-programming-language-of-choice_.

I've been successfully using this snippet for quite a while now [to protect](https://github.com/xsnippet/xsnippet-infra/blob/1d583a6868597cb71bb2ae08f60bc42ac4364e91/roles/xsnippet_api/templates/caddy.j2#L1-L17) [api.xsnippet.org](https://api.xsnippet.org), so it can be accessed by [xsnippet.org](https://xsnippet.org).
Kali's stable Docker image is now named kali-last-release
Published: 2023-08-21 21:12:56

---
title: Kali's stable Docker image is now named kali-last-release
published: true
date: 2022-01-12 00:00:00 UTC
tags: 
canonical_url: https://www.kali.org/blog/renaming-kali-stable-docker-image/
---

Here is a very quick announcement for users of the [Kali Linux Docker Images](https://www.kali.org/docs/containers/official-kalilinux-docker-images/).

Until recently we used to have a Docker image named simply `kali`, and it was built from the last [versioned release](https://www.kali.org/releases/) of Kali (e.g. 2019.4, 2020.1, etc.) matching our [“kali-last-snapshot” network repositories branch](https://www.kali.org/docs/general-use/kali-branches/). In a way, this is our “stable” release, as it will only get updates quarterly as it is in synchronisation with our release cycle.

We still provide this **Docker image** , but now it has been **renamed from `kali` to [`kali-last-release`](https://hub.docker.com/r/kalilinux/kali-last-release)** for clarity.

The old `kali` Docker image is still around for the time being, but if you use it you will see a deprecation warning to indicate that it is in the **process of being phased out**. The rest of the deprecation plan is as follow:

- Upon Kali `2022.1` release, we will update the image to make it fail, meaning that the container will error out with a helpful message when you try to run it.
- Upon Kali `2022.2` release, we will completely remove it from [our Docker Hub](https://hub.docker.com/r/kalilinux/).

So if you still use this image in your scripts or Dockerfiles, **please update** those and use `kali-last-release` instead.

An additional reminder: if you are after the **most up-to-date version of Kali, you probably want to use the [kali-rolling](https://hub.docker.com/r/kalilinux/kali-last-release) Docker image**. This is the “main” image _(which matches our other platforms)_, and it is updated every week _(the network packages get updated daily also like all other Kali platforms)_.

For lots more details, please refer to our [official Kali Docker documentation](https://www.kali.org/docs/containers/official-kalilinux-docker-images/).

Thank you and happy 11111100110!

PS – On a related topic: the Kali images were recently added to the [containers shortnames list](https://github.com/containers/shortnames). It means that **Podman users** can run a Kali container simply by typing `podman run -it kali-rolling`, rather than using the full image name `docker.io/kalilinux/kali-rolling`. This works if the host system provides a very up-to-date shortnames list in `/etc/containers/registries.conf.d/shortnames.conf`. _If your host system is Kali Rolling, that’s already the case!_