teleren/devto huggingface dataset:
The Sylar Project V 0.0.3 - 4
Tags: dohackathon, webdev, mentalhealth
Published: 2020-12-24 04:56:34

This post includes a review of my day 3 and day 4 work as well as what I hope to achieve before making the official submission post. 

So my main goal of making this an open-source project has been successful. I have had a couple of brand new developers open some small PR's to the project and that has been one of the best feelings ever. 

To keep the code consistent and at a certain standard, I've configured Eslint, Prettier, Husky Commit hooks, and GitHub actions for a CI/CD pipeline. This is legit now!

No huge differences in the way the UI is structured but I'm anticipating a PR on new mental health resources in California. 

I've got two main goals for the official v1.0.0 release which will be my hackathon submission. 

- Refactor the UI and make it nice using a Tailwind UI license I recently purchased. 
- Create a backend and form to allow people to add in their own resources without needing to make a pr. 

The plan with the added resources is that if a user submits something in the form it would go through some sort of approval process before being part of the overall API. Still looking into the best way to do this but if you've got any suggestions I'm all ears. 

Check out the current repo and deployed page below:

https://the-sylar-project-6avzk.ondigitalocean.app/

https://github.com/Rahat-ch/The_Sylar_Project
Advent of Code 2020 Solution Megathread - Day 23: Crab Cups
Tags: adventofcode, challenge
Published: 2020-12-24 04:54:23

---
title: Advent of Code 2020 Solution Megathread - Day 23: Crab Cups
published: true
description: We taught this crab how to play cards, and now he's hustling us using cups.
tags: adventofcode, challenge
series: Advent of Code 2020
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/mpp8oaxdcomb4o2zhpkc.png
---

Sorry, a bit late today.  Had my last day of work before the Christmas weekend, and I was on the road for a lot of the day.  Christmas Eve Eve!  So excited!

## The Puzzle

In [today’s puzzle](https://adventofcode.com/2020/day/23), that crab that we taught how to play cards has decided to teach us a game involving cups.  It's apparently a very clever crab.  Given cups labeled in a specific order, they are shuffled around based on an algorithm.  Our job is to keep track of them and not to let the crab hustle us.

## The Leaderboards

As always, this is the spot where I’ll plug any leaderboard codes shared from the community.

```
Ryan's Leaderboard: 224198-25048a19
```

If you want to generate your own leaderboard and signal boost it a little bit, send it to me either in a DEV message or in a comment on one of these posts and I'll add it to the list above.

## Yesterday’s Languages

Updated 08:54PM 12/23/2020 PST.

| Language   | Count |
|------------|-------|
| Python     |     2 |
| Haskell    |     1 |
| Rust       |     1 |
| JavaScript |     1 |
| TypeScript |     1 |

Merry Coding!
Letter to myself 2020
Tags: yearendreview
Published: 2020-12-24 04:46:28

---
title: Letter to myself 2020
published: true
description: Year End Review
tags: YearEndReview
//cover_image: https://direct_url_to_image.jpg
---
During Pandemic, I had purchased 15 books about cybersecurity to prepare myself transition into a cybersecurity career.

What are you passionate about? Don't assume that you can't learn the skills to work in the role of your dreams! If you are passionate enough and put some serious work into your learning, you will shine! :) - Miriam Wiesner, Security Program Manager at Microsoft
https://techcommunity.microsoft.com/t5/humans-of-it-ama/transition-from-developer-to-cyber-security/m-p/1553399#M13

At the end of April 2020, I joined the YouTube Partner Program and felt that my video content not so quality due to concern about revenue.

Lastly, I had two interviews with Microsoft but was not selected. I will continue to pursue my dreams.

2021, I will continue contributing to the community and more concerned about quality.
Vanilla JavaScript get form element's form
Tags: javascript
Published: 2020-12-24 04:26:50

Wow, weird title, but we want to get a form in which a specific element is sitting.

