teleren/devto huggingface dataset:
Oh, the dilemma! Should you learn React or Angular or Vue or “Another framework”.js 
Tags: webdev, javascript, codenewbie, beginners
Published: 2019-12-08 06:29:59

---
title: Oh, the dilemma! Should you learn React or Angular or Vue or “Another framework”.js 
published: true
description: Lessons I’ve learned on my software journey: How to choose your first framework or library
tags: webdev, javascript, codenewbie, beginners
---

*What framework or library is best to learn first? Is it React.js or Angular or Vue.js or "who the hell knows”.js. or should you know all of them?* 

On your software journey, I am sure you will see this debate several times on the internet. If you are new to software development, this question can be very overwhelming. To make matters more complicated, there are many strongly opinionated developers who will quickly tell you why the framework you finally picked was wrong and not worth your time.  

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/f4dx1tgrs9d0pm44l7hd.jpg)

If you can identify with this dilemma, just close your eyes and take a deep breath. Just know that you are not the only Developer stuck in this quagmire. Heck, I was in your shoes a few months ago. I was constantly chasing the new and shiny thing, just to have it fizzle in popularity in a few months. Then I was back at square one. It was frustrating and I also discovered that it was the perfect formula to fail.

How did I turn things around? Well, in retrospect, it was obvious but it is hard to see when my mind was clouded.  I’ve discovered that there is more to my Developer life than always looking for the next BIG thing to learn. There will always be something new. The truth is that almost all of these new frameworks are built on the software fundamentals that have been around for over 30 years. If you take a deeper look at the [Gang of Four (GOF) book] (https://en.wikipedia.org/wiki/Design_Patterns) and other design patterns, you may notice that these are the foundation of most of these new fancy frameworks.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4x7k7dd29wfj6iu5hu2y.jpg)

**Let's sum it all up...**
Stop chasing those new items and just focus on the old, dusty, tried and true software development fundamentals. **Make sure that you understand vanilla JavaScript**, this will be the core language of most of these frameworks. Then, pick a framework to play around (React, Angular, Vue or something else), and see if you can identify the fundamental **patterns**. There is always going to be a new kid on the block so focus on the core ideas. Oh, and remember to have **FUN.**

*Kenny out!*
Postgres RLS and policies: best practices?
Tags: help, postgres
Published: 2019-12-08 05:46:10

I am currently exploring Postgres's Row Level Security and related policies for my project, and have a question about best practices:

If I have these tables:

|box|
|---|
|id|
|name|
|user_id|

|thing|
|---|
|id|
|big_box_id|
|name|

I have a `select` policy which checks the user_id agains JWT claims. This let's me only select my own boxes.

Question: What's the best way to prevent users to select `things` which do not belong to them?

As I see it, there are two options:


**Option 1:** add a `user_id` column to `thing` and have each item also store its `user_id` to be used on policies (same as in `box`)

**Option 2:** on the select policy for `thing`, add a check on the `user_id` of the parent box

My intuition says option 2 is cleaner, but I wonder how would that go when things get deeper, let's say my things can also have children, then I have to travel back several levels to the parent box within my select policy?

Any insights are extremely appreciated!!
Help! with puppeteer chromium(cdc_)
Tags: puppeteer, javascript, automation, scraping
Published: 2019-12-08 05:06:38

Hi I wanted to know how to change the cdc variable located in the call_function.js file. If anyone knows the location of that file or where does node put the chromium file it downloads while installing ? I want to make sure that the scraper goes undetected and even when chromium runs it displays a message `Chromium is controlled by an automated software.`
Improve Productivity as a Developer
Tags: productivity, developers
Published: 2019-12-08 05:04:20

Every developer would like to improve thier productivity. [Improving Prodictivity](https://groups.hyvor.com/Productivity/165/13-best-tips-to-improve-productivity) is very important not only for developers but also for anyone:students,employees,employers. When following productivity tips, developers find most of those of tips are not practically successful.This article presents _the best tips for improving productivity: for developers._
This article is for developers who have failed and currently working quite good.

###**Analyze Previous Work Schedule**###
Developers who are low in their productivity, must look back how they did earlier. Tracking and analyzing own work help to have a clear idea of the reasons caused less productivity. This is a very good tip for developers. Use any method to track and analyze.  Create a record including time spent working per day, time spent for breaks etc. This will make easier to decide next steps of improving productivity.

###**Create a TO-Do LIST**###
This helps to get rid of messing up. Use preferred ways to create lists of own:Meister task, sticky notes etc. Break down a big goal into smaller parts using To-Do list. It is a big help to improve productivity.
 
###**Avoid Getting Distracted**###
Distraction kills productivity. Use methods to keep concentrated such as Baroque Music, nice illustrations, Meditation. This is the heart of improving productivity. 

###**Use Time Managing Methods**###
Time Managing methods help to get rid of time waste. A developer must be able to manage own time. It leads to improve productivity. here are some time managing methods can be used: [POMODORO](https://m.wikihow.com/Be-More-Productive-with-the-Pomodoro-Technique),[2-Minute Rule](https://medium.com/the-mission/how-to-stop-procrastinating-by-using-the-2-minute-rule-310fa8495fb9).It is also important to set a specific time period for a certain task.

###**Gain Information Day By Day**###
As a developer reading and gaining new information help to improve productivity than any other tip. Knowledge gives you the best. This helps to enhance skills as well.

Have any questions and suggestions? Do not forget to comment below.
Voice conference and Video Room in Twilio API
Tags: php, twilio, voice, videoroom
Published: 2019-12-08 04:33:37

I'd like to build video conference platform using Twilio api in PHP for the  backend.
And I want to know how to create voice conference and video room in twilio using PHP.
There are PHP code for this  in twilio doc.

```
$response = new TwiML;

// Start with a <Dial> verb
$dial = $response->dial();

dial->conference('My conference', array(
                'startConferenceOnEnter' => True,
                'endConferenceOnExit' => True
                ));
```
I have some questions
 - Do I need to return $reponse to the client side?
 - How can I connect this voice conference?

Please help me with this
Thanks
Getting Sorted Part 2: Python
Published: 2019-12-08 04:28:47

---
title: Getting Sorted Part 2: Python
published: true
description: 
tags: 
---
Last time we talked about sorting in Java, which can be very powerful in it’s own way, but it revolves around the type of data structures native to Java. Python has additional types of structures that can complicate how a collection is structured, so it can be very useful to know how to navigate these structures in a simple manner. Python is commonly used for manipulating large datasets in various formats, which makes it very important to be able to find things when you need them.

If we look at a List in Python, it usually appears very similar to a List in Java, and has similar ways of sorting. First let’s define some lists:

```python
colors = [‘red’,’blue’,’green’,’Yellow’]
numbers = [10,5,35]

``` 

Now it’s important to understand the difference between a method that sorts in-place and one that produces sorted output. An in-place sort takes the original collection and re-arranges it so that the original collection is in sorted order. A method that outputs a sorted list creates a new list in sorted order, while the original list remains unchanged. In Python the basic version of this is `.sort()` and `sorted`:

```python
sorted_numbers = sorted(numbers)

#numbers: [10,5,35]
#sorted_numbers: [5,10,35]

numbers.sort()
#numbers: [5,10,35]
```

An important thing to note about `sorted` is that although it can accept collections similar to a List as input, it will only return the sorted output as a List. A list of strings can be sorted alphabetically by default as well, although it pays attention to case, and places words starting with uppercase letters before lowercase words:

```python
colors.sort()
#colors: [‘Yellow’,’blue’,’green’,’red’]
```

Now that we’ve covered the basic sorting function, let’s get a little more advanced. When we sorted our numbers array it defaulted to sorting in ascending order. That is, it starts with the lowest number in the first position. But by using the ‘reverse’ parameter we can force it to sort in reverse order:

```python
sorted(numbers, reverse = True)  # = [35,10,5]
```   

Python has very flexible data structures, but that also brings with it the possibility for complications. A Python List can hold multiple data types at a time, like having an integer and a string, or integers and a tuple. The problem with storing dissimilar data types in the same list is that they have no common point of reference for sorting, and an attempt to sort such a list will produce an error.

So far we’ve mostly been talking about sorting Lists, but there are special ways to sort more complex collections as well, like a List of Tuples or a Dictionary. Next time we will discuss how to accomplish this using key and lambda functions.
My 2019 in DEV - Check your stats! 
Tags: javascript, svelte, showdev, myyearindev
Published: 2019-12-08 04:27:58

---
title: My 2019 in DEV - Check your stats! 
published: true
description: A fun little tool to check out your DEV stats for 2019!
tags: javascript, svelte, showdev, myyearindev
cover_image: https://i.imgur.com/yYhcd65.png
canonical_url: https://maurogarcia.dev/maurogarcia.dev/posts/my-2019-in-dev-check-your-stats/
---

So today @paulasantamaria and I spent the whole afternoon creating a web tool to allow everyone on DEV to see their blog stats of 2019!

Here's how my year in DEV.to looks like:

![A screenshot of the site with my blog's stats: I wrote 12 articles, received a total of 78 comments and 719 reactions. My top article was "4 Reasons why being humble will help you become a better developer"](https://i.imgur.com/XFc5x6i.png)

# Curious about your stats? Try it out yourself!
👉 [My year in DEV](https://year-in-dev.cephhi.com)

## Check out the GitHub repo:

{% github github.com/uppernauts/year-in-dev no-readme %} 

btw, We use my [Sapper + Svelte + tailwindcss boilerplate](https://dev.to/maurogarcia_19/server-side-rending-with-sapper-svelte-and-tailwindcss-2bib) as a kickstarter for this project.

Let me know what you think in the comments below!

## Also, use the #MYYEARINDEV on twitter to share your stats
Your year in DEV - Check your stats!
Tags: showdev, javascript, svelte, myyearindev
Published: 2019-12-08 04:18:59

---
title: Your year in DEV - Check your stats!
published: true
description: A fun little tool to check out your DEV stats for 2019!
tags: showdev, javascript, svelte, MyYearInDev
cover_image: https://i.imgur.com/FzfT1iU.png
---

So today @maurogarcia_19 and I spent the whole afternoon creating a web tool to allow everyone on DEV to see their blog stats of 2019!

Here's how my year in DEV.to looks like:

![A screenshot of the site with my blog's stats: I wrote 16 articles, received a total of 307 comments and 2871 reactions. My top article was "6 ways minimalism can help you write clean code"](https://i.imgur.com/BcKVIu3.png)

# Curious about your stats? Try it out yourself!
👉 [My year in DEV](https://year-in-dev.cephhi.com)

## Check out the GitHub repo:

{% github github.com/uppernauts/year-in-dev no-readme %} 

This project was a fun excuse for me to learn about Svelte and Sapper. 

Let me know what you think!

Also, I thought it'd be cool if we could use #MyYearInDev to share our stats on this platform or twitter, in case you want to participate!

{% twitter 1188974799604895745 %}
Is there a way to programmatically get Twitter user name if I know website URL of the user?
Tags: help
Published: 2019-12-08 04:13:04

I have a bunch of website URLs. Most business accounts mention their websites in their Twitter bio. I would like to get Twitter usernames/handles of those websites

e.g. user https://twitter.com/adityarao310 mentions https://timewise.how/ in their Twitter bio. I know Timewise.how --> can I get @adityarao310? I have 300 such website URLs

* I have tried going through the Twitter standard search but it doesnt work for searching through bio

* I also thought about doing wget and then grep to get twitter.com/xxxx in the website pages because I am assuming that most website mention their social links at the footers usually. But I am unable to figure the right regex for this

Can someone please point me in the right direction?
Trouble with Git Commits on Github? Me too.
Tags: github
Published: 2019-12-08 04:04:32

Lately, I've been having some issues getting all my commits to show on my GitHub profile. I've worked on several projects over the past couple of weeks but for some reason, my profile looks like I haven't really done anything. Here's my chart:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6gvobin7ymyzp0rcv730.png)


From mid-September on, you can see that it's pretty light on the green squares. There are at least 50 commits missing but I'm not sure why that is.

I've tried checking:

- that my terminal is connected to the right GitHub account
- my GitHub contribution settings
- that the commits are showing up in my repos (they are)


I don't have GitHub Desktop so it's not an issue with that. Recently, I used the internet at a radio station and ran into some issues pushing to my repo because of the radio station's internet security. Could that be a factor?

Do any of you have any ideas as to what might be causing this?

Here are the places I've looked for already but haven't found anything that has helped me (but it might help you, depending on your issue):

- [Why aren’t my commits showing up on my GitHub contributions graph?](http://www.bradymower.com/why-arent-my-commits-showing-up-on-my-github-contributions-graph/)

- [Why are my contributions not showing up on my profile?](https://help.github.com/en/github/setting-up-and-managing-your-github-profile/why-are-my-contributions-not-showing-up-on-my-profile)
React MapQuest Static Maps
Tags: showdev, react, javascript
Published: 2019-12-08 03:59:18

MapQuest has an API of sorts for generating and customizing static map images, which I was using in a site I was working on recently. I abstracted it into a React component and thought others might find it useful.

Examples here: [https://joeattardi.github.io/react-mapquest-static-map/examples/MapWithCenter](https://joeattardi.github.io/react-mapquest-static-map/examples/MapWithCenter)

Code here: [https://github.com/joeattardi/react-mapquest-static-map](https://github.com/joeattardi/react-mapquest-static-map)
Attend a FREE Frontend Coding Conference!
Tags: webdev, beginners, javascript, serverless
Published: 2019-12-08 02:53:24

I recently heard about a free online conference for web developers called backendlessconf_. It's hosted by ZEIT (zeit.co) and their CEO Guillermo Rauch will be speaking at it along with many others. I heard a great talk from Guillermo Rauch a few weeks ago at the GitHub Universe conference in San Francisco, so I'm looking forward to attending a conference that he has helped put together.

The conference is happening next Saturday December 14th (2019). You can register for it (for FREE!) here: https://backendlessconf.com/.

This will be my first online conference so I'm not sure how it will compare to an in-person conference. If you've attended an online conference before I'd love to know what you thought of it (and what conference it was). Feel free to leave a comment with your experiences!
Declaración, asignación y obtención de variables en diferentes lenguajes
Tags: javascript
Published: 2019-12-08 01:46:03

La declaración de las variables no cambia más que en la sintaxis.
La lógica es la misma en los `tres` pasos.

---

### En Pseint

`Definir` numerito `Como Entero`;	*//Declarando una variable*

numerito `=` 5;	*//Asignando una valor a l variable*

`Escribir` numerito;	*//Obteniendo el resultado*

---

### JavaScript

```javascript
let numerito;		//Declarando una variable
numerito = 5;		//Asignando una valor a la variable
console.log(numerito);	//Obteniendo el resultado
```

```javascript
let nombre;		//Declarando una variable
nombre = "David";		//Asignando una valor a la variable
console.log(nombre);	//Obteniendo el resultado
```

---

### En Java

##### Con entero
```java
int numerito;	//Declarando una variable
numerito = 5;	//Asignando una valor a la variable
Systen.out.println(numerito);//Obteniendo el resultado
```

##### Con String
```java
int nombre	//Declarando una variable
nombre = "David";	//Asignando una valor a la variable
Systen.out.println(nombre);	//Obteniendo el resultado
```

---
### En Go
###### En Go no es necesario en ; al final

```javascript
//Declarando una variable
var numerito int
var nombre string 
//Asignando una valor a la variable
numerito 5
nombre = David
//Obteniendo el resultado
fmt.Println(numerito)
fmt.Println(nombre)
```
Bloques, elementos y modificadores - BEM
Tags: html, css, bem
Published: 2019-12-08 01:28:36

No le sorprenderá saber que BEM es una abreviatura de los elementos clave de la metodología: Bloque, Elemento y Modificador. Las estrictas reglas de denominación de BEM se pueden encontrar aquí.

## Bloque / Block
Entidad independiente que es significativa por sí sola.
**Ejemplos:**

`header` `container` `menu` `checkbok` `input`

---

## Elemento / Element
Una parte de un bloque que no tiene un significado independiente y está semánticamente vinculado a su bloque.
**Ejemplos:**

`menu item` `list item` `checkbok caption` `header title`

---

## Modificador / Modifier
Una bandera en un bloque o elemento. Úsalos para cambiar la apariencia o el comportamiento.
**Ejemplos:**

`disabled` `highlighted` `checked` `fixe` `size` `big` `color yellow`

```html

<button class="button">
	Normal button
</button>
<button class="button button--state-success">
	Success button
</button>
<button class="button button--state-danger">
	Danger button
</button>

```

```css

.button {
    border: none;
    padding: 15px 35px;
    margin: 16px;
    border-radius: 5px;
    color: #fff;
    background-color: #008b8b;
    font-size: 1rem;
}

.button--state-success {
    background-color: #8439da;
}

.button--state-danger {
    background-color: #8439da;
}

.button--state-danger:hover {
    background-color: #745c97;
}
```

:pencil: [Metodologías BEM/codepen](https://codepen.io/codegenial/pen/mddXPvw?editors=0100)
Why I'd like to start a podcast
Tags: podcast
Published: 2019-12-17 10:49:41

---
title: Why I'd like to start a podcast
published: true
date: 2019-12-08 00:00:00 UTC
tags: podcast, 
canonical_url: https://aravindballa.com/writings/starting-podcast/
---

This isn’t a motivational post. This is a short _why_ post. It’s about the reason why I’d like to start a podcast. Hopefully this will help me stick around.

## I should not do it because

I know I don’t have thousands of followers on Twitter. And things I say wont probably be heard by a lot of people. I am also not a pro at what I do and I am still getting there. I am not an influencer.

## Instead, I am doing it because

I want to improve. I know I am not good at talking or presenting or articulating a thought. Yes, I stammered a bit in the first episode. But, this will be a way for me to improve at all those things, publicly. Trust me, I’ll get better. `#GrowInPublic`

Not being know by a lot of people puts me in a great position, where I can experiment lot of things and I don’t have to feel bad if it fails.

[Brittik](https://twitter.com/brittikbasu) is a kind person who you will want to be around. I share a same vibe from the day I met him. We talk about a lot of things and learned a lot from each other. Sometimes, we keep taking about a topic and at the end, we think the conversation should have been recorded. This time, we are consciously recording it.

I like to share things that I learn and that has been the motivation to write this blog, make (very few) videos and give talks. This podcast is another outlet.

Brittik and I actually started it. By the time of writing, first episode is already recorded and is set to be published the next day. We built up the landing page and setup things for the podcast distribution. Also, this is the first thing Brittik and I are launching together. (We will talk about things that failed too.)

I’d want you to listen to the podcast - [learningcurve.dev](http://learningcurve.dev) and give me feedback. A DM on [Twitter](https://twitter.com/aravindballa) would help.

Thanks a ton for reading this 🎉

Good day!
Advent of Code 2019-08 with R & JavaScript
Tags: rstats, adventofcode, javascript
Published: 2019-12-09 19:41:19

---
title: Advent of Code 2019-08 with R & JavaScript
published: true
date: 2019-12-08 00:00:00 UTC
tags: rstats, adventofcode, javascript
canonical_url: https://colinfay.me/aoc-2019-08/
---

Solving Advent of Code 2019-08 with R and JavaScript.

[Disclaimer] Obviously, this post contains a big spoiler about Advent of Code, as it gives solutions for solving day 8.

## Instructions

Find the instructions at: [https://adventofcode.com/2019/day/8](https://adventofcode.com/2019/day/8)

## R solution

### Part one

```r
library(magrittr)
library(purrr)

ipt <- read.delim("input8.txt", header = FALSE, colClasses = "character")$V1
ipt <- strsplit(ipt, "")[[1]] %>% as.numeric()

layers_size <- 6 * 25
l <- list()

for (i in 1: (length(ipt)/layers_size)){
  l[[i]] <- ipt[1:150]
  ipt <- ipt[151:length(ipt)]
}

mn <- l %>% 
  lapply(table) %>% 
  map_dbl("0") %>% 
  which.min()

l[[mn]] %>% 
  table()

## .
## 0 1 2 
## 7 14 129

14 * 129

## [1] 1806
```

### Part two

``` r
v <- c()
for (i in seq_len(layers_size)){
  idx <- map_dbl(l, i) 
  v[i] <- idx[idx %in% c(0,1)][1]
}

library(dplyr)
library(tidyr)
library(ggplot2)
library(tibble)
matrix(v, ncol = 6) %>% 
  as.data.frame() %>%
  rowid_to_column() %>%
  gather(key = key, value = value, V1:V6) %>%
  mutate(key = gsub("V(.)", "\\1", key) %>% as.numeric()) %>%
  ggplot(aes(rowid, key, fill = as.factor(value))) + 
  geom_tile() + 
  coord_fixed() + 
  scale_fill_viridis_d() + 
  scale_y_reverse()
```

![](https://colinfay.me/assets/img/unnamed-chunk-2-1.png)

## JS solution

``` javascript
var ipt = fs.readFileSync("input8.txt", 'utf8').split("").filter(x => x.length != 0 & x != '\n').map(x => parseInt(x));

var layers_size = 6 * 25;
var layer_n = ipt.length / layers_size;
var res = [];

function table(vec){
  var tbl = {};
  vec.map(function(x){
    if (tbl[x]){
      tbl[x] = tbl[x] + 1;
    } else {
      tbl[x] = 1;
    }
  })
  return tbl;
}

for (var i = 0; i < layer_n; i ++){
  res[i] = ipt.splice(0, layers_size);
}

var res_b = res.map(x => table(x));
var minim = Math.min.apply(Math, res_b.map(x => x['0']));
var smallest = res_b.filter(x => x['0'] == minim);

smallest[0]["1"] * smallest[0]["2"];

## 1806

var v = [];

for (var i = 0; i < layers_size; i ++){
  var idx = res.map(x => x[i]);
  v[i] = idx.find(z => z== 0 | z == 1);
}

var nn = [];

for (var i = 0; i < 6; i ++){
  nn[i] = v.splice(0, 25).join(" ").replace(/0/g, " ");
}

nn

## [ '    1 1     1 1     1 1 1 1   1 1 1       1 1    ',
##   '      1   1     1   1         1     1   1     1  ',
##   '      1   1     1   1 1 1     1     1   1     1  ',
##   '      1   1 1 1 1   1         1 1 1     1 1 1 1  ',
##   '1     1   1     1   1         1   1     1     1  ',
##   '  1 1     1     1   1         1     1   1     1  ' ]
```