teleren/devto huggingface dataset:
What I developed over the last months weekends
Tags: showdev
Published: 2020-12-05 05:40:20

---
title: What I developed over the last months weekends
published: true
description: my actual and new projects, done over weekends with Go, Vue, Rancher, ArangoDB, Redis, Nsq
tags: showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/2sl9yfnd7f9md8c12oso.png
---
Recently I started working on a new project called  [nboarding.com](https://nboarding.com). This is a tool to help founders, owners, or team managers onboard new people and delegate tasks efficiently.

Before that, I built [omnited.com](https://omnited.com), a kind of JIRA to manage tasks and projects. I wrote about that in a post  [I built my own little JIRA](https://dev.to/golangch/i-built-my-own-jira-45l8) 

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

Before that, and I'm now back working on that one, I built  [Kunvenu Social Media Posting Tool for Teams](https://kunvenu.com).

It allows the admin to set up teams, invites team members, and then share the social media accounts (Twitter, Facebook Pages and LinkedIn) with teams.
Team Members can then write posts and schedule them to send out to multiple social media accounts in one shot.
I use this tool for posts of to [#golang Twitter](https://twitter.com/golangch) and Facebook accounts and also for Developer Job Posts for my "oldest" project  [Fullstack Developer Job Board](https://fullstackjob.com) 

Learning from these experiences I will now introduce new features for [kunvenu.com](https://kunvenu.com) like cloning of posts, more metrics, probably more channels like Telegram Groups.

Stay tuned
Stefan
[Go Developer - Fullstack Developer](https://altafino.com)
Simply Learn !! [Introduction]
Tags: beginners, webdev, welcome
Published: 2020-12-05 05:31:46

*"Successful and unsuccessful people do not vary greatly in their abilities. They vary in their desires to reach thier potential."
--John Maxwell.*


Starting off with the this quote because this would remind me and anyone who reads, that it's just the matter of putting efforts for achieving your goal. 🎯

Hi, this is me, Amruta, a college student who is very much an expert of procrastination, as every other student out there. But this is not a good thing to be flexing about. 😅

And so I have been thinking about this, but what it ended up with was blaming all the negatives around me and avoiding the things that I should be actually doing. 🥱

But the quote above is the simplest answer to all the procrastination and worries as a newbie in this IT Sector I have. 😌

It made me realize that doing a bit of work makes you a lot more happier than avoiding it and having fun wasting your time here & there. 😃

And so, I would like to tell you all, from my experience, that it's okay to be doing something small at the start but it should be worth giving your time and helpful for your future, just like the smallest ants work hard for every single grain of sugar, we must keep doing things and once you are prepared, there is nothing that would stop you from getting the best of what you deserve. 📈

And as my small step towards my goal I will be writing about the things that I have learned so far in a way that won't make you scratch your head but in a way that will help you to understand things easily. ✒️

I will be writing about *Web-Develpoment* in simple and easy to understand terms.I hope you would enjoy it ☺️.
SQL Tip - Weird Behaviour of SUM or any operator When joining more than 2 tables
Tags: sql, webdev, mysql
Published: 2020-12-05 04:53:35

When joining more than two tables and you want to do some operator thing such as SUM from one table column, you have to make sure joining table query return only one result, else you would find some weird behaviour such as concat instead of sum. 

Have a look on this query 

```
select sum(payments.amount), users.id, channels.channel_name , channels.channel_id from users
left join payments on payments.user_id = users.id 
left join channels on channels.user_id = users.id and channels.id = (select id from channels where channels.user_id = users.id limit 0,1) 
group by users.id
```

if i don't add 
```
channels.id = (select id from channels where channels.user_id = users.id limit 0,1) 
```
when joining channels table, it might fetch more than one results of channels for that user and it would make sql to behave weirdly and it ends up concating `payments.amount` instead of `sum(payments.amount)`.
Idea validation: Never miss unlisted livestreams on youtube
Tags: idea, validation, indie, discuss
Published: 2020-12-05 04:46:14

---
title: Idea validation: Never miss unlisted livestreams on youtube
published: true
description: 
tags: idea, validation, indie, discuss
//cover_image: https://direct_url_to_image.jpg
---

Unlisted livestreams are only accessible only if you have the link (or URL) after it is over. Yes, if you are subscribed it will show up in the notifications of youtube but I think that is not clean and easy to find especially cause I have so many subscriptions 🙃.

So, I'm thinking about a chrome extension that would store the links of all the unlisted livestreams and people would be able to easily access those through the extension. They would be able to search/filter from the list.

I would love to know if that's the case with anyone or is it just me scratching my own itch.

✌️
Thanks!!!
Staking on TradeFinex: A Smart Way of using XDC
Tags: blockchain, xinfin, xdc
Published: 2020-12-05 04:43:18

The distinguishing marks of TradeFinex is that it coherently and deterministically links events on the #blockchain to those in the real world, thus ensuring a heightened reliability and stability vector. 
Staking on #TradeFinex: A Smart Way of Using $XDC: https://thecurrencyanalytics.com/21967/staking-on-tradefinex-a-smart-way-of-using-xdc
What It’s Like Being A Newbie Dev
Tags: beginners, javascript, webdev, design
Published: 2020-12-05 04:38:39

It’s not easy being a new Dev. We get this overwhelming feeling of “what in the hell am I supposed to do now?”- at least, I do. What’s the next project? What’s the next thing to learn? Why does everything look so bad? 

Well, I’m slowly starting to learn that it does get easier. The more I use React, or Vue, or whatever framework you want to use, the more I understand. It’s almost cliché at this point but, “just dive into projects, you’ll learn” really is true. 

The hard part, though, is figuring out what do we make? Another Twitter clone? Another todo app? I’m not sure about y’all, but I didn’t want to go with the same-ole-same-ole apps. 

So what did I make?
Well, something I found useful to me. I’m also a photographer so I wanted a website where people could go and see my work, that’s where [my portfolio](https://ericfortney.netlify.app) came from. I wanted something fast, easy to add to, and stylish. I would say 2/3 were achieved. 

But going along the lines of what to build, think about what you like to do besides coding. For me, I love space, rockets, and Formula 1. So I built a web app that uses the r/SpaceX API to display when the next SpaceX launch is. You can check out that small SPA [here](https://eloquent-heyrovsky-8d7e72.netlify.app/). 

But that honestly doesn’t help with the never ending question of “am I good enough?”

From my experience, nothing tells you “yes, you are ready.” You will know; you will feel it. You will have a feeling of “Yes, I’m finally ready”

And then you will get rejected, and rejected, and rejected. It sucks. I hate it. I get rejected daily. But I’m not letting it stop me. 

It takes minimal effort to apply for jobs. It takes all the effort to keep going. Build more. Learn more. Do more. 

It gets easier, but it’s never easy. 


What’s your feelings as a newbie? I’d love to hear in the comments!
Challenge of making a diamond of numbers
Tags: python, quiz, challenge
Published: 2020-12-05 04:33:19

---
title: Challenge of making a diamond of numbers
published: true
description: Python Quiz 
tags: python,quiz,challenge
//cover_image: https://direct_url_to_image.jpg
---

Recently, I got some message from my fellow about a quiz that she has to involve in a next couple of weeks. The quiz itself is actually has 5 assignments but I have remember just one.

I guess this is one simple assignment for any CS student. But as a long time software developer I think it one hell of a quest for me.

The assignment content here.


> _Make a python program that input any number then put that number in one diamond like in an example:_

```
Input number: 5
    1
   121
  12321
 1234321
123454321
 1234321
  12321
   121
    1
```

This is [my code in gist](https://gist.github.com/daftyw/2b5eee64391709af13375b425930bd9f)
Automating boilerplate: How do you do it?
Tags: discuss, watercooler
Published: 2020-12-05 04:19:07

---
title: Automating boilerplate: How do you do it?
published: true
description: Everyone approaches projects differently, from templates to scripts, how do you automate your boilerplate? 
tags: discuss, watercooler
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/tv58hw14nfw7pam1z0xo.jpg
---

Everyone approaches projects differently, from templates to scripts, how do you automate your boilerplate?
State Of CSS 2020 is out! DEV is the first runner-up blog.
Tags: meta, css, news
Published: 2020-12-05 03:55:26

State Of CSS 2020 results have come out.

### DEV is the first runner-up [blog and magazine](https://2020.stateofcss.com/en-US/resources/#blogs_news_magazines) behind CSS-Tricks.
Congratulations to the DEV team and everyone here! 🎉

![Blogs & Magazines Chart](https://dev-to-uploads.s3.amazonaws.com/i/fxi71zpdvu09tuy4lvnr.png)

### Awards

Things that stood out this year.

- Most Adopted Feature: **CSS Grid**
- Most Adopted Technology: **Tailwind CSS**
- Highest Satisfaction: **PostCSS**
- Highest Interest: **CSS Modules**
- Most Write-Ins: **PhpStorm**

![2020.stateofcss.com_en-US_resources_(aa)](https://dev-to-uploads.s3.amazonaws.com/i/9fr3j6zc7kfphrg7ogw7.jpg)

### Full results
You can see the full results on https://2020.stateofcss.com/

### State Of JS
Now, it's Javascript turn. Take the survey on https://stateofjs.com/
Squeezing time out of weekends
Tags: productivity, career
Published: 2020-12-05 03:37:24

## In the beginning

Having only weekends to work on side projects, I was strapped for time. In an attempt to create more time during the weekends, I started waking up early in the weekends around 6 to 7 am. The temptation of lazing in bed is strong but the drive to generate time was stronger so I dragged myself out of bed and went on with the day.

Waking up early does not get easier even after a month, but I pressed on and got work done. However, being awake for long hours made me drained and prone to distraction. I scrolling through social media applications on my phone or watching youtube videos excessively, procrastinating at the task on hand. At the end of the day, I am left with little time to complete my work.

## Taking Shape

Many weekends passed with me procrastinating, I decided that it needs to stop. Thus I wrote a guideline on what items that needs to be completed. Using Trello, I started to list down the tasks that need to be done and whenever I finished a task I would mark it as completed and move on to the next one. Having a guideline gave shape to my day but I was still distracted when dealing with daunting tasks such as debugging or planning out features which takes up a huge amount of time.

## Experimenting

To prevent me from getting distracted while completing tasks, I began allocating 2 to 3 hours time frame for completing the task only to break when the task was finished. Initially, I can complete my tasks but overtime it increasingly got more difficult to focus.

When a large time frame did not work, I shifted to a smaller time frame of one-hour intervals but it was still difficult to focus. While desperately searching for a solution, I came across the Pomodoro technique which indicates that one will work for 25 minutes and rest for 5 minutes. The ideal amount of cycle to hit is 8 with break time incrementing up to 15 minutes.

## Pomodoro Technique

Initially, I was skeptical about the time frame given to focus as it was only 25 minutes. After all writing code is all about immersing yourself in the lines and getting lost with time right? Well, I was never wrong more. The technique worked miracles, allowing myself to work for 25 minutes meant that I can have a laser focus on the task at hand and the short breather of 5 minutes allowed me to plan what I was going to do next.

## Conclusion

Overall, I am very happy with the results that I have achieved with the Pomodoro technique. It has allowed me to complete my work at consistent pacing, speeding up the development process. Moreover, with break time I can reduce the fatigue that I faced previously while coding for long periods.

Additionally, at the end of the day, I will do a review of what I have done and written it down. This is to prove to myself that I have indeed done something during the day and did not waste it.

Hope you have enjoyed it!
Code Smell 43 - Concrete Classes Subclassified
Tags: oop, codenewbie, tutorial, webdev
Published: 2020-12-05 03:06:11

*Inheritance. Concrete classes. Reuse. A fantastic mix up.*

# Problems

- Bad Models

- Coupling

- [Liskov Substitution](https://en.wikipedia.org/wiki/Liskov_substitution_principle) Violation

- Method overriding

- [Mapper](https://maximilianocontieri.com/what-is-wrong-with-software) fault

# Solutions

1. Subclasses should be specializations.

2. Refactor Hierarchies.

3. Favor Composition.

4. Leaf classes should be concrete.

5. Not leaf classes should be abstract.

# Sample Code

## Wrong

{% gist https://gist.github.com/mcsee/9780cd7772afddbc8356bab8aa5eabed %}

## Right

{% gist https://gist.github.com/mcsee/3edd25966d27541140a3e4672f5e9b3c %}

# Detection

Overriding a concrete method is a clear smell. We can enforce these policies on most linters.

Abstract classes should have just a few concrete methods. We can check against a predefined threshold for offenders.

# Tags

- Composition

# Conclusion

Accidental sub-classification is the first obvious advantage for junior developers. 

More mature ones find composition opportunities instead. 

Composition is dynamic, multiple, pluggable, more testable, more maintainable and less coupled than inheritance.

Only sub-classify an entity if it follows the relationships *behaves like*.

After sub-classing the parent class should be abstract.

# Relations

{% post https://dev.to/mcsee/code-smell-11-subclassification-for-code-reuse-1136 %}

# More info
 
[Wikipedia](https://en.wikipedia.org/wiki/Composition_over_inheritance)

* * *

> Software is a gas; it expands to fill its container.

_Nathan Myhrvold_
JS String Methods #4
Tags: javascript
Published: 2020-12-05 02:37:37

**In the name of Allah the most merciful and the most gracious**
Yesterday we studied charAt method and today we study about charCodeAt(index) which we pass index inside curly braces.
# charCodeAt(index)
This method returns or gives us the Unicode of a character.
```
let name='kamal';
console.log(name.charCodeAt(1));
//result -> 97
```
As we see the result is 97 which implies the Unicode of 'a' is 97.
# substring(startIndex,endIndex) and substr(startIndex,length)
substring requires two indexes which are the start index and the end index.
> Difference between slice and substring is that the slice method accepts negative indexing but the substring method doesn't accept negative indexing.
```
let name='java';
console.log(name.slice(-1,-4);
//result -> jav
console.log(name.substring(-1,-3);
// result -> nothing
```
Nothing means that substring does not accept negative indexing.
*substr() is similar to slice()*.
The difference is that the second parameter specifies the length of the extracted part.
```
let fruits='apple banana orange pomegranate';
let citrus=fruits.substring(13,19);
console.log(citrus);
//result -> orange
let vitaminCFruit=fruits.substr(20,11);
console.log(vitamicCFruit);
//result -> pomegranate
```
Podcasting SEO: How to Optimize a Podcast Website For Google- The Building an Indie Business Podcast
Tags: webdev, podcast
Published: 2020-12-05 00:31:27

[Listen Here](https://open.spotify.com/episode/5750ROHPGVg8iuEFSXXHzF?si=7k24bAWWTXO5hwrCols8EQ)

In this episode, I discuss Podcasting SEO. Why optimize a podcast website for Google, My goals around SEO, the most important ranking factors, structured data, meta tags, backlinks, time on site, transcripts, Google Search Console, search intention, broken link strategy, skyscraper technique, website accessibility

This is the first Thursday episode. The reason why is because I have been focusing on SEO for a while and wanted to do an episode on it. But it never fit into my schedule.
Unit tests dos and don'ts
Tags: php, testing
Published: 2020-12-05 00:04:09

When writing a unit tests. There are couple of things to do and couple of things which should be avoided. In this article I have listed the dos and don'ts with regards to unit testing.

##dos
1. Test only the public functions.
2. Test each and every public function. In a ideal world a class should have only one public function and its dependencies.
3. Mock every dependency.
4. Test should cover success and failure, both aspects of a code.
5. Test that every raised exception is tested.
6. Always specify how many times a function is expected to be called while testing a piece of code.
7. Test setup pain is a smell, which means your code needs to be refactored.
8. Code coverage should be 100%, which means each and every line of the tested class was reached.
9. Live deployment should not work with failing unit tests.
10. Add tests to classes which are missing unit tests.
11. Write meaningful names which explain what the test is doing example names testUserRegistrationWasSuccessful, testUserRegistrationWasNotSuccessful, testUserRegistrationRepositoryThrowsException

##don'ts
1. Tested class should never talk to database, file, network resources etc.
2. Dependencies in tested class should not create real class objects.

http://www.rosenborgsolutions.com/articles/phpunit/phpunit-best-practice
How to count the number of properties or keys in an object in JavaScript?
Tags: javascript
Published: 2020-12-05 00:00:00

---
  title: How to count the number of properties or keys in an object in JavaScript?
  published: true
  tags: JavaScript
  date: Sat Dec 05 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/count-keys-or-properties-object-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-b41daf939fe9f983b2cec4338e8265a4.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/count-keys-or-properties-object-javascript)
  
To count the numbers of keys or properties in an object in JavaScript First, we can use the `Object.keys()` method to extract the keys from an object into an array and then use the `length` property on that array returned from the `Object.keys()` method to get the total count.

```js
const count = Object.keys(obj).length;
```

Consider this object with some properties,

```js
// an object
const obj = {
  id: 1,
  name: "Leanne Graham",
  username: "Bret",
  email: "Sincere@april.biz",
  phone: "1-770-736-8031 x56442",
  website: "hildegard.org",
  company: {
    name: "Romaguera-Crona",
    catchPhrase: "Multi-layered client-server neural-net",
    bs: "harness real-time e-markets",
  },
};
```

First let's make an array from the object's `keys` or `properties` by passing `obj` as an argument to the `Object.keys()` method like this,

```js
// an object
const obj = {
  id: 1,
  name: "Leanne Graham",
  username: "Bret",
  email: "Sincere@april.biz",
  phone: "1-770-736-8031 x56442",
  website: "hildegard.org",
  company: {
    name: "Romaguera-Crona",
    catchPhrase: "Multi-layered client-server neural-net",
    bs: "harness real-time e-markets",
  },
};

// make the object's keys or properties
// into an array using Object.keys() method
const keysArr = Object.keys(obj);
```

Now, all we need is to do is to get the `length` property from the `keysArr` to get the total number of keys or properties present in the object.

It can be done like this,

```js
// an object
const obj = {
  id: 1,
  name: "Leanne Graham",
  username: "Bret",
  email: "Sincere@april.biz",
  phone: "1-770-736-8031 x56442",
  website: "hildegard.org",
  company: {
    name: "Romaguera-Crona",
    catchPhrase: "Multi-layered client-server neural-net",
    bs: "harness real-time e-markets",
  },
};

// make the object's keys or properties
// into an array using Object.keys() method
const keysArr = Object.keys(obj);

// get the total number of keys
// using the length property in the keysArr
console.log(keysArr.length); // 7
```

See this example live in [JSBin](https://jsbin.com/kubadavaho/3/edit?js,console).

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

---
Advent of Code 2020-05 with R
Tags: rstats, adventofcode
Published: 2020-12-15 20:35:39

---
title: Advent of Code 2020-05 with R
published: true
date: 2020-12-05 00:00:00 UTC
tags: rstats, adventofcode
canonical_url: https://colinfay.me/aoc-2020-05/
---

Solving Advent of Code 2020-05 with R.

[Disclaimer] Obviously, this post contains a big spoiler about Advent of Code.

## Instructions

Find the complete instructions at:[https://adventofcode.com/2020/day/5](https://adventofcode.com/2020/day/5).

## R solution

### Part one

```r
library(magrittr)
# Read the data
ipt <- read.table("2020-05-aoc.txt", header = FALSE, stringsAsFactors = FALSE)

library(magrittr)
# For chunk2
library(stackoverflow)
library(purrr, warn.conflicts = FALSE)
get_chunks <- function(vec, ext, nms){
  # split the vec in two, set the name, and extract the correct chunk
  chunk2(vec, 2) %>%
    setNames(nms) %>%
    pluck(ext)
}

# Prefilling the functions with the correct nms
get_bf<- partial(get_chunks, nms = c("F", "B"))
get_lr <- partial(get_chunks, nms = c("L", "R"))

get_all <- function(entry){
  entry <- strsplit(entry, "")[[1]] 
  
  # Doing the get_bf on the 7 first letters
  row <- get_bf(0:127, entry[1]) %>%
    get_bf(entry[2]) %>%
    get_bf(entry[3]) %>%
    get_bf(entry[4]) %>%
    get_bf(entry[5]) %>%
    get_bf(entry[6]) %>%
    get_bf(entry[7]) 
  
  # Doing the get_lr on the 3 last letters
  column <- get_lr(0:7, entry[8]) %>%
    get_lr(entry[9]) %>%
    get_lr(entry[10]) 
  
  # Computing the seat id
  seatid <- (row * 8) + column   
  
  return(seatid)
}

# Getting the max
map_dbl(ipt$V1, get_all) %>%
  max()

## [1] 864
```

### Part two

```r
library(dplyr, warn.conflicts = FALSE)
# Extracting all the ids
map_dbl(ipt$V1, get_all) %>%
  # Sorting them in order and turning into a df
  sort() %>%
  data.frame(
    x = . 
  ) %>%
  # Computing the diff between all ids
  mutate(
    y = lag(x), 
    diff = x - y
  ) %>%
  # My passport ID will be the one between the IDS 
  # of diff != 1
  filter(
    diff != 1
  ) 

##     x   y diff
## 1 740 738 2
```