teleren/devto huggingface dataset:
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2019-10-09 13:21:26

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

Replying to **[What is key to a great home office setup?](https://dev.to/ben/what-is-key-to-a-great-home-office-setup-g81)**, @artemis talks about the value in creating separate "spaces" between home and work:
{% devcomment g75c %}

@mohanarpit talks through their _very honest_ steps to debugging in the **[What is your debugging approach?](https://dev.to/ben/what-is-your-debugging-approach-2mde)** thread:
{% devcomment g9oh %}

@citizen428 shares a handy alias in response to **[How to keep your forked repository current](https://dev.to/ranewallin/how-to-keep-your-forked-repository-current-38mn)**:
{% devcomment g560 %}

Replying to a comment in their own **[Possibly the Most Useful CSS Trick](https://dev.to/xtrp/possibly-the-most-useful-css-trick-jl3)** thread, @xtrp shows a live example with a GIF to highlight the effect:
{% devcomment g4a0 %}

In the spirit of [#hacktoberfest](/t/hacktoberfest), @colbymelvin replied to a call for contributors, submitting their fix for an issue described in **[Call for DEV Contributors: Posts on front page do not load until scrolled down 🐛](https://dev.to/jess/call-for-dev-contributors-posts-on-front-page-do-not-load-until-scrolled-down-5e6a)**:
{% devcomment gabj %}

Be sure to check out the **[#hacktoberfest](/t/hacktoberfest)** tag for more great articles an discussions.

See you next week for more great comments ✌
Here's one way you can contribute to open source and help out DEV...
Tags: hacktoberfest, opensource
Published: 2019-10-09 13:17:45

Anybody looking to contribute to Hacktoberfest or generally contribute to some projects, I have an idea for you...

Find official websites for languages, frameworks, etc. and create a PR adding the appropriate DEV links to that site.

As you know, our site is growing in popularity and we'd love to see it reflected all over the web as an important resource for the various technology communities.

Last year I made this PR to add a `DEV Community` link to the footer of the ReactJS website and it's been there ever since...

{% github https://github.com/reactjs/reactjs.org/pull/1003 %}

If you explore the different "official sites" you'll see ample opportunities to include a link to the relevant DEV tag in the footer or a "community" section etc.

It's a great way to learn about the different static site generators used across the web.

Here's another example of a similar PR made by @kelset in React Native...

{% github https://github.com/facebook/react-native-website/pull/512 %}

And here is a PR I made to the VueJS website...

{% github https://github.com/vuejs/vuejs.org/pull/1980 %}

If it's appropriate to include the DEV logo and not just the text link, [you can find the logo here](https://dev.to/p/badges).

In general DEV should be referred to as `DEV` or `DEV Community`. `dev.to` is also sometimes the right phrasing casually or for clarity, but is not the "official name" that should be used in these links.

Feel free to leave a comment here if you have any questions about this at all. I'd love to clarify anything. Thanks a lot for the help!

Happy coding ❤️
Add watermark to the converted document in C# or Java
Tags: watermark, documentconversion, addwatermark, imagewatermark
Published: 2019-10-09 13:17:12

<!-- wp:paragraph -->
<p>Document conversion is one of the most frequent process that endures across a lot of industries. Sometimes, its the business need to put a watermark on the resultant document. For example, you want to convert a PPTX to PDF with a watermark text or image on all the PDF pages.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>GroupDocs.Conversion for .NET gives you such a option. It possesses a class <em>WatermarkOptions </em>with rich properties such as:<br> </p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Text/Font</li><li>Color</li><li>Width</li><li>Height</li><li>Background</li><li>Transparency </li><li>Rotation angle</li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
Lets have a look at its implementation in C#:
<!-- /wp:paragraph -->
{% gist https://gist.github.com/GroupDocsGists/329a1a434791a202bd325f5440dad206 %}
<!-- wp:paragraph -->
Document conversion in Java:
<!-- /wp:paragraph -->
{% gist https://gist.github.com/GroupDocsGists/ed031f8a9feec37aaddf5da82085555f %}
<!-- wp:paragraph -->
Below is the screenshot, you can see conversion of a PPTX to PDF along with watermark text.
<!-- /wp:paragraph -->
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/atn2ksqu0nokwf0ip2r2.jpg)
<!-- wp:paragraph -->
Go through the API [features](https://products.groupdocs.com/conversion). If there’s any issue, you can post on [forum](https://forum.groupdocs.com/c/conversion).
<!-- /wp:paragraph -->
Cascadia Code: a new font for Visual Studio Code and Terminal
Tags: vscode
Published: 2019-10-09 11:50:48

A few days ago, Microsoft released a new monospaced font.
It's perfect for Terminal and Visual Studio Code.
The font is open source and licensed under the SIL Open Font License on GitHub.
It means that is very easy to contribute for everyone.

## Installation
You can use this new font everywhere.
For example I use it in Terminal, Visual Studio Code and since a few days, in Visual Studio 2019.
You can install the latest version from the official releases page on GitHub: [https://github.com/microsoft/cascadia-code/releases](https://github.com/microsoft/cascadia-code/releases)

After the download, you can open the .ttf file and click on "Install".
If you have a previous version of the font, the new version overwrite the old one.
I recommend to uninstall the previous version before the new installation.

![](https://devblogs.microsoft.com/commandline/wp-content/uploads/sites/33/2019/09/programming-ligatures.gif)

## Setup Visual Studio Code
To setup Cascadia Code in Visual Studio Code, open the menu from File -> Preferences -> Text Editors -> Font and in the textbox write "Cascadia Code" before the other fonts.

![](https://github.com/microsoft/cascadia-code/raw/master/images/vscode-ligature-settings.png)

You have to enable the checkbox to enabling the Font Ligatures (see the picture above).

## Setup Terminal
From the down arrow on the top of the Terminal window, click on Settings and find your favorite profiles.
In the Font Face json property, write "Cascadia Code" and close Visual Studio.

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

If you want to know how to create and customize Terminal, check out my [post](https://dev.to/expertsinside/how-to-customize-the-new-windows-terminal-with-visual-studio-code-56b1).

## Setup Visual Studio 2019
As I mentioned before, you can use Cascadia Code in Visual Studio as well.
From the menu Tools -> Options -> Fonts and Colors, select the font from the properly dropdown.
Font Ligatures in Visual Studio are enabled by default.

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

## Conclusion
I used to setup all my IDE and editors with Fira Code, but now I switched everything to Cascadia Code.
If you want to contribute to the official repository, you can go [here](https://github.com/microsoft/cascadia-code) and fork the project.
If you are curious, you can read more on the offical release [post](https://devblogs.microsoft.com/commandline/cascadia-code/).
Hacktoberfest from a n00b maintainer perspective
Tags: hacktoberfest, contributorswanted
Published: 2019-10-09 11:43:18

I am the maintainer of two projects. 

A Jekyll plugin that enables internationalization called [jekyll-multiple-languages-plugin](https://rubygems.org/gems/jekyll-multiple-languages-plugin). I became a maintainer of it several months ago, because I started using it myself and saw it was not actively maintained despite being the most used i18n plugin for jekyll. Most of my activities involve responding to issues, encouraging pull requests and answering questions. I am still struggling with finding a road map. 

The other project is Tech Workers Coalition. I founded the Berlin Chapter, and wanted to learn more about the other chapters through their website, which I saw was hosted on Github. It's a decentralized movement, with many thoughtful and active folks. 

At first I was mostly creating pull requests, but I find I enjoy giving feedback and reviewing other people's work, because it gives me a sense that we are growing as a contributor community. It's not just code, but also text and descriptions. 

You can see some of the website projects and issues here: https://github.com/techworkersco/
Keep calm and Learn Javascript!
Tags: javascript
Published: 2019-10-09 11:16:25

There are many reasons to know javascript:
-Make a [discord bot](https://dev.to/thomasbnt/create-your-own-bot-discord-2hco)
-Make your [first executable](https://dev.to/jochemstoel/bundle-your-node-app-to-a-single-executable-for-windows-linux-and-osx-2c89)
~~-Look cool with your [matrix-like node.js script](https://dev.to/gnsp/making-the-matrix-effect-in-javascript-din)~~
-Create [beautiful animations](https://dev.to/inspiratory/creating-a-book-cover-using-javascript-and-p5js)
-Etc,etc,etc...

And there is also a secret reason: I hate people that show me their dumb errors (Unexpected token "}" at line 5 character 11) and then says: "I don't understand this error, fix this for me". It's okay for the first time, but not the second.

We're using node js, [see this for help](https://dev.to/bettercodingacademy/here-s-how-to-install-node-js-in-under-5-minutes-3igi)

I'm going to start with the beginning,
# 0. The setup

Firstly, create a file called "script.js" in a folder newly created (I guess). Of course, you can change "script" to anything you want

Then, run this command in the folder:
`npm init`
and answer.

Note: Every change is applied to script.js  

Done!

# 1. Script output

To output a string in a script, you can type: `console.log("String");`

Then run 
`node script.js` 
and you get your very first output!

# 2. Variables

I'm taking an example: hp in Minecraft
I get 20 hearts at the beginning
I'm falling from a mountain; I'm losing 4 hearts.
I'm drinking a healing potion; I'm getting 4 hearts more.
No! A skeleton! I lost 1 heart.

To initialize a variable, you can use **var** or **let**; I prefer **let**

Here's our code:
```js
let hp=20;
//Hey! I'm a comment! NodeJS doesn't care about me but the code reader does!
/*Also this is
a multiline
comment!*/
console.log("I have "+hp+" hp!");
//OOF
hp=hp-4;
//hp=20-4
console.log("I now have "+hp+" hp!");
hp+=4;
//This is included in the js syntax
console.log("I now have "+hp+" hp!");
hp--;
//This is also an integrated syntax
console.log("I now have "+hp+" hp!")
```

# 3. Functions

Do you remember our messy code?
Well, I'm gonna pimp that up!

```js
let hp=20;
function addRemoveHp(val){
  hp+=val;
  console.log("I now have "+hp+" hp!")
}
addRemoveHp(-4);
addRemoveHp(4);
addRemoveHp(1);
```
> Gosh, it's working! But  what the hell is "function addRemoveHp(val){[...]}"???

Welcome to the fabulous world of functions!

A function is formatted like this:
`function NAME(ARG1, ARG2, ARG3, [...], ARG_N){/*You get your code here*/}`

You can replace NAME, ARG1, ARG2, ARG3, ARG_N ant the multiline comment with whatever you want, like
`function sayHp(hp){console.log("You now have"+hp+"hp!");}`
or
`function addHp(){hp++;}`
or
`function removeHp(){hp--;}`

# 4. Conditions

It's coming...
💵 What are the perks that come with a pro subscription to dev.to?
Tags: discuss, hactoberfest, ruby
Published: 2019-10-09 11:10:24

---
title: 💵 What are the perks that come with a pro subscription to dev.to?
published: true
description: What are the benefits one would get if they had a pro membership on dev.to?
tags: discuss, hactoberfest, ruby
---

This [#hactoberfest](https://dev.to/t/hacktoberfest) got me real interested in deep diving into the source code of [dev.to](https://dev.to), which is slowly becoming my favorite open source project.

So this morning I stumbled across the [`pro_membership.rb` model](https://github.com/thepracticaldev/dev.to/blob/master/app/models/pro_membership.rb). This model is responsible for renewing, expiring and checking the status of a user's `pro membership`.

In all the time I have been a member of [dev.to](https://dev.to) I have not seen the pro membership being explicitly marketed. I haven't navigated the project enough to get a sense of the benefits that come with a pro membership.

So I am curious what the perks and benefits are of having a pro memership on [dev.to](https://dev.to)?

---
Cheers 🥂
[@kudapara](https://twitter.com/kudapara)
Building Decentralized Application using Blockchain in Ethereum
Tags: blockchain, webdev
Published: 2019-10-09 11:00:58

Blockchain was initially developed to introduce a peer-to-peer payment system. However, it has now broken the barriers and becoming popular in other sectors as well. The applications of Blockchain are widely being discussed in financial systems, educational areas, e-governance use cases, supply-chain systems, assets ownership management systems and many more. The decentralized and transparent mechanism of the technology has made it more popular in addressing the data tampering/manipulation and single point of failure issues.

The smart contracts that were first introduced by Ethereum have caught the attention in developing the decentralized applications. Smart contracts are the piece of programming code which are based on conditions and they trigger if certain condition is fulfilled. Since the smart contracts are automatically executed, the need for the intermediate third party has been eliminated.

Being a hot-field, I also wanted to become a part of this community and learn about developing decentralized apps. No doubt, the application areas of Blockchain-based DApps are tremendously wide and more & more Blockchain developers are required in this industry. While searching for useful resources for learning the Blockchain development, I came across the tutorials from [DApp University](http://www.dappuniversity.com/). These tutorials start teaching you from the basics of Blockchain and then move further to the development of the DApps using Ethereum. 

The following are some basic yet very helpful tutorials that I would recommend you to get start with if you are looking to become a Blockchain developer.

* http://www.dappuniversity.com/articles/blockchain-app-tutorial
* http://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial

I hope it helps.
About WebPerf Metrics; Chaos engineering traps; & Lambdas
Tags: todayilearned, java, devops, webperf
Published: 2019-10-09 11:00:19

*TL;DR style notes from articles I read today.*

### [Performance metrics for blazingly fast web apps](http://bit.ly/app-perf-metrics)

- Measure time starting at event.timeStamp.
- Measure time ending at `performance.now()` in a `requestAnimationFrame()`. `performance.now()` is precise to ±100 microseconds.
- Ensure your app is in the foreground because if your user switches to another browser tab, your metrics will break. Use `document.hidden` and `visibilitychange` event. While the tab is in the background, `document.hidden` is true. 
- Find the best event start time. For a current event, use `window.event.timeStamp` to record the time the system logged the event. 

*[Full post here](http://bit.ly/app-perf-metrics), 8 mins read*

---- 

### [Chaos engineering traps](http://bit.ly/chaos-eng-traps)

- Success can be measured by the number of vulnerabilities you find.
- Not all people who work on the service need to be involved in the experiment & in the preparation. 
- Chaos engineers should be rule enforcers.
- You should fix the vulnerabilities you find - and if you can, automate the fixes.
- The most important part is running the experiment.
- You can worry about safety later. 
- It is okay to be a little lenient about the definition of the ‘steady state’.
- There is a prescriptive formula for doing chaos engineering.

*[Full post here](http://bit.ly/chaos-eng-traps), 17 mins read* 

--- 

### [Lambdas are not functional programming](http://bit.ly/lambda-java)

Rather than spending time trying tricks with Lambdas, you should:

- Make good use of Generic Types. Declare type parameters & enforce them everywhere. Minimize casting and if instanceOfing.
- Make illegal states unrepresentable in code.
- Make your own data classes immutable and final where possible, use - proper immutable collections. 
- Use libraries that avoid runtime magic and reflection where pragmatically possible.

*[Full post here](http://bit.ly/lambda-java), 9 mins read*

---

*I share these TL;DR versions of articles on software engineering that I read every weekday through my newsletter - [in.snippets(). Sign up here](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is) if you liked what you just read.*
My SQL5.5: Reasons for being World’s Most Popular Opensource Database 
Tags: sql, database
Published: 2019-10-09 10:59:52

MySQL is a fast, easy to use a relational database. It is currently the most popular open-source database. It is commonly used in conjunction with PHP scripts to create powerful and dynamic server-side applications.

This language is sporting a barrier of entry low enough to attract novice developers yet strong enough to power some of the world’s most popular websites, among them Yahoo!, BBC News, the US Census Bureau, and Craigslist.

This reference is created to help you quickly navigate some of MySQL’s most popular features. Covering topics such as configuration, administration software, backup procedures, SQL features, and user management, this reference will serve as a handy desk for countless projects to come.

MySQL became so popular because of these following reasons:

1. MySQL is an open-source database so you don’t have to pay a single penny to 
   use it.
2. MySQL is a very powerful program so it can handle a large set of 
   functionalities of the most expensive and powerful database packages.
3. MySQL is customizable because it is an open-source database and the open- 
   source GPL license facilities, programmers, to modify the SQL software 
   according to their own specific environment.
4. MySQL is quicker than other databases so it can work well even with the large 
   data set.
5. MySQL supports many operating systems with many languages like PHP, PERL, C, 
   C++, JAVA, etc.
6. MySQL uses a standard form of the well-known SQL data language.
7. MySQL is very friendly with PHP, the most popular language for web 
   development.

To get more brief about ABOUT SQL- https://codersera.com/blog/mysql-5-5-worlds-most-popular-opensource-database/
#Hacktoberfest / Testing a Test-Setup for a temporal REST-API
Tags: hacktoberfest, contributorswanted, help, docker
Published: 2019-10-09 09:55:07

Hi all,

I'd need some testing if setting up a **non-blocking [SirixDB](https://sirix.io/) HTTP-Server** works.

Basically it needs a running **Keycloak** instance for authorization, which needs to be configured.

The description of setting up Keycloak and the SirixDB HTTP-Server can be found in the (as of now) rather small [REST-API](https://sirix.io/rest-api.html) documentation.

The most awesome thing would be to get the docker-compose file to work loading a JSON test realm configuration for Keycloak (which somehow doesn't work), such that setting up a basic test configuration is as easy as possible.

{% github https://github.com/sirixdb/sirix/issues/119 %}

Kind regards
Johannes
Removing ID and product Combinations from URL in PrestaShop
Tags: prestashop, productivity, php
Published: 2019-10-09 09:53:33

I have developed a PrestaShop plugin to remove ID and numbers, product combinations from URLs , please check demo here, 

https://addons.prestashop.com/en/url-redirects/31273-seo-friendly-urls.html

It is supported for latest PS versions.
Our favourite Spotify Playlist for Coding
Tags: watercooler, productivity
Published: 2019-10-09 08:57:33

Such a random post! But I just felt in the need of sharing my favorite playlists while coding/working. I am always looking for new playlists to boost my productivity and help me focus. 

I have recently started working in an open-plan office. This sounds nice, but the ugly truth is that I get constantly distracted by the noise and chatting. So I have bought a great pair of Bose Headphones with noise cancellation, which I found them to be a great invest (quite expensive, but worth it).

On the other hand, I also tend to get distracted by music in my own language (Spanish), and also by pop music. Probably because my brain forces me to sing along. 

So, these are my most played Spotify playlist for working:

[Tomorrowland Official Playlist](https://open.spotify.com/playlist/5ZgnTlYPLATJiTg9yTgppb?si=qnKgOsNNRcCS4bnfpL7IOQ)
[Inception OST](https://open.spotify.com/album/2qvA7HmSg1iM6XMiFF76dp?si=7BsVzaK0ROKkIrxNG5397w)
[Focus Coding](https://open.spotify.com/playlist/7w33zSxzXN5blasm8mk6cc?si=Oz6i3vqDRzOTdm_HmwbHqw)
[Pure Mellow Jazz](https://open.spotify.com/playlist/37i9dQZF1DWSBRKlyNxSuy?si=UFJ0SBzHRzuuYtm_bAVKtA)
[Orgánica] (https://open.spotify.com/playlist/37i9dQZF1DX2pprEpa9URZ?si=UUgpUxCQT3qQwibanN-eeQ)
[This is Hans Zimmer](https://open.spotify.com/playlist/37i9dQZF1DWWF3yivn1m3D?si=Ell5PbM-ROmZAIQatU2M2A)

What about you? Which are your favorite playlists?