teleren/devto huggingface dataset:
Supply Crate (My Most Meaningful Project)
Tags: computerscience, coronavirus, webdev, react
Published: 2020-05-26 05:57:23

I saw three problems related to COVID-19 donations:
1. People don't know how to donate
2. People don't know how many donations institutions need or have received
3. People don't have a way to track their donations

As such, I created Supply Crate (https://supplycrate.org), a website that tackles these three issues using an automated database of institutions and a QR-code tracking system. 

So far, the site has facilitated over 350K medical supplies and my efforts on Supply Crate have been featured on Fox 11 (https://www.foxla.com/news/irvine-teen-creates-covid-19-donation-website), ABC 7 (https://abc7.com/business/high-school-student-creates-website-to-help-fight-against-covid-19/6103551/), KTLA News (https://ktla.com/morning-news/local-high-school-senior-develops-website-to-give-back-to-senior-care-centers-during-covid-19/), and the national television special, *Graduate Together: America Honors the High School Class of 2020*. 

If you are an institution in need of a donation, you can fill out the google forms on the website to request for PPE.

If you are a donor willing to make a donation, you can visit the donor page and view different institutions on a list or a map (with sorting enabled by state and county). Select an institution you want to donate to and after filling out your donation information for an institution, the site helps you generate a QR-code label for your selected institution. Whenever the institution receives your donation, they will scan the QR-code and the site will automatically alert (via email) you when your donation arrives.

Tech Stack:
Next.js
Node.js
MongoDB
Twilio Sendgrid

In sum, this project was an very enriching experience that helped me understand the power of CS to help combat global issues.
Read Reddit without an internet connection
Tags: octograd2020, devgrad2020
Published: 2020-05-26 05:37:41

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project and experience.)

[Note]: # (If you used the GitHub Student Developer Pack on your project, add the "#githubsdp" tag above. We’d also love to know which services you used and how you used it!)

## My Final Project
I built a desktop app for reading Reddit without an internet connection.

Pre-download subreddits to read offline, including posts and their comments.

I built it with [Sidhya Tikku](https://sidhyatikku.com) who did the design, with the code being written by me.

## Demo Link
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zp3w7c1tknjzre3hqqzf.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/est3hcr3gyjxyn37bkvh.png)

## Link to Code
{% github https://github.com/kx-chen/Backpack %}

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
Built with Electron, React, and Redux. Got more familiar with JavaScript, React, and Yarn along the way. 

It was interesting and fun to look at Reddit on one screen and try to recreate its CSS by eyeball on the other.

Not too many fancy libraries were used, most of the code (like the navbar/sidebar) were created from scratch. Mostly using `node-fetch` for API requests, and `node-fs-extra` for managing files locally.

One of the challenges that we faced was collaborating. I live in Canada and Sidhya lives in India, so we had to schedule our Zoom calls at late in the night.

## Additional Thoughts / Feelings / Stories
If you think this is a cool idea, it would mean the world to us if you gave a star on GitHub!

https://github.com/kx-chen/Backpack

[Final Note]: # (CONGRATULATIONS!!! You are amazing!)
Stop event propagation Nativescript (vue)
Tags: nativescript, nativescriptvue, vue, snippet
Published: 2020-05-26 05:20:38

---
title: Stop event propagation Nativescript (vue)
published: true
description: A hack to implement stop event propagation
tags: nativescript, nativescript-vue, vue, snippet
---

Consider this layout:

```vue
<template>
  <FlexboxLayout @tap="dismiss">
    <Button text="Submit" @tap="submit" />
  </FlexboxLayout>
</template>

<script>
export default {
  methods: {
    dismiss () {
      console.log('dismiss')
    },
    submit () {
      console.log('submit')
    }
  }
}
</script>
```

When tap on `FlexboxLayout` area console output will be:

```
dismiss
```
and its okey.

When tap on "Submit" button console output will be:

```
dismiss
submit
```

But we expect to get:
```
submit
```

Since we have no official way to do this (like what in browser [Event.stopPropagation](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation)), then here is the hacky/dirty way:


```vue
<template>
  <FlexboxLayout @tap="dismiss">
    <StackLayout @tap="nothing">
      <Button text="Submit" @tap="submit" />
    </StackLayout>
  </FlexboxLayout>
</template>

<script>
export default {
  data () {
    return {
      ignoreTap: false
    }
  },
  methods: {
    nothing () {
      this.ignoreTap = true
    ,
    dismiss () {
      if (this.ignoreTap) {
        this.ignoreTap = false
        return true
      }
      console.log('dismiss')
    },
    submit () {
      console.log('submit')
    }
  }
}
</script>
```

Investigations:
- https://github.com/NativeScript/NativeScript/issues/3006
- https://github.com/NativeScript/NativeScript/issues/6606
- https://github.com/NativeScript/NativeScript/issues/4883
- https://stackoverflow.com/q/46403682/11898289
How to setup an ssh server within a docker container
Tags: docker, devops
Published: 2020-05-26 05:09:13

In this post I will walk you through my process of setting up ssh access to your docker container. 

### Why run an ssh server within a container in the first place?
The major reason why you might want to do this is for testing purposes, perhaps you are testing infrastructure automation or provisioning with something like ansible which requires ssh access to the target machine, you'd want to test this in a safe environment before going live.

* This article assumes you have docker installed on your machine if not you can refer to this page to get it installed [here](https://docs.docker.com/get-docker/) 

## The Dockerfile!

``` Dockerfile

FROM ubuntu:latest

RUN apt update && apt install  openssh-server sudo -y

RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 test 

RUN  echo 'test:test' | chpasswd
  
RUN service ssh start

EXPOSE 22

CMD ["/usr/sbin/sshd","-D"]

```

Here I am using ubuntu as the base image for the container, then on line 2 i install open-ssh server and sudo.

#### Sudo?
By default docker does not have sudo installed , hence the need to install it along with the open ssh server 

On line 3 i create a user called test and add it to the sudo group 

`echo 'test:test' | chpasswd `  sets the password for the user test to test

Line 5 starts the ssh service and line 6 tells docker the container listens on port 22 ( which is the default for ssh) and finally i start the ssh daemon.


### Building the image 

To build the image run ` docker build -t IMAGE_NAME . ` , once that's  done you can run the image using ` docker run IMAGE_NAME -p 22:22 `. finally you can connect to the container using the user you created , in this case it will be test so ` ssh test@ip_address ` enter your password in the prompt and your all setup 

The original Dockerfile can be found on my github [here](https://github.com/s1ntaxe770r/SSH-dockerfile)
Docker Macvlan Networks
Tags: containers
Published: 2023-01-06 01:20:37

---
title: Docker Macvlan Networks
published: true
date: 2020-05-26 05:01:43 UTC
tags: Containers
canonical_url: https://brandonrozek.com/blog/dockermacvlan/
---

It is useful to have some docker containers live in the same network as your host machine. We can accomplish this by creating a new MAC address for the container and using the `macvlan` driver. Here is example Docker Compose configuration

```
services:  
  nginx:
    image: linuxserver/nginx
    container_name: nginx
    hostname: nginx
    # Randomized MAC address
    mac_address: 4E:64:A4:60:8D:0E
    environment:
      PUID: 1000
      PGID: 1000
    volumes:
      - /etc/nginx:/config/nginx
    restart: always
    ports:
      - 80/tcp
      - 443/udp
    networks:
      macvlan_network:
        # Static IP for host network
        ipv4_address: 192.168.0.10
      # Allow access to nginx container in default docker network
      default: 

networks:
  macvlan_network:
    driver: macvlan
    driver_opts:
      # Obtain device name by looking at `ip addr`
      parent: eno1
    ipam:
      config:
        - subnet: 192.168.0.0/24

```
Monitoring Celery on Heroku with Flower
Tags: django, beginners, devops
Published: 2020-05-26 04:38:57

## The Setting

I built a small Django application for a client and launched it on Heroku. It takes posted data from a legacy application that the client is using for inventory management and sends it to their Shopify E-commerce store to keep everything in sync. To keep things running smoothly, I included a Celery worker to have a queue in place and speed up the post calls.

## The Problem
When it came time to test that all was working as it should in production - I realize that Celery's monitoring add-on -- Flower -- will not function on the same Heroku instance... which is unfortunate.

## The Idea

Heroku has a generous free tier -- I thought I could launch Flower on a separate free Heroku instance and connect the Redis broker URL from the Django application.

In my search on Heroku and Github - I did not find a working solution for my situation. While there are a few Flower & Heroku setups, they all had bugs that crashed the application on deployment or simply had vague instructions.

I managed to write a simple solution that worked perfectly for my project. Since I have been thinking of how to contribute to open source lately, so I thought I'd re-write my Heroku-Flower project and share it with the world.

## The Solution

All in all, launching Flower to monitor your Celery worker on Heroku is simple. Flower can be installed by pip; it simply needs to be included on your *requirements.txt* file. 

The tricky part comes in when you need to adapt the Flower app to your own needs. Does your Celery instance run on RabbitMQ or Redis? Do you need persistent storage? What about authentication?

Here's the solution for you -- 
{% github paqman85/simple-celery-flower-on-heroku %}

It has everything you need to launch a Flower Celery monitor on Heroku, with a Redis broker and basic authentication. I also did my best to cover every step of how to launch on Heroku, so it's beginner-friendly.
PartyTime v1.2 - Video Player & Torrent Streamer (based on FFmpeg)
Tags: csharp, dotnet, showdev, github
Published: 2020-05-26 04:35:00

The new release (v1.2) is out, supporting more formats and Torrent streaming with much better performance. I would be interested how it does (performance wise) in comparison with other players. Please have a try and let me know!

Download: https://github.com/SuRGeoNix/MediaRouter/releases/download/v1.2/PartyTime_v1.2_x64.7z

Github: https://github.com/SuRGeoNix/MediaRouter
Why Choose Node.js for your next Web Application Development Project?
Tags: node, webdev, devops
Published: 2020-05-26 04:20:25

The increase in the number of websites could only mean that the demand for web app development will certainly soar in the years to come. While developing a web app, the key factor is efficiency. The longer the project takes, the more costly it essentially becomes. Node.js is one of the most popular cross-platform, JavaScript runtime environments to build scalable and efficient REST APIs, mobile apps, desktop applications, and even IoT-based products.

What is Node.js?

Node.js is not a framework or a library, but a runtime environment, based on Chrome’s V8 JavaScript engine that helps in the execution of JavaScript code server-side. Moreover, it operates on a single-threaded event-based loop to make all executions non-blocking. The technology was first introduced back in 2009 by Ryan Dahl.

Here are some facts:

1.Node.js is an open-source source atmosphere
2.Node.js is free
3.Node.js runs on different platforms (Mac, Windows, Linux)
4.Node.js uses JavaScript on the server
5.3.5 million+ developers work with Node.js
6.80% of developers have 3+ years of experience in Node.js
7.500k downloads daily on an average
8.What is Node.js commonly used for?

Node.js is used for projects that actively use JavaScript on the front and backend of the project. Here are the most common areas where Node.js can be used:

. Static file server
. Micro-services
. Scripting & Automation
. Web Application framework
. Complex SPA’s (Single page apps)
. Real-time Chat apps
. Data Streaming apps
. Embedded systems
. Command-line apps
. Browser games Hardware programming

After its initial release in the year 2009, Node.JS has had its share of highs and lows. But, the developer’s community has striven to make it what it is now, one of the best web, app, and cross-platform development environment.


Let’s check the reasons why it’s high time to invest in Node.js for web app development: https://blog.neoito.com/node-js-web-development/
Feedback on my Flutter app
Published: 2020-05-26 04:07:38

I recently published a app that allows people who wish to study abroadbot to prepare for the IELTS exam which is required for proving your English language proficiency.

I used Flutter for the UI and firebase for the backend. 

My main goal for creating the app was to create a ad free interface where people can actually learn something useful. since playstore has so many such apps and I tried most and they are filled with ads and had very little to offer but over a million downloads. 

I tried to create the app in the most simplest way possible. 

You can find it on the playstore 

https://play.google.com/store/apps/details?id=tech.ieltsvault.ielts

I appreciate all the feedbacks.
Disabling go modules in Visual Studio Code
Tags: go, softwaredevelopment, vscode
Published: 2020-06-16 16:05:36

---
title: Disabling go modules in Visual Studio Code
published: true
date: 2020-05-26 04:00:03 UTC
tags: golang,go,softwaredevelopment,vscode
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/1*cp_JMGIX5mdRidp8k9eFuQ.jpeg)<figcaption>Photo by <a href="https://unsplash.com/@jjames25?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jeff James</a> on <a href="https://unsplash.com/s/photos/knobs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption>

I couldn’t find a good answer to this question and I looked for hours. Ultimately, I decided to document it here for the next time I need it and for anyone else out there who’s looking to disable go modules in in Visual Studio Code.

1. Open up Settings (⌘,) and search for “go tools env vars”

![](https://cdn-images-1.medium.com/max/1024/1*Lg2ZLyijFgvAigQm0LSBYg.jpeg)

2. Click “Edit in settings.json” and set GO111MODULE to off

![](https://cdn-images-1.medium.com/max/344/1*arPRPbdlc8FLjZOOCXOScA.jpeg)

I also disabled the go language server as it was burning a hole through my lap:

![](https://cdn-images-1.medium.com/max/1024/1*1YYT46if0mGahsOs8i7A1g.jpeg)

Well that’s all there was to it! I’m now able to use VSCode for all my editing needs.
V4l2 Webcam
Tags: audiovideo
Published: 2023-01-06 01:21:34

---
title: V4l2 Webcam
published: true
date: 2020-05-26 03:49:08 UTC
tags: AudioVideo
canonical_url: https://brandonrozek.com/blog/fakewebcam/
---

In Linux you can create a fake webcam by making use of the `v4l2loopback` kernel module.

To install,

```
sudo apt install v4l2loopback-dkms

```

If you already had an existing module, remove it so we can customize it.

```
sudo modprobe -r v4l2loopback

```

Then create the file `/etc/modprobe.d/fakecam.conf` and add the following line

```
options v4l2loopback devices=1 video_nr=20 card_label=fakecam exclusive_caps=1

```

The value of `video_nr` must be larger than the amount of cameras in your system. I wouldn’t have more than 10 webcams plugged into my system, so I set it to 20.

Then load back up the kernel module

```
sudo modprobe v4l2loopback

```

Now when you open up Chrome, Skype, etc, you should see a new device labeled “fakecam”.
Hello World vdev
Tags: personal
Published: 2020-07-08 07:17:47

---
title: Hello World vdev
published: true
date: 2020-05-26 03:47:46 UTC
tags: Personal
canonical_url: https://blog.n4vn33t.com/hello-world-v2/
---

 ![Hello World v2](https://images.unsplash.com/photo-1543332164-6e82f355badc?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=2000&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ)

This is my second try at blogging with Ghost!
And my first try for cross publish feature on dev.to.


I like the editor interface and **markdown**.
Configuring DHCP DNS in Pihole
Tags: networking
Published: 2023-01-06 01:22:08

---
title: Configuring DHCP DNS in Pihole
published: true
date: 2020-05-26 03:36:51 UTC
tags: Networking
canonical_url: https://brandonrozek.com/blog/piholedhcpdns/
---

There are two scenarios I can imagine in where you want to configure the DNS set by PiHole

1. You have multiple PiHole’s in your LAN
2. You have a multi-layer DNS setup

In either case, we can utilize `dnsmasq` configurations in order to set the DNS option. You should already notice `01-pihole.conf` and `02-pihole-dhcp.conf` in `/etc/dnsmasq.d`, we’ll need to create one that is numbered `03-*` or greater. I’ll use `/etc/dnsmasq.d/03-dhcp-dns.conf` as my example.

To set the initial DNS server to be from the router.

```
dhcp-option=6,192.168.0.1

```

To set multiple DNS servers

```
dhcp-option=6,192.168.0.2,192.168.0.3

```
JavaScript: How to Check if an Array has Duplicate Values
Tags: javascript, tutorial
Published: 2020-05-26 03:27:31

_Originally posted on [Will's blog](https://www.willharris.dev/garden/check-for-array-duplicates)_

---

When dealing with arrays of values in JavaScript we sometimes want to determine if the array contains any duplicate values. Unfortunately, JavaScript arrays do not expose any built-in methods that can do this for us -- we have to write the implementation ourselves.

One approach to this problem might look like this:

```javascript
function checkForDuplicates(array) {
  let valuesAlreadySeen = []

  for (let i = 0; i < array.length; i++) {
    let value = array[i]
    if (valuesAlreadySeen.indexOf(value) !== -1) {
      return true
    }
    valuesAlreadySeen.push(value)
  }
  return false
}
```

This works, but in the worst-case scenario where the only duplicate value occurs at the end of the array, this is not a very performant approach. We would have to iterate through the entire array (which could be huge!) only to realize at the last element that there is actually a non-unique value in the array.

Another approach that I recently learned harnesses the power of ES6 Sets.

In case you aren't familiar with Sets in JavaScript (I wasn't until recently!), [here is the MDN definition](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set):

> `Set` objects are collections of values. You can iterate through the elements of a set in insertion order. A value in the `Set` may only occur once; it is unique in the `Set`'s collection.

Read that last line one more time, as that is our secret sauce here. 'A value in the `Set` may only occur once; it is unique in the `Set`'s collection.'

This fact means that we can convert our original array into a `Set` and then be confident that it only contains unique values. Once we've extracted all of the unique values from the array and stored them in our `Set`, we can compare the lengths of the array and the Set. If the lengths are not the same, it must follow that the array contained duplicate values!

Here's what that approach looks like:

```javascript
function checkForDuplicates(array) {
  return new Set(array).size !== array.length
}
```

If the length of the `Set` and the array are not the same this function will return `true`, indicating that the array did contain duplicates. Otherwise, if the array and the `Set` are the same length the function will return `false` and we can be certain that the original array contained no duplicate values!

I really like this second approach for how concise and expressive it is, but [you might run into browser support issues if you need to target older browsers](https://caniuse.com/#feat=mdn-javascript_builtins_set_set_null_allowed) so take that into consideration!
Wildcard Domains in PiHole
Tags: networking
Published: 2023-01-06 01:22:25

---
title: Wildcard Domains in PiHole
published: true
date: 2020-05-26 03:26:00 UTC
tags: Networking
canonical_url: https://brandonrozek.com/blog/wildcarddomainspihole/
---

As of this time of writing, the current version of PiHole (5.0) supports adding custom DNS records, but not wildcard records. This makes it annoying if you run a bunch of different services within your LAN following a certain pattern.

Though since PiHole runs on top of `dnsmasq` it is easy to add an additional configuration file to point a domain containing `example.com` to a specific IP.

If you look in `/etc/dnsmasq.d/` there are the files `01-pihole.conf` and `02-pihole-dhcp.conf`. For our wildcard record, we’re going to add a new file `03-custom-dns.conf`. Let’s have an example where we want to map `example.com` and `*.example.com` to `192.168.0.10`.

```
address=/example.com/192.168.0.10

```

Once you save, restart the container or box and you will then have the wildcard record!
Uncrossed Lines - LeetCode
Tags: array, dynamicprogramming
Published: 2020-05-26 03:23:30

---
title: Uncrossed Lines - LeetCode
published: true
description: Medium problem
tags: Array, dynamic-programming
---

We write the integers of A and B (in the order they are given) on two separate horizontal lines.

Now, we may draw connecting lines: a straight line connecting two numbers A[i] and B[j] such that:

* A[i] == B[j];
* The line we draw does not intersect any other connecting (non-horizontal) line.

Note that a connecting lines cannot intersect even at the endpoints: each number can only belong to one connecting line.

Return the maximum number of connecting lines we can draw in this way

Let's split this into small sub problems

### Example:

**Input**: A = [1,4,2], B = [1,2,4]
**Output**: 2

![Uncrossed Lines](https://i.imgur.com/9TSpp7F.png)

Let's loop through A and B and consider each element and check how many lines can be drawn

* if A[i] == B[i] then 1 + dp[i-1][j-1] i.e., how many lines are drawn before this
* else, we take the max of prev row(dp[i-1][j]) and column(dp[i][j-1])

**Code**

```js
/**
 * @param {number[]} A
 * @param {number[]} B
 * @return {number}
 */
var maxUncrossedLines = function(A, B) {
	let m = A.length, n = B.length

	let dp = new Array(m + 1);

	for (let i = 0; i <= m; i++) {
		dp[i] = new Array(n + 1).fill(0);s
	}

	for(let i = 1; i <= m; i++) {
		for(let j = 1; j <= n; j++) {
			if(A[i - 1] == B[j - 1]) {
				dp[i][j] = 1 + dp[i - 1][j - 1]
			} else {
				dp[i][j] = Math.max(dp[i- 1][j], dp[i][j - 1])
			}
		}
	}

	return dp[m][n]
};
```
TCP/UDP with Bash
Tags: bash, networking
Published: 2023-01-06 01:22:38

---
title: TCP/UDP with Bash
published: true
date: 2020-05-26 03:10:15 UTC
tags: Bash,Networking
canonical_url: https://brandonrozek.com/blog/bashtcpudp/
---

The bash shell contains pseudo-devices to send packets with TCP/UDP. The pseudo files are formatted like the following:

```
dev/tcp/HOST/PORT
/dev/udp/HOST/PORT

```

To send a UDP packet to `localhost:6300` containing the payload “Hello, World.”, we would run the following command:

```
echo "Hello, World." > /dev/udp/127.0.0.1/6300

```