teleren/devto huggingface dataset:
How To Become a Better Programmer And Unblock Your Inspiring Ideas
Tags: productivity, webdev
Published: 2019-06-06 09:19:08


A powerful insight of mine about hacking perfectionism, feeling better, more productive and unblocking myself to get things done.

> Idea ⇒ Inspiration ⇒ Perfectionism ⇒ Block

For example, you want to create a new web-service, you want to start a blog, youtube channel or write and article. It seems fun and exciting! But then «brain happens», nothing is done and you feel «blocked» or paralysed. Maybe this pattern happens too often and happens within years?

Why so?

Here is mine insight on why this is happening! At least in my case.

> Mood represents the momentum. The momentum allows actions to flow. Perfectionism tends to change that mood, kills the momentum and makes doing a struggle.

Let’s unwrap it.

_But before I would kindly suggest you to [check out](https://blog.swingpulse.com/) my blog. There's some nice stuff over there!_

# Mood As An Engine

Once I’ve read a powerful opinion about the science of mood. And an insight I’ve experienced was this:

> Mood represents the momentum. Momentum leads to actions.

Momentum is like a wave you can climb and ride. It’s just so easier when it’s fun and joyful. It’s a really nice friend to accompany your actions.

And it clicked for me.

> The mood is not only nice to have. The mood is _quite a requirement_.

You can definitely ignore it and fight through. But it’s totally different strategy.


# Perfectionism as a Mood Killer

My experience from a perspective of mood and momentum: perfectionism is their biggest nemesis!


> The most common end result of perfectionism is a struggle to act

# Recognizing The Tradeoff

It’s extremely hard for me to combine «perfect» and «fun». Fun vs perfect is a tradeoff I have to negotiate about with myself.

## Recipe for productivity

- Recognize the power of mood on actions
- Protect the mood

## Question yourself

- Should you do stuff if you feel like shit doing it? Is it a path of becoming a better human or beating yourself until you break? Maybe it’s both?
- How does execution of the idea influence your mood?
- It is possible to combine having fun and perfectionism?
- What kills your mood?
- What about bad mood and momentum?

> Let the mood be with you!

Please, consider [checking out my website](https://blog.swingpulse.com/) for more insights. You might find it valuable.
Proof Read Community
Tags: discuss, productivity, showdev, writing
Published: 2019-06-06 09:13:21

I often like to have my Posts proofread because I, like most people, make silly mistakes.

To this end - I've decided to create a "proofread" channel in the CodeTips slack group, where anybody can join and share their articles before hitting the "publish" button. 

If we can get enough people, hopefully, we can build a proofread community.

Join here if interested: https://join.slack.com/t/realcodetips/shared_invite/enQtNjQyNTg3MTM3MzAxLTc3ZmUzMDRmMzViNTUxZDdjOGVmMDM0YzVlYzI3ZGQ4NzM3ZWE2ZDk2NGU4ODBkMjIzZjdjOTUxZmU4Nzc3MjQ

And then join the proofread channel. 

I'm fully open to feedback and we can collectively structure how this works going forward.
So while learning javascript, I created superhero image filter using tags.
Tags: tutorial, javascript
Published: 2019-06-06 09:00:50

---
title: So while learning javascript, I created superhero image filter using tags.
published: true
description: Filter image gallery using tags 
tags: #tutorial, #js
---

This is the final product that we will create.
{% codepen https://codepen.io/Raisaugat/pen/eaowpd %}

At first the html structure will be like:
![](https://thepracticaldev.s3.amazonaws.com/i/d8jhnxkanjd39upd9m92.png)

The main trick here is to add these data- attributes. Here each img tag has a data-tags attribute with multiple value.

![](https://thepracticaldev.s3.amazonaws.com/i/qbtmym0jfu7k4ep694or.png)

This conclude our html part. Next move on to the javascript part.


##**The magic happens here**
The first thing is to make variables to hold the element.

![](https://thepracticaldev.s3.amazonaws.com/i/8ybm0t99bfv25paq13lk.png)

Then loop over each images to store corresponding tags and img element in tagged object variable that we have created above.

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

The if block checks for tags, loop through those tags and create an object with key of tag name and value of related img element.

![](https://thepracticaldev.s3.amazonaws.com/i/h2to8vwknxj2mp1mmovy.png)

Each img corresponds to img tag on html.

###Buttons

The next step is to create buttons. First we will create 'Show All' buttons

![](https://thepracticaldev.s3.amazonaws.com/i/ix4zhcl88pyn5yw25up7.png)

The main function of this button is to only show all the images, add active class to current one and remove active class in all other buttons. i.e siblings(). Lastly, the button is append to buttons variable that we created earlier.

*One button down more to go.*

This will be the last function needed to filter the image.

![](https://thepracticaldev.s3.amazonaws.com/i/dnl2rx1q52qne2pfn7iu.png)

This function will generate a button with number of related images it holds and filter images when clicked. It iterates through the tagged variable.  The tagName is the name of each tags. Thus, the button text will be the name of tag. 

![](https://thepracticaldev.s3.amazonaws.com/i/u7vff1un2f5pp509q4y7.png)

On click event first all the images will be hidden, then filtered using filter() function in jQuery which in our case accept the argument **tagged[tagName]** and finally show those images.
Each button is then append to buttons variable.

And finally the whole function is wrapped in Immediately Invoked Function Expressions (IIFE).

![](https://thepracticaldev.s3.amazonaws.com/i/d14null6j1mw8tctjuse.png)

The reason behind to build this was to know the mechanism of how this works. This is my first tutorial blog. Hope this helps.
Kudos :)
I need to learn Linux
Tags: help, linux, books, info
Published: 2019-06-06 07:44:02

---
title: I need to learn Linux
published: true
description: Help me
tags: help, linux, books, info
cover_image: https://thepracticaldev.s3.amazonaws.com/i/idr91agzdoya2dnb2hl0.png
---
Hello, I'm a junior web developer, I have seen that linux is very important, I know a little commands (mkdir, sudo, chmod...) but I don't know how it works or what types of permissions has this system (Linux) or the files system (etc, usr, bin...).
Can you recommend Books, courses or somethinig like that to be a hero in Linux.
Thanks.
Selecting subtitles in Vimeo using JavaScript
Tags: javascript, vimeo, subtitles, angular
Published: 2019-06-06 05:52:55

*Originally published at [https://samvloeberghs.be](https://samvloeberghs.be/posts/selecting-subtitles-in-vimeo-using-javascript) on March 1, 2018*

At [SponsorMatch](https://sponsormatch.eu/en) we deploy an Angular Universal website & application that is shown in different languages. Currently we support Dutch (nl) and English (en). On the homepage we use a simple introduction video / explainimation that is [hosted on Vimeo](https://vimeo.com/231377016) to show how the product works. This animation video is made in English but for the Dutch-speaking market we provided Dutch subtitles.

## Problem

It seems that it's not possible to set the default selected subtitle using the Vimeo iframe embed solution. It's probably possible but anyway, I couldn't find any information on Google or on the Vimeo documentation. There are even some questions on StackOverflow that remained unanswered for years:

- [Vimeo force CC language](https://stackoverflow.com/questions/27014658/vimeo-force-cc-language)
- [Vimeo Embed Language/Subtitles](https://stackoverflow.com/questions/27953778/vimeo-embed-language-subtitles)

## Solution

There are several solutions possible and one is moving completely to the JavaScript API Vimeo provides. More information can be found here: https://github.com/vimeo/player.js

The second solution I used was combining the iframe embed solution with the JS API. Basically we just use the iframe that was used for embedding as parameter in the Player constructor:

## Using it in Angular

Using it in Angular is fairly easy.. We need to install the @vimeo/player package using yarn or npm:

```sh
npm i -s @vimeo/player
```

Next we can import the Player directly and by using the `enableTextTrack` function we can easily set the language. As developers / implementors I believe we should be responsible in some way for knowing which languages are available to use. Meaning: which subtitles / texttracks are implemented on the embedded video.

```ts
import Player from '@vimeo/player';
const player = new Player(document.getElementById('intro_explanimation'));

player.enableTextTrack(this.language, 'subtitles').then(function (track) {
    // track contains language, kind and label
}).catch(function (error) {
    // error holds what happened in detail
});
```

Please take a look at the full example below. The end result is implemented on [the homepage of SponsorMatch](https://sponsormatch.eu/en).

angular-vimeo-set-language-subtitles


## Further reading

- [Vimeo - Developer API](https://developer.vimeo.com/)
- [Player.js - Interact with and control an embedded Vimeo Player](https://github.com/vimeo/player.js)

*Originally published at [https://samvloeberghs.be](https://samvloeberghs.be/posts/selecting-subtitles-in-vimeo-using-javascript) on March 1, 2018*
Can you manage a dev team and still be hands on?
Tags: discuss, webdev, career
Published: 2019-06-06 07:19:08

I've seen an increasing amount of roles lately along the lines of 'development manager' or 'CTO' which require leadership and management of a team _and_ heavy, hands-on technical work as part of the role.

Personally, having managed a team and run a company before, I don't believe that you can successfully be a part of the coding output _and_ successfully manage the rest of the development team.

But, it's important to step out of your box and get different perspectives and feedback. 

So, mighty Dev community, do you think it's possible to manage a development team or lead the product development roadmap _and_ be hands on with development tasks too?
Heap functions in ruby
Tags: question, ruby
Published: 2019-06-06 07:11:20

---
title: Heap functions in ruby
published: true
description: 
tags: question, ruby
---


Is there a heap queue implementation module in ruby that provides methods like `heapify_min` or `heapify_pop`? Something like this https://docs.python.org/2/library/heapq.html but ruby equivalent.
$1 Feedback
Tags: showdev, webdev, startup, sideprojects
Published: 2019-06-06 07:09:13

Hi!

I made a little side project where I earn some money and you get some feedback. You can get an email with private feedback and you can get a review video.

I'm trying to get other people on board too so we have more fresh eyeballs to look at projects and other people can do the videos :)

What do you think, would you give it a try?

P.S: Private Emails are much much harsher than the videos, there I tell you why I wouldn't use your product and all the things I find ugly.

Have a nice day


https://feedbacktoaster.com/
Web Developers and Designers, where do you get your raw materials from?
Tags: webdev, javascript, html, css
Published: 2019-06-06 07:00:20

Web Development is perhaps the fuzziest science of our times. It keeps evolving constantly and you must keep up with tons of things.

One of the most important things are resources, be it fonts, css and bootstrap themes, stock icons and background images or javascript frameworks. My question is what is the standard practice in this regard, where do you get these things from?
Make git forget a tracked file
Tags: programming, git, protip
Published: 2019-10-14 07:09:05

---
title: Make git forget a tracked file
published: true
tags: programming, git, pro-tip
canonical_url: https://varunbarad.com/programming/2019/06/06/make-git-forget-a-tracked-file.html
---

The default `.gitignore` file generated by Android Studio’s “New Project” wizard keeps some local IDE configuration files in VCS tracking. Nowadays I tweak the `.gitignore` file immediately after creating a new project, so as to avoid getting those files tracked.

But last week I opened one of my old projects and I hadn’t made those modifications to the `.gitignore` back then, so it was tracking those files. I wanted git to stop tracking those files but still wanted to keep them in my file-system.

So I went searching how to do it and found the below method.

1. Commit/Stash all your other changes
2. Add that file to your `.gitignore`
3. Commit the `.gitignore` changes
4. Execute the command `git rm --cached <file>` (For each file that you want to remove from tracking)
5. Commit the removal of those files from VCS.

**Word of caution:** This will keep the files in your directory but the next time these changes are pulled on some other machine, the removed files will be deleted from that machine. So it is advised to make a copy of those files first before pulling and then pasting your copied files back.

Source: [Stackoverflow](https://stackoverflow.com/a/1274447)

This was just a quick tip that I needed recently and thought of sharing. If you have any more such tips I would love to hear about them at this [twitter thread](https://twitter.com/varun_barad/status/1136608795973603332). Feel free to contact me for anything else that you would like to talk about [@varun\_barad](https://twitter.com/varun_barad).
Eclipse vs Netbeans vs VSCode - Which one do you use for coding?
Tags: java, javascript, productivity, discuss
Published: 2019-06-06 05:30:53

They are all great IDEs and Java coders are eccentric about their choices when it comes to IDEs. I haven't touched eclipse and netbeans since many years, have they gotten better or worse these days :smile:?

For full time, I use a very old and woebegone editor called Notepad++ for almost everything but mostly HTML/CSS/JS because that's what I do most of the time. People try to convince me on VSCode every now and then but I'm far too habitual to NPP, maybe I'll attempt to make that switch some day:wink:.

![NPP](https://thepracticaldev.s3.amazonaws.com/i/d67z23fmozdursiii17k.PNG)
Installing PostGis and QGis, first GeoDataBase and Simple Insert
Tags: postgis, vue, geospatial, qgis
Published: 2019-06-06 05:17:50

---
title: Installing PostGis and QGis, first GeoDataBase and Simple Insert
published: true
description: Simple DataBase with PostGis plugin 
tags: postgis, VUE, geospatial, Qgis
cover_image: https://thepracticaldev.s3.amazonaws.com/i/mkpsg80qqopjhbdf3jms.jpg
---

Hi!, I have a longer time without write a post ... ups xD.

Today I write a little post explain you: How I installed PostGis plugin, create geometry table, and insert data.

Fast Specs in my server: Centos 7 minimal install, Postgres 11.
Fast Specs in my Macbook: PgAdmin 4, QGis.

# Step 1: Install PostGis Plugin.

```
# yum install postgis2_11  
``` 

important!!! : the latest number its your Postgres Version in your server.

# Step 2: SQL time.

I use PgAdmin because my team its a non-programmer or technical users, maybe I write a post explain this.

#### 2.1 : Create Database

#### 2.2 : Run the script on "Enabling PostGIS" section:  https://postgis.net/install/

![](https://thepracticaldev.s3.amazonaws.com/i/qwhpcuxaln21kkhpw1ed.png)


#### 2.3 : Create a simple Geo Table on public schema:

```sql
CREATE TABLE TABLEOFPOINTS
(
    id serial,
    Place character varying COLLATE pg_catalog."default" NOT NULL,
    dir character varying COLLATE pg_catalog."default",
    geog geography(Point,4326) NOT NULL,
    CONSTRAINT TABLEOFPINTS_pkey PRIMARY KEY (id)
)
```


Okay, Now you have a simple points table; NOT POLYGONAL.


#### Step 3: Run QGis (I running on 3.4) and connect to PostGis

![](https://thepracticaldev.s3.amazonaws.com/i/p203j63bbl5j1bg9m9bd.png)

![](https://thepracticaldev.s3.amazonaws.com/i/5slfa21oage235rlmbhn.png)

#### Step 4: Install OpenLayers

4.1: Enable experimental and deprecated plugins

Plugins->Manage and install plugins->Settings

![](https://thepracticaldev.s3.amazonaws.com/i/oqx218mst03bydrdhm9t.png)

4.2 Search and Install OpenLayers

Plugins->Manage and install plugins->All
![](https://thepracticaldev.s3.amazonaws.com/i/tddalwyywjb3kjwqga0w.png)

4.3 Add OpenLayers plugin to project

Web->OpenLayers Plugin->OpenStreetMap->OpenStreetMap

![](https://thepracticaldev.s3.amazonaws.com/i/gfqmr6iq47t5u78dxoyr.png)


#### Step 5: Add your Point Layer (Postgres spacial table)


![](https://thepracticaldev.s3.amazonaws.com/i/5po8ujerd1dgtop78tmi.png)

#### Step 6: Make Points

![](https://thepracticaldev.s3.amazonaws.com/i/ob0af3nvjtpp6g549o39.png)

First make sure you have chosen the layer "TABLEOFPOINTS"

1- Click on Pencil icon (Toggle edit).
2- Click on "Add Point feature", and add your points.
3- Complete your data info and click on "Save Layer edit" icon


_Ok, if I'am a good teacher you can create spatial database of point, basic use of Qgis and connect at your first Geo Table; finally add points at your database._

_The next week, I need use the Geo table to show points using NodeJS and VUE. I hope, this post has been useful for you and also listen to any suggestions for use in node and vue_
Feature Request: Add the "Reading List" or "Bookmark" button on the posts page (card layout) itself
Tags: meta, discuss
Published: 2019-06-06 05:09:17

A couple days ago, I came across this post seeking readers' opinion on what features to add to [DEV.to](https://dev.to).

{%link https://dev.to/georgecoldham/what-would-you-like-to-see-implemented-on-dev-25b7 %}


When you visit the home page of [DEV.to](https://dev.to) and view the posts in card layout, there is only the heart shaped "like" button, there isn't a "add to reading list" button which many readers use to bookmark these posts in order to read them later. You get that button only when you open the post and view it in "full article" mode.

Such a feature would come quite handy I think, what do you suggest?
Do I need to indent my Python code? What about JavaScript?
Tags: quicktip, javascript, python
Published: 2019-06-06 12:53:14

---
title: Do I need to indent my Python code? What about JavaScript?
published: true
tags: quick-tip,js,python
canonical_url: https://flaviabastos.ca/2019/06/06/do-i-need-to-indent-my-python-code-what-about-javascript/
---

Yes! Indentation, or leading white space at the beginning of a line is required in Python. You can read more about [why that is important here](https://docs.python.org/3/reference/lexical_analysis.html#indentation). And here is the part of the [style guide convention for indentation (PEP 8)](https://www.python.org/dev/peps/pep-0008/#indentation).

In JavaScript on the other hand, [white space is added for readability only](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#White_space) but it should be consistent through all the code base.

> _The post [Do I need to indent my Python code? What about JavaScript?](https://wp.me/pa0b0y-43) was originally published at _[flaviabastos.ca](https://flaviabastos.ca/)
Having a good night's sleep is very important for programmers
Tags: productivity, discuss
Published: 2019-06-06 04:29:57

The biggest problem with programmers is that they become so involved in programming that sometimes they lose track of reality. I've seen coders forgetting as basic things in life as drinking a glass of water or having food when they are hungry.

Getting into the zone is a very good thing, even prioritizing it against other tasks is sometimes essential, I get it. But you need to realize that some things are essential for your long term health and well being and those can't be ignored even for programming.

There is also an increasing number of coders who stretch it into late nights. Nature has a certain pattern of sleep and wakefulness, if you disturb that pattern with irregularity, the consequences could be far worse for your long term health and well being. Take a pause and try to understand for a moment: what is your goal in life with coding? You code in order to finish your project, which in turn earns you money for enjoying happiness in life.

So, what benefit do you get by working through late hours on coding when that very happiness and well being is being sacrificed? Think and meditate on it.
The Magic Of A Single Integer Number To Contain Huge Information
Tags: integer, sql, database, cleaver
Published: 2019-06-06 03:27:59

---
title: The Magic Of A Single Integer Number To Contain Huge Information
published: True
description: A blog on storing huge information in a single integer values.
tags: integer,sql, database,cleaver 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/mcq226fa5powbsai5rd5.jpg
---

This blog is about how we can effectively store huge pieces of information by consuming less space. For this, here taking an example of “How to store all roles of a user in a single integer value. 
A programmer should write a module for handling Roles and Permissions for the users when developing an application software. Suppose we have the following roles.
![](https://thepracticaldev.s3.amazonaws.com/i/ujmm4p3110gkhq25egf8.PNG)

The programmer will usually assign an integer ID to each role like the following:

![](https://thepracticaldev.s3.amazonaws.com/i/9rdf7tuw3z1znbadraug.PNG)

Suppose the user with ID 1 has the roles of Data Entry and View Only.
In this case, the programmer can save user permissions in two different ways:
Create a string with roles separated by a comma, for example, 6,7 and this can be stored in the column. While retrieving back, we can split the string by comma and find the role IDs.
Each role IDs can be stored against user id by consuming each column for each role ID as follows:

![](https://thepracticaldev.s3.amazonaws.com/i/6u9uksluqsynxaglaj6q.PNG)

In this case, we need a separate table for storing information on user roles.
Would you like to know another better way to store any combination of user roles as a single integer value?
Read our latest blog by Sukesh Chand on storing huge information in a single integer values
https://urlzs.com/7QWkj