teleren/devto huggingface dataset:
Cups Web Interface in Ubuntu
Tags: printing, ubuntu, cups
Published: 2019-10-16 20:53:42

Recently, after reinstalling [POP_OS](https://system76.com/pop) on my System 76 [laptop](https://system76.com/laptops) I was having problems connecting to my HP LaserJet MFP M227fdw. POP_OS is a Ubuntu derivative especially designed for System 76 hardware and my setup is based on [Ubuntu 19.04](https://ubuntu.com/).  
The Gnome Print manager was not finding the printer and when I tried to install the network print, which it would, my username and password would not authenticate. Simply put, this is a security feature, but on a home based single user system I needed to safely bypass. 

The procedure is pretty simple. First, I needed to add myself to the lpadmin group (you will probably need to enter your sudo *password*):
```
sudo usermod -aG lpadmin <username>
```
Last thing is to restart CUPs. This can be done by typing:
```
sudo /etc/init.d/cups restart
```
Then go to the CUPS web interface at `http://localhost:631/` and freely add your printer. It worked for me flawlessly and I hope it helps you as well.
How are you handling User Authentication?
Tags: discuss, webdev, javascript, node
Published: 2019-10-16 20:28:37

Here are some of the options that I know if to handle user authentication for apps:

- hand rolled user authentication system
- hand-rolled using a plugin (e.g. passport.js)
- using an outside service (e.g. Auth0 or AWS Cognito)

I currently use passport.js, but I don't like it, and adding in social logins is complicated and annoying.

I'm currently shopping for a better solve for this problem. 

Thoughts?
IntelliJ google-java-format plugin vs IntelliJ java-google-style.xml - what's the deal?
Tags: java, codequality, intellij
Published: 2019-10-16 20:20:51

---
title: IntelliJ google-java-format plugin vs IntelliJ java-google-style.xml - what's the deal?
published: true
description: Why are do google-java-format plugin and the java-google-style.xml cause different results?
tags: java, help, codequality, intellij
---

Code Style. One of those controversial topics, where everyone seems to have an opinion and no one seems to has the silver bullet. 

Recently, I was caught up in a discussion on how to format chained methods or in that case Java `stream()`. 


Here are the two examples from this discussion:

Option A:
```
obj.stream()
    .map(...)
    .distinct(...)
    .collect(...);

```

Option B:

```
obj.stream().map(...).distinct(...).collect(...);
```

Personally, I feel like option A is nice to read, but not everyone feels the same way. This is perfectly fine, but it would be nice to have a set of rules and restrictions, which will settle this debate once and for all. 

Luckily, we have decided to on a Style Guide, the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). 
Having a style guide is a nice thing, but just referencing to the style guide if not really enforcing the rules. Furthermore, to make life easy, it is always nice to have some tolling, which will allow to combine the chosen style with IDE features, like auto-format.

For IntelliJ, I see here two options. It's either installing the [google-java-format](https://github.com/google/google-java-format) plugin or importing the [java-google-style.xml](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml).

One could think that both options are resulting in the same format, but unfortunately this doesn't seem to be the case. 

As an example, the plugin would format streams like in the above shown option A, but the imported XML would go with option B. 

Furthermore, if you're using Spring, the XML would result in this format for annotations: 

```
@Autowired
private Entity entity; 
```

Whilst the plugin would format it as following: 

```
@Autowired private Entity entity;
```

These are just a couple of examples, but there are plenty of other differences. It surprises me as both, the XML and the plugin, are maintained by Google (or at least under their GitHub organisation).

So, this leaves a few open questions:
- Is this supposed to be like that?
- Could it be an issue with IntelliJ or the XML that the formatting is so different between the two options?
- Which one is right or closer to the actual Google Style guide?
- Is there a different tool, which is reliable for a reliable code formatting for Java? 

Personally, I kind of feel that closer to the plugin. This is mostly because it seems to be much tighter and almost leaves no free for different styles. But is it too tight? 