We could use [`closest()`](https://daily-dev-tips.com/posts/vanilla-javascript-closest/) or `parent()`, but for form elements we can even make it simpler!

We can use the `.form` on these elements.

To demonstrate I'm going to showcase two fairly common use cases

## 1. You know the input based on its ID

A very common use-case is that we know the ID of a input, and want to get its form.

Let's say this is our `HTML` structure

```html
<form>
  <input id="myInput" type="text" />
  <select onchange="findForm(this)">
    <option value="1">Change me</option>
    <option value="2">To anything</option>
  </select>
</form>
```

Now if we want to get the form element the `#myInput` belongs to we can do this:

```js
const input = document.getElementById('myInput');
let form = input.form;
console.log(form);
```

This return the following:

![Vanilla JavaScript get form](https://cdn.hashnode.com/res/hashnode/image/upload/v1608303060872/tPBjafc3o.png)

## 2. Input changed, get the form element

On the other side, you might find you need the form based on an element changing.

So in the case of our select each time it changes we want to get the form it belongs to.

```js
findForm = el => {
  let elForm = el.form;
  console.log(elForm);
};
```

Simple as that!

Find this full demo on this Codepen.

{% codepen https://codepen.io/rebelchris/pen/LYRLLMm %}

You might ask when you need this?

Let's say if the fields change you want to validate the whole form.
Or you need to do a lookup for another field to make sure those match.

A lot of options come to mind.

I hope you find this a useful method of finding an element's form.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
What if I don't use GET (and DELETE)?
Tags: discuss, restapi, webdev
Published: 2020-12-24 04:02:23

It's not only about [whether can I have body or not](https://stackoverflow.com/questions/978061/http-get-with-request-body), but also about schema validation.

Querystring-based schema makes it harder to validate, unless you use an URL-safe serialization. (And it still makes it hard with Swagger / OpenAPI)

So, if I choose to POST, [what benefits will I lose](https://stackoverflow.com/a/46639/9023855), and does it even matter? (perhaps, for scaling up)

I see two major scenarios here. 

- Caching helps
- [Caching is troublesome](https://stackoverflow.com/questions/10927766/force-http-request-to-not-cache)
How To Create UUID in Java?
Tags: java
Published: 2020-12-24 03:52:16

In this article you will see, how to create UUID in Java.

## Introduction

UUID, a universally unique identifier is a 128-bit number used to identify information in computer systems.

UUID is made of hex digits along with 4 hyphen ("-") symbols. The length of a UUID is 36 characters.

There are 5 types of UUID but mostly version 4 i.e. Randomly Generated UUID is used.

We are going to create the version 4 UUID here.

### Example UUID

df6fdea1-10c3-474c-ae62-e63def80de0b

## How to create UUID in Java?

Creating a Randomly Generated UUID (version 4) is really easy in Java.

UUID Class is present in  `java.util` package. And it has the static method `randomUUID()` which returns the randomly generated UUID.

The example is given below.

```java
import java.util.UUID;

/**
 * A Java program to create a Randomly Generated UUID i.e. Version 4 UUID
 * @author Gaurav Kukade at coderolls.com
 *
 */
public class CreateUUID {

	public static void main(String[] args) {
		
		// creating random uuid i.e. version 4 UUID
		UUID uuid = UUID.randomUUID();
		
		System.out.println("Printing the randomly generated UUID value......\n");
		
		System.out.println("uuid: "+uuid);
		
	}

}

```
Output
```java
Printing the randomly generated UUID value......

uuid: e3aed661-ccc2-42fd-ad69-734fee350cd2

```

Get the [above code as GitHub Gist](https://gist.github.com/gauravkukade/395f314c549969bd300d72c7e032dbcb).

This article was originally published at https://coderolls.com/create-uuid-in-java/

--------

You can visit my [YouTube channel 'coderolls'](https://www.youtube.com/channel/UCl31HHUdQbSHOQfc9L-wo3w?view_as=subscriber?sub_confirmation=1) to find more video tutorials.

#### Related Articles

-   [How To Reverse A String In Java (5 ways)](https://coderolls.com/reverse-a-string-in-java/)

- [8 Basic GIT Commands Every Newbie Developer Must Know](https://coderolls.com/basic-git-commands/)
Equality by Value vs Equality by Identity
Tags: python, computerscience, todayilearned
Published: 2020-12-24 03:20:51

There’s a difference in meaning between identical and equal. This distinction is the same distinction between `is` and `==` operator in Python.

- The `==` operator compares by checking for equality of values.

- The `is` operator, however, compares by checking for equality of identities (they point to the same memory address).

Suppose you have two lists.

```python
a = [1, 2, 3]
b = [1, 2, 3]

a is b # False (check equality by identity)
a == b # True (check equality by value)
```

One way to determine whether `a is b` is by using the built-in `id` function which will return the memory address that the variable name points to.

```python
id(a) == id(b) # False
```
Code Smell 51 - Double Negatives
Tags: codenewbie, tutorial, programming, oop
Published: 2020-12-24 03:05:36

*Not operator is our friend. Not not operator is not our friend*

# Problems

- Readability

# Solutions

1. Name your variables, methods and classes with positive names.

# Sample Code

## Wrong

{% gist https://gist.github.com/mcsee/f5c32dfa2aefa4f7fcb180ea28995508 %}

## Right

{% gist https://gist.github.com/mcsee/842684ebe8f5496d1d6374436a0c9473 %}

# Detection

This is a semantic smell. We need to detect it on code reviews.

We can tell linters to check for Regular Expressions like *!not* or *!isNot* etc as a warning.

# Tags

- Readability

# Conclusion

Double negation is a very basic rule we learn as junior developers.

There are lots of production systems filled with this smell. 

We need to trust our test coverage and make safe renames and other refactors.

# Relations

{% post https://dev.to/mcsee/code-smell-24-boolean-coercions-25l4 %}

{% post https://dev.to/mcsee/code-smell-07-boolean-variables-3koj %}

{% post https://dev.to/mcsee/code-smell-06-too-clever-programmer-37lb %}

# More info

[Remove Double Negative](https://refactoring.com/catalog/removeDoubleNegative.html)

[Boolean Methods](https://levelup.gitconnected.com/knot-of-nots-avoiding-negative-names-for-boolean-methods-641896a94a42)

# Credits

<span>Photo by <a href="https://unsplash.com/@herrond">Daniel Herron</a> on <a href="https://unsplash.com/s/photos/no">Unsplash</a></span>

* * *

> It’s harder to read code than to write it.

_Joel Spolsky_
Create Dark mode website theme by adding a single line of CSS
Tags: css, html, cssfilter
Published: 2020-12-24 02:28:32

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

We all know that now a days dark website theme become very popular each and every popular sites are providing dark theme. 

You know need to write multiple line of Javascript or jQuery or even CSS to achieve this. All you need is just one line of CSS.

Still don't believe me?
Without wasting time let's jump into the code.

### Here's the code
```
html.dark-theme {
    filter: invert(1);
}
```

[Click here for live example](https://voletiswaroop.github.io/)
Protect your PRIVACY from the next Cambridge Analytica 🔒🕵
Tags: privacy, security, beginners, tutorial
Published: 2020-12-24 02:26:15

Nowadays there are data breaches on a daily basis. It has become the norm to see on the news that companies have been hacked. But some data breaches are worse than others!

We have recently been reviewing all company and personal emails through websites such as [Have I Been Pwned](https://haveibeenpwned.com/). This website incorporates a massive amount of breached and leaks and let you check if your email has been pwned.

One specific breach caught our attention: **People Data Labs (PDL)**

# People Data Labs

By looking at it's website they mention they have accumulated over **2.5 billion profiles** from unique individuals.

Here is a partial sample of available fields when using their API:
- Full name
- First name
- Middle name
- Last name
- Gender
- Birth year
- Birth date
- LinkedIn url & username
- Facebook url & username
- Twitter url & username
- GitHub url & username
- Work email

This is just a small subset of the data collected on individuals by PDL.

# Protecting your privacy

If you find yourself in the **PDL** breach we would recommend that you ask you data to be deleted by PDL. With current Data Privacy laws they had to make an easy to use opt-out form.

The form is available here: https://www.peopledatalabs.com/opt-out-form

**HOWEVER BE WARY** the phone number field is not mandatory and you don't have to fill it in to opt-out. The less data your share the better it always is.

On a side note if you see your email on **Have I Been Pwned** as part of other data breaches we would recommend to update all your passwords.

---

# About Us
Pixium Digital is an agile software development company with their headquarters located in Singapore. We focus on shaping our clients project from ideas to successful project launch.

Cyber Security is a big part of any project we have to deliver. Very often we have been the witness of lack of awareness or caution from various providers or clients we have worked with. We aim to share those little tips to the community so that with everyone's effort, we can make the web a safer place.
Which language is easier for a beginner: JavaScript or Python? The short answer
Tags: javascript, python, beginners
Published: 2020-12-24 02:07:32

I originally answered this question in a tweet:

> Python is easier syntactically, but JavaScript is easier from a motivation standpoint: there's many more visually engaging things you can do as a beginner.
> 
> I suspect the motivation is a way bigger aspect than the syntax, so I think JavaScript is the easier language for beginners

And really, that's it. That's my entire opinion. Both are great languages, and unless you have any particular thoughts on career or use for programming you want in the future where one language is clearly better than the other (web-dev for JavaScript; or AI for Python, for example), then in my opinion, the easier language to learn is the one that motivates you the most to learn it.

After all, there's plenty of learning material for both. And when it comes down to it, they're not wildly different in terms of complexity, at least not at a starter level. So the limiting factor isn't complexity or lack of materials. It's your motivation: Are you going to stick through it, or get distracted half-way through because you don't feel like it's going anywhere?

That's where JavaScript is a clear winner. I'm a python dev, I prefer it over JavaScript where there isn't a clear choice. Yet I'll freely admit that starting out with JavaScript is way more engaging for beginners because of the visual and interactive projects you can build right away with a text file and a browser without even installing anything. That motivation effect can't be ignored, because the single biggest challenge you'll face learning programming, is finding the motivation to stick with it through the difficulties and the confusion that you'll face regardless of which any language you pick up first.

Good luck!
Throws signature Exception while Integrating new API services in AEM
Tags: challenge, help, aws, aem
Published: 2020-12-24 01:40:02

In Aem we would configure a service in such a way that it contains Aws access key, secret key, service name, channel, host. 
Already application is working fine for such configuration by utilising this server credentials.
But when I try to add new server with new credentials, host, access and secret key for some specific services it throws invalid signature Exception with the response as canonical string to string doesn't match with the generated one.

My doubt is does will signature generating code changes for different server credentials? And note aem doesn't use any Aws SDK.

Or else any other steps need to be performed from AEM side for accessing services Aws other than these
1.configuring a new server under apps/project/config.author folder
2.Accessing it from Java code and passing to 2 methods one for generating Aws headers (signature is generated at this step using AWSV4auth.java code) and other one for executing the post request call by passing access,secret key,Aws headers and getting the response.
In the response it's showing as "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."
The Best Holiday Themed Codepens
Tags: javascript, codepen, css, watercooler
Published: 2020-12-24 01:37:21

My favourite time of the year, Christmas! Even if you don't celebrate Christmas, you can still enjoy these wonderful and festive holiday-themed Codepens. 

### Christmas Cannon

{% codepen https://codepen.io/ste-vg/pen/BazEQbY %}

### Christmas Tree

{% codepen https://codepen.io/chrisgannon/pen/dypvKvR %}

### Merry Christmas with Santa Scene

{% codepen https://codepen.io/Alireza29675/pen/KwgwMy %}

### Christmas Game

{% codepen https://codepen.io/LantareCode/pen/QGoVmP %}

### Interactive Christmas Scene

{% codepen https://codepen.io/ashleynolan/pen/WbxNap %}

### Interactive Christmas Items

{% codepen https://codepen.io/levchenkod/pen/jEMwBb %}

### Animated Snowglobe

{% codepen https://codepen.io/chilliconcode/pen/rWpvOe %}

### Interactive Christmas Tree

{% codepen https://codepen.io/danwilson/pen/LYRPYpv %}

### Loading Christmas

{% codepen https://codepen.io/woodwoerk/pen/XXJoMa %}

### Christmas Wishes

{% codepen https://codepen.io/trishasalas/pen/Zagrav %}

Merry Christmas!

**Henry**
Don't get sucked into the vortex of courses
Tags: codenewbie
Published: 2020-12-24 00:58:18

Reda is a smart boy who started feeling interested in programming. He started a JAVA course 3 years ago, but he didn't complete it. He also started learning about reskinning android apps using but still didn't finish it.


The difference between those times and this one is that Reda has hated his school, it has been a year now that he always sits in front of his laptop only watching movies and series, but thankfully his gut was telling him that he should start. Spending his time right!


Coming back to now, Reda googled 'what is the best programming language to learn?' and of course, he found many opinions and advice, but without any serious reason, he decided to learn Python!


Reda downloaded a paid Udemy course from ThePirateBay (Reda is BROKE! lol), finished it after 1 month, but he didn't feel satisfied with what he learned thought about starting a new course.

 

Guess what? after 5 MONTHS, Reda is still watching courses and have 0 projects and 0 experience. Only knowledge !!!!

 

Courses are literally like a vortex. You will never get enough knowledge and feel satisfied unless you stop just watching and start coding! Start facing bugs and debugging them, start writing ugly code and beautify it, start googling your problems, start reading documentations to understand and find the solution of only what you need, start discovering others code, and understand it and change things on it...

 

Start with a course of basics, get to understand them, and forget about courses.
Coding is to code, not to watch!
🎉 Frontendor UI Library v2.0 is online
Tags: webdev, html, css
Published: 2020-12-24 00:46:47

Hello 👋,

After months of hard work on designing and improving the code based on your feedback, we are finally excited to announce that Frontendor V2.0 is available online at our website.

👉 Just visit: http://frontendor.com/?utm_source=devto&utm_medium=fr&utm_campaign=al

Any new suggestions, we are listening to you. Thank you very much for all of your support 🙌
Serving static data
Tags: angular
Published: 2020-12-24 00:19:36

I can't seem to find any documentation for this at all.  So, in the builders section of angular.json there's an 'assets' field for static data, pointing to files that I guess shows up served at /assets/... ?

How exactly does this work?  How are the final urls created, and under what rules? Why is this not documented anywhere?
How to rename a file synchronously in Node.js?
Tags: node
Published: 2020-12-24 00:00:00

---
  title: How to rename a file synchronously in Node.js?
  published: true
  tags: Nodejs
  date: Thu Dec 24 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/rename-file-synchronously-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-49982451578ee594e153c8c3975128dc.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/rename-file-synchronously-nodejs)
  
To rename a file synchronously, you can use the `renameSync()` function from the `fs` (filesystem) module in Nodejs.

```js
// Rename file synchronously
fs.renameSync("file.txt", "myFile.txt");
```

Let's say you want to rename a file called `file.txt` inside the `docs` directory, so the `path` to it looks like this,

```js
// path to rename
const path = "./docs/file.txt";
```

Let's rename the `file.txt` to `myfile.txt`. So let's create another variable to hold the new filename path like this,

```js
// path to rename
const path = "./docs/file.txt";

// new file name
const newFileNamePath = "./docs/myFile.txt";
```

Now we can use the `renameSync()` synchronous function and pass:

- the `path` as the first argument
- and the `newFileNamePath` as the second argument

It can be done like this,

```js
// require fs module
const fs = require("fs");

// path to rename
const path = "./docs/file.txt";

// new file name
const newFileNamePath = "./docs/myFile.txt";

// rename file.txt to myFile.txt
// using the renameSync() synchronous function
fs.renameSync(path, newFileNamePath);
```

And we have successfully renamed our file 🔥.

See this example live in [repl.it](https://repl.it/@melvin2016/rename-file-synchronous-nodejs#index.js).

### Feel free to share if you found this useful 😃.

---
Github - create a branch from issue
Tags: github, javascript, tampermonkey, automation
Published: 2020-12-23 23:50:50

Coming from Gitlab to Github, the most wanted and used feature for me was the automatic creation of feature branches from issues.

This was two years ago.

Surprisingly, Github has yet to implement this useful feature. Currently, It's [one of the most requested features](https://github.com/isaacs/github/issues/1125) on Github.

Realizing this, I went ahead and implemented it using the Tampermonkey script.

* After installing it, you will see a new blue button on the issues page.

* Clicking on it will create a new branch, which will have the same (almost) name as an issue.

![analytics](https://dev-to-uploads.s3.amazonaws.com/i/txdk41tvqy4jh2vfnufl.gif)

Source code and installation instructions are on Github:

[bumbeishvili/create-branch-from-issue](https://github.com/bumbeishvili/create-branch-from-issue)

Please try it out. I really hope it will be useful for many.

And I would appreciate your feedback