![](https://media.giphy.com/media/130d6vlmqNcqxG/giphy.gif)
Made Portfolio website with React and GitHub pages
Tags: react, github, css, beginners
Published: 2019-10-16 20:15:44

Hello guys, just made my portfolio website with a custom design in react. Very much excited to make it live with 'gh-pages'. After some minimal efforts, I am successfully able to make it. You can also look for my portfolio on [Portfolio](https://vinodchauhan7.github.io/myResume/) on given link.

Happy Coding!!
Hacktoberfest: Let's build a VS Code Extension
Tags: hacktoberfest, opensource, vscode, typescript
Published: 2019-10-16 20:14:37

Hi everyone! 👋

A few weeks ago, I started building a VS Code extension called [LightSwitch](https://github.com/timrodz/vscode-light_switch). It allows you to set-up two themes that swap around day & night. All you have to do is choose your themes and set your preferred times to switch them.

{% github https://github.com/timrodz/vscode-light_switch no-readme %}

> Update: thanks for all the support! I appreciate you all. ❤️

Any stars are more than welcome ⭐

Since we're in Hacktoberfest, building a tool together would be a great way to celebrate it (along with open source software)!

## Why? 🤔

Not so long ago, I started wearing prescription glasses, and thus I have been swapping between light/dark themes according to where/when I'm working.

_"Why not make a tool to automate this?!"_

This was the perfect reason to work on a small project that would teach me the API, workflows of VS Code, along with Typescript.

I must admit, creating an MVP was incredibly easy, and I encourage all fellow devs to [tinker with their own extensions](https://code.visualstudio.com/api/get-started/your-first-extension) — It's also a great way to get started with Typescript!

## The extension 🚀

A basic implementation of LightSwitch is working, with the following features:

- Set themes to night and day
- Switch between night/day themes
- Switch themes according to a specific time

By collaborating in this project you will:

- Use Typescript to implement features, tests and fix bugs. Don't know the language? No worries! You can [learn Typescript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html).
- Be exposed to API methods that will help you understand how extensions work. Discover the [VS Code API](https://code.visualstudio.com/api/references/vscode-api).
- Achieve your Hacktoberfest PRs (In case you need them).
- Work on a small Open Source project!

I' open to discussions of any kind. Any contribution is more than valid ❤

## I'm in! Show me the issues 🛠

Woop Woop! The complete list of issues can be found [here](https://github.com/timrodz/vscode-light_switch/issues).

{% github https://github.com/timrodz/vscode-light_switch/issues/12 %}
{% github https://github.com/timrodz/vscode-light_switch/issues/4 %}
{% github https://github.com/timrodz/vscode-light_switch/issues/5 %}
{% github https://github.com/timrodz/vscode-light_switch/issues/6 %}

_Photo by [Hans-Peter Gauster](https://unsplash.com/@sloppyperfectionist?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)._
Bypass your global npm registry for individual repo 
Tags: node, npm, javascript, package
Published: 2019-10-16 20:01:22

If you use Private npm registry and that npm registry is added to your global `.npmrc` file, then you probably faced this issue.

So, on the global `.npmrc` file, there is one entry like

```
registry=https://myprivatenpmregistry/npm/
```

Let's say, you wanted to add `emotion` to the project.

<b>`yarn add emotion`</b>

Then you probably see the error-

<b>An unexpected error occurred: "https://myprivatenpmregistry/npm/emotion: connect ECONNREFUSED IP:PORT”.</b>

We can fix this issue easily by adding `.npmrc` file inside the root directly of the project. Then It will not use the global npm registry and will use the project level `.npmrc` file. 

Inside the `.npmrc` file we will add -
```
registry=https://registry.npmjs.org/
```
:fire:
That's the small trick we can do to make it work.

If I have multiple projects with different npm registry then we can add that particular registry to the project level .npmrc and voila :tada:

Cheers!
:wave:

As I am trying to contribute contents on the Web, you can buy me a coffee for my hours spent on all of these ❤️😊🌸
<a href="https://www.buymeacoffee.com/destromas" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>

My Blog: https://shahjada.me
Python Tooling Review: pyproject.toml and flake8
Tags: python, tooling, packaging
Published: 2019-10-16 19:44:52

I recently had an opportunity to review some tooling for Python, and I thought I'd share some of my learnings.

# pyproject.toml
This fancy new file is the replacement for `setup.py` and `setup.cfg` originally specified in PEP 518 (https://www.python.org/dev/peps/pep-0518/).

Simple and clean explanation, right? Well, no, not really.

Since its release, it's now the exclusive way to configure `black` for a project. Additional tools like `poetry` (somewhat of a `pipenv` competitor) and `flit` (a tool to make packaging and publishing to PyPI easier) have come out to also exclusively use `pyproject.toml` as their configuration file.

It's clear from the PEP that this was the intended consequence for other tools to use `pyproject.toml`. However, it seems to only have really touched brand new projects. Older, mature packages seem to still primarily be using `setup.cfg` for their tooling configs in their CI process.

I generally tend to adopt new trends like these in my _projects_, but in my existing _packages_ I admit not seeing a whole lot of value presently in ripping out my `setup.py` and `setup.cfg`  just for fun.

# flake8
I used pylint for a very long time while at Worthwhile and began using flake8 at Peerfit. I really had no opinion of one over the other.

However, I can say now that holy crap does flake8 have so much stuff.
It wraps pyflakes, pycodestyle, and mccabe. Additionally, it's just got so many plugins: flake8-bugbear, flake8-import-order, flake8-print, etc (https://github.com/DmytroLitvinov/awesome-flake8-extensions).This rich ecosystem simply doesn't seem to exist for pylint.

Finally, a lot of major projects seems to use flake8, so the user base is consistent and mature:
- Django (https://github.com/django/django/blob/master/setup.cfg#L5)
- flask (https://github.com/pallets/flask/blob/master/setup.cfg#L22)
- even freaking youtube-dl (https://github.com/ytdl-org/youtube-dl/blob/master/setup.cfg)

So this has sold me on using flake8 for the foreseeable future.
Revi: a simple responsive viewer app
Tags: responsive, electron, vue, tailwindcss
Published: 2019-10-16 19:42:32

---
title: Revi: a simple responsive viewer app
published: true
description: Simple viewer to test responsiveness in your website(s)
tags: responsive, electron, vue, tailwindcss
---

Hey developer friends, I'm developing a responsive viewer for websites, named **revi**, like it shows in the next screenshot:

![Revi screenshot](https://thepracticaldev.s3.amazonaws.com/i/3i44hk34jxnq0b42n03n.png)

Currently, it supports:
- to create frames with a specified width, height y title
- delete frames created

The features I'm willing to develop in a near future:
- sync scroll between the frames
- sync URL loaded when the user clicks some link
- and what the users want!

To develop this app, I used Electron, VueJS and the awesome framework TailwindCSS!

I want to know if some devs are interested in **revi** as a product?
Toggling multiple password fields (Accessible Form)
Tags: codepen, vanillajsaccademy, css, javascript
Published: 2019-10-16 19:22:58

---
title: Toggling multiple password fields (Accessible Form)
published: true
tags: codepen, vanillajsaccademy, css, javascript
---

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

{% codepen https://codepen.io/giandomenico/pen/RwwRYda %}
Questions to ask for CQRS
Tags: cqrs, services, design
Published: 2019-10-16 19:11:19

CQRS stands for "Command Query Responsibility Segregation". The idea is an extension of the single responsibility principle applied to services:

Command and Query are responsibilities of a system. By single responsibility principle, each of these responsibilities should be separate in the system.

"How tho?" As with all design principles: giving the definition does not teach how to apply the principle. :)

There are a lot of technologies that enable CQRS and these are worth an overview. I want to focus on the conceptual and logical first. The critical aspect of segregating command and query is useful even in design.

For instance, a useful question: "Does this change the state of the system?". This likely resembles asking about purity to functional programmers. Yep, same idea :) Just applied early and often in the design. We should aim for a clear answer: Yes or no. If there isn't a clear answer then that likely indicates a poor separation of command and query.

Is this an interesting topic for anybody else?
Improve Your Git Productivity with Bash
Tags: git, productivity, beginners, bash
Published: 2019-10-16 19:01:08

---
description: There are a few methods that you can work with Git. You can either use some user-friendly software like SourceTree to manage your workflow and repository. It has a beautiful Git GUI for you to “click” around. However, if you are a guy like me, who just wants to use a command line, then you are in the right place.
---
There are a few methods that you can work with Git. You can either use some user-friendly software like [SourceTree](https://www.sourcetreeapp.com/) to manage your workflow and repository. It has a beautiful Git GUI for you to “click” around. However, if you are a guy like me, who just wants to use a command line, then you are in the right place.

Imagine that when you finish your work, then you want to add all the changes, write a commit message and push to the branch that you are working all.

```
git status
git add .
git commit -m "Some random messages" 
git push origin dev
```

This is a long and repetitive process to me. It may cost a few seconds to a minute to do all of this. How much time did I lose in a week or a year — I’m being dramatic here :D

So I decided to find a method to improve this process and thanks to bash, there is a way to combine these commands together.

From now, every time I finish a task, this is the only command that I use:

```
gf "Some random messages"
```

Looks how much time, did I save over the year :D

I will show you how I did it by taking advantage of bash. I’m using Mac, but you can still do it with on a Linux machine.

In your home directory, edit or create the .bash_profile file. You can use any programs to edit it. I’m using Vi. *If you don't use .bash_profile as your default bash, replace it by your own such as .zshrc*

```
vi /Users/dnguyen/.bash_profile
```

Then we start to add our shortcuts:

```
# Github
alias gs="git status"
alias gd="git diff"
alias gp="git pull"

# Git finish will push to current branch
# Eg. gf "commit message"
gf() {
 CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
 git add . && git commit -m "$1" && git push origin "$CURRENT_BRANCH"
}

# Git merge
# Eg. gm branch-name
gm() {
 git merge "$1"
}

# Git checkout
# Eg. gc branch-name
gc(){
 git checkout "$1" && gp
}
```

After that, we need to load any functions file into the current shell script.

```
source .bash_profile
```

Now, enjoy the hack. Hope this help ;)
What's your advice for future CS students?
Tags: learn, beginners, computerscience, discuss
Published: 2019-10-16 18:43:08

Hey developers out there!

I guess at least some if you went to university and studied computer science or software engineering. What are your tips and advices for those of us who are also planning to do so?

What parts were especially hard for you?

What do you wish you've had paid more attention to when you look back?

Please share your wisdom with the next generation! :)

Feel free to fill the comment section with any advice you have, also related to internships, semesters abroad or something like this.
JSON formatter web service in Brainfuck
Tags: hacktoberfest
Published: 2019-10-16 18:39:38

[JSON formatter in Brainfuck](https://github.com/KrzysztofSzewczyk/JSONFormatter) (and the sister project, asmbf) are the ultimate Hacktoberfest projects! What do you think about them?

Has the web development in Brainfuck era begun?
Chuyển nhà quận 9 Sài Gòn Đại Nam
Published: 2019-10-13 22:32:29

Sắp xếp, lắp đặt lại đồ đoàn theo vị trí mà các bạn đã định sẵn.

Đến liên hệ mới được kê dọn, gần xếp, lắp đặt theo yêu cầu của Quý khách.

Đội ngũ nhân viên chuyên dụng cho dịch vụ chuyển nhà quận Bình Tân Chuyên nghiệp, đảm thực hiện cẩn thận, chỉnh chu tất cả công việc được giao và khoa học.

Hoàn tiền 100% giả dụ sau lúc tiêu dùng dịch vụ chuyển nhà quận Bình Tân ko chấp nhận sở hữu chất lượng dịch vụ.

Ấn định thời kì chuyển nhà,văn phòng

Miễn tổn phí đa số các vật dụng đóng gói như quan tài carton, túi nilon, bao bì, băng keo… 

Quận một là trọng tâm của tỉnh thành Hồ Chí Minh, nơi phồn hoa và sang trọng bật nhất. Với rộng rãi công ty, doanh nghiệp nức tiếng trong và ngoài nước

Để với thể tậu và dùng cho mình một dịch vụ chuyển nhà trọn gói quận Tân Bình giá rẻ, dịch vụ chuyển nhà trọn gói quận Tân Bình ch

Để giúp quý người dùng sở hữu thể lựa tìm và dùng cho mình 1 dịch vụ chuyển nhà trọn gói quận Bình Tân 

Gọi cho chúng tôi ngay khi bạn muốn sử dụng <a href="https://chuyennha.suu.vn/chuyen-nha-quan-9-uy-tin.html">dịch vụ chuyển nhà trọn gói ở quận 9</a>.
Admin dashboards - Building SaaS #10
Tags: python, django, saas
Published: 2019-10-16 18:03:16

{% youtube mLCo1pyuUAc %}

In this episode, we started on a tools dashboard for admin-level users.  We talked about Django's auth module for handling access and how to protect views from unauthorized users.

Show notes for this stream are at [Episode 10 Show Notes](https://www.mattlayman.com/building-saas/admin-dashboards/).

To learn more about the stream, please check out [Building SaaS with Python and Django](https://www.mattlayman.com/building-saas/).
THREE.js
Tags: replit, html, css, javascript
Published: 2019-10-16 17:44:36

this is two of many of the shapes you can do with three.js.
three.js is a library that lets you create 3D object and make them do all kinds of stuff.
the shape i have created is a sphere and a cube and they both spend around.


{% replit @jameslavis9/TRUETHREEjsFILE %}
How to find and replace all occurrences of a String in JavaScript
Tags: javascript, react, tutorial
Published: 2019-10-16 17:27:27

Learn how to find and replace all occurrences of a String in JavaScript. You will learn about the String.replace() method
that is available in JavaScript and how it works!

Get the code samples at https://gist.github.com/SuperBonsaii/...

**********Watch all JavaScript Tutorials**********

http://bit.ly/javascript-youtube

***************************************************

Harit on Twitter: https://twitter.com/harittweets

Subscribe for more videos on JavaScript with Visualization: https://www.youtube.com/channel/UC0yZ...
Follow bonsaiilabs on Twitter: https://twitter.com/bonsaiilabs
Follow bonsaiilabs on Facebook: https://www.facebook.com/thebonsaiilabs
Visit bonsaiilabs at https://bonsaiilabs.com
Flawk Live Stream Outline - Week 1
Tags: showdev, startup, react, javascript
Published: 2019-10-16 17:26:18

Every week I do a stream as I build out my new company [flawk.to](https://flawk.to). I have posted a little about this previously ([#1](https://dev.to/ericadamski/creating-more-meaningful-interactions-4j2h), [#2](https://dev.to/ericadamski/i-m-building-a-product-should-i-stream-it-51nk)) and will continue to write about it as time goes on. Some feedback I got on how to make my streaming more useful for others was a plan! So each week I will be posting an outline of what I will be doing in the stream and what the goals of that stream will be.

For this week I will be:

1. Adding authentication using Google and Github OAuth services. I will be writing some React components and some NodeJS backend serverless functions to handle the process of authentication. I will also be using JWTs although I am definitely not an expert!

2. Adding the ability to create groups. This is going to be some more simple CRUD operations using MongoDB again with some React on the frontend and NodeJS serverless functions!

By the end of the stream I should: Be able to log in and log out, as well as create a group and an event for that group.

Looking forward to seeing y'all on the stream! I will be streaming over here https://www.twitch.tv/ericadamski starting at 9PM EST
How to create Docs Without Lifting a Finger. 📖
Tags: javascript, webdev
Published: 2019-10-16 17:15:42

Full disclosure, you do have to lift a finger but not as many times as you think.

Do you think your code is half way between readable by humans and parsable by machines? Good I thought you would say that. Do you think you should be writing documentation for your code?

I disagree, you might feel guilty but you actually don't need to lift a finger to 'write' documentation initially, here's how:

### 1️⃣ Unit Tests
[My post: What is a unit and how do I test it?!](https://dev.to/adam_cyclones/what-the-heck-is-a-unit-how-do-i-test-it-4le9)

As I didn't really specify the method of generating documentation, I'm defining it as unintentional act of doing something which yields documentation, and nothing makes better docs than a good suite of unit tests. By testing as many cases as possible you are defining the usage of a function, what it likes and doesn't like and how you can use it. 🐶 Good function, who's a good boy, he's a good boy.

### 2️⃣ xstate
[Xstate visualiser](https://xstate.js.org/viz/)

Sometimes the underlying principles of your acutecure can be enough to generate powerful yet high level visualisations, take xstate for example, affiliated but not limited to React (I'm not a react developer), using this state machine as the basis of your application, the simple act of just pasting your state machines into thier visualization tool can give you amazing charts, yes you heard me, charts that model your state code, super!

### 3️⃣ JsDoc or similar
[JSDoc Docs 😁](https://devdocs.io/jsdoc/)

Turning your useless comments into a formal syntax is also enough to generate yourself some nice documentation pages, the more you put in the more you get out, not only that but vscode fully supports this style of comment and with markdown as well.

### 4️⃣ Typescript
[Typescript in 5 mins](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)

If you know you know, Typescript is a form of documentation as declaring types in your code is information, similar to unit tests, explicit types tell other developers and you 3 months from now, how to use your code.