teleren/devto huggingface dataset:
Ubuntu Arc Menu Upgrade Error
Tags: gnome, ubuntu, linux
Published: 2020-01-25 22:44:52

---
title: Ubuntu Arc Menu Upgrade Error
published: true
date: 2020-01-19 00:00:00 UTC
tags: gnome,Ubuntu,Linux
canonical_url: 
---

Tonight a desktop notification popped up on my Ubuntu 19.10 desktop to remind me that my [Arc Menu](https://extensions.gnome.org/extension/1228/arc-menu/) [Gnome Extension](https://extensions.gnome.org/) had an update.

Here is the [Arc Menu](https://extensions.gnome.org/extension/1228/arc-menu/) in action:

![2020-01-19_22-03-15_arc_menu.png](https://solrevdev.com//media/2020-01-19_22-03-15_arc_menu.png)

Normally I can update it via either Google Chrome or Firefox using the [Gnome Extensions website](https://extensions.gnome.org/) however tonight when I tried the update an error occurred.

Literrally an `Error`!

![2020-01-19_20-52-06_arc_error.png](https://solrevdev.com//media/2020-01-19_20-52-06_arc_error.png)

**Missing Menu**

The menu was also missing and I tried to reinstall, reboot and all the usual turn it off and back on again tricks but to no avail.

After some duckduckgo’ing (I am trying [duckduckgo](https://duckduckgo.com/) as my default search these days over the evil Google), I came across the solution of restarting Gnome.

**Solution**

So for anyone else that needs this solution or for me if/when this happens again here is what to do when you see the error.

Press <kbd>Alt</kbd>+<kbd>F2</kbd> to bring up a dialog then type <kbd>r</kbd> to restart the Gnome process.

![2020-01-19_22-03-14_restart_gnome.png](https://solrevdev.com//media/2020-01-19_22-03-14_restart_gnome.png)

After a refresh, the menu should be working and the error will be gone.

![2020-01-19_20-53-27_arc_success.png](https://solrevdev.com//media/2020-01-19_20-53-27_arc_success.png)

Success 🎉
Answer: How do I get started with Node.js
Tags: node, javascript
Published: 2020-01-18 23:48:48

---
cover_image: https://thepracticaldev.s3.amazonaws.com/i/mvmcjziuatlthx9f3ei5.jpg
title: Answer: How do I get started with Node.js
published: true
tags: node, javascript
---

{% stackoverflow 5511507 %}
{% tag node %}
build your own theia ide AND your own chrome browser extension in a day
Tags: webdev, theia, ide, chromium
Published: 2020-01-18 23:41:00

build your own theia ide AND your own chrome browser extension in a day

AM (*)

theia quickstart instructions (including installing nvm node etc etc)
* `wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash`
* (logout and login again ! or source the bash script if you are a pro) 
* `nvm install 10`
* `nvm use 10`
* `npm -g install yarn` # (TOPTIP -g means READ and SET options globally)
* `mkdir mytheia`
* `cd mytheia` 
* `vi package.json` # (C&P from https://theia-ide.org/docs/composing_applications)
* `yarn` # will autoinstall everything from your package.json
* `yarn theia build` (takes approx 400 seconds)
* `yarn theia start`
* open http://localhost:3000

theia full instructions
* https://github.com/nvm-sh/nvm/blob/master/README.md#install--update-script
* https://theia-ide.org/docs/composing_applications/

PM (*)

chrome browser extension quickstart
* https://dev.to/sahilrajput/create-and-publish-your-first-chrome-extension-in-just-5-steps-3c3n

chrome browser extension full instructions
* https://developer.chrome.com/extensions/overview

(*) = timings should be adjusted accordingly if you start at say 11 am :)
Sorting things out in Python
Tags: python, computerscience
Published: 2020-01-18 23:25:42

For those that know me personally, I have a weird hobby of vintage computing and have started down a rabbit hole of IBM systems.

Sorting has been a task that IBM provided some solutions to help businesses process data. In the era of punch cards, one may find it necessary to sort the cards that represented program input. For example, a program that processes names may take cards as input with folks' names entered on them. For convenience these cards may need to be sorted after an army of typists cranked out decks of cards. Enter the IBM 80 series card sorting machine. **Loudness warning:** see the [IBM 83](https://www.youtube.com/watch?v=jJH2alRcx4M) in-action at the Computer History Museum in Mountain View California. Isn't it crazy that a refrigerator-sized machine's single function was sorting? What's more crazy is that the IBM 83 can only sort one character at a time. This means if the sorted cards had to be passed through the machine multiple times to fully sort the deck. 

Sorting is a classic problem in computer science. If you've taken an algorithms course, a good chunk of that course can be dedicated to sorting. I _love_ Python because the language wraps up many complex concepts into an easy-to-use experience, so you can go get work done. A reasonable sorting algorithm called [Timsort](https://svn.python.org/projects/python/trunk/Objects/listsort.txt). 

Let's look at sorting lists in this post. 
```
class list(object)
 |  list(iterable=(), /)
...
 |  sort(self, /, *, key=None, reverse=False)
 |      Stable sort *IN PLACE*.
 |  

```

So the `list` object has a method that affects the state of the variable. Depending on your application, this may or may not be desired.  

```
fruit = ['oranges', 'bananas', 'grapes', 'apples']
fruit.sort()
fruit
>>> fruit
['apples', 'bananas', 'grapes', 'oranges']
```

Sometimes it's necessary to preserve the original list. What do we do then?

```
help(sorted)
sorted(iterable, /, *, key=None, reverse=False)
    Return a new list containing all items from the iterable in ascending order.
    
    A custom key function can be supplied to customize the sort order, and the
    reverse flag can be set to request the result in descending order.
```

Coolio so we can preserve the original list using the `sorted` function.

```
fruit = ['oranges', 'bananas', 'grapes', 'apples']
sorted(fruit)
>>> ['apples', 'bananas', 'grapes', 'oranges']
fruit
>>> ['oranges', 'bananas', 'grapes', 'apples']
```

This may be a pretty simplistic blog post. As I spend my free time playing tech archaeologist, I find it fascinating the power in higher-level languages, especially accessible languages such as Python. 

The takeaways I hope you walk away with:
 * the `sort()` method on a list is *in-place*, it changes the variable.
 * the `sorted()` function returns a new list.
 * The built-in `help()` function is a helpful reference when you need it.
err msg of the day : "this is not the nvm you are looking for!"
Tags: node, webdev
Published: 2020-01-18 22:30:39

the are a lot of version of node and nvm to choose from 

try typing
```
$ nvm -v
```

if you get the error message 
```
this is not the package you are looking for: please go to http://nvm.sh
```

you need to reinstall a local updated version as per http://nvm.sh
```
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
```

then run
```
nvm --version
```

if the reinstall worked you should see
```
$ nvm --version
0.35.2
```

see also
* https://dev.to/jlouiss/how-to-use-nvm-and-why-4e05
* https://dev.to/deepika_banoth/how-to-install-node-js-using-nvm-on-linux-4mch
* https://dev.to/rubiin/how-to-manage-multiple-nodejs-version-in-a-single-machine-using-nvm-170a
Google Fast: Day 0
Tags: google, nomoogle, ditchgoogle, googlefast
Published: 2020-01-18 21:50:57

---
title: Google Fast: Day 0
published: true
description: Trying to go one month without google.
tags: google, nomoogle, ditchgoogle, googlefast
series: Google Fast
---

# getting rid of Google

I am going to try to not use a Google product for one month.

## dear gods, why?

Recently I fully made the switch from Chrome to Vivaldi. I tried a few other browsers, including Brave, but Vivaldi had all the power features I needed and all the privacy I wanted. I liked the concept of Brave but I could get 90% of what I liked about Brave in Vivaldi with the right plugins. Vivaldi had some features that you just can't get with plugins.

Vivaldi seems to be very anti-tracking and anti-Google. So I was already kind of heading in an anti-Google direction with my non-Google browser and my DuckDuckGo default search. Enter Nomoogle.

{% post https://dev.to/teamxenox/introducing-nomoogle-your-very-own-privacy-friendly-bear-4b08 %}

Why not install it and try it out? This will help guide me away from Google products and I can see if I can live without all the Google products that I use. Plus, it is January, the month of resolutions, and I am a sucker for willpower challenges like these.

## setup

Unfortunately, I can't just start using it. My email accounts are all on Google so I need to set them up to forward to some new email for now. Also, I have an android phone so I don't know how much work I am going to have to do to that to remove google products.

### installing Nomoogle

Installing the extension was a simple as following the directions on the github.

{% github sarthology/nomoogle %}

### forwarding emails

Let's check out what Nomoogle decides to recommend. After a quick trip to Gmail, I got this guy.

![You Shall Not Pass!](https://thepracticaldev.s3.amazonaws.com/i/4khayz8jzcqt5zgofajt.png)

After a bit of confusion about where the recommendations were, I clicked the extension icon and got the list of alternatives.

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

Let's check these out!

{% post https://dev.to/sharkbeard/email-services-compared-55i8 %}

Then, I had to set my multiple gmail accounts to forward to my new account. I really was desperate for a way to only forward unlabeled email. If anyone knows how to do that please leave a comment. 

### Google maps alternative


It looks like I will try Here for directions.

### Google Play

I can't decide if I should just cheat and use Google Play to install apps or if I need to exclusively use FDroid. 

## conclusion

I haven't officially started but I am pretty excited to try a bunch of new services. We will see how day zero goes tomorrow.
My notes for the "Pragmatic Thinking and Learning" book
Tags: learning, mindmap
Published: 2020-05-09 19:05:30

---
title: My notes for the "Pragmatic Thinking and Learning" book
published: true
date: 2020-01-18 21:01:10 UTC
tags: learning, mindmap
canonical_url: https://vorakl.com/articles/learning/
cover_image: https://vorakl.com/files/learning/new-skill-acquisition.png
---

## New Skill Acquisition
[![New skill acquisition](https://vorakl.com/files/learning/new-skill-acquisition.png)](https://vorakl.com/files/learning/new-skill-acquisition.png)

  

## Pragmatic Learning Plan
[![Pragmatic learning plan](https://vorakl.com/files/learning/pragmatic-learning-plan.png)](https://vorakl.com/files/learning/pragmatic-learning-plan.png)

  

## Dreyfus model

There is also available my article about this model [Dreyfus model of skill acquisition](https://dev.to/vorakl/dreyfus-model-of-skill-acquisition-1n72)

[![Dreyfus model](https://vorakl.com/files/dreyfus/dreyfus.png)](https://vorakl.com/files/dreyfus/dreyfus.png)

  

## Mastering Knowledge
[![Mastering knowledge](https://vorakl.com/files/learning/mastering-knowledge.png)](https://vorakl.com/files/learning/mastering-knowledge.png)

  

## Gaining Experience
[![Gaining experience](https://vorakl.com/files/learning/gaining-experience.png)](https://vorakl.com/files/learning/gaining-experience.png)

  

## How to start learning
[![How to start learning](https://vorakl.com/files/learning/how-to-start-learning.png)](https://vorakl.com/files/learning/how-to-start-learning.png)
3 Acronyms You Should Know Before Entering Backend Development
Tags: beginners, rails, ruby, oop
Published: 2020-01-18 20:59:34

Software engineers are lazy. 

In addition to creating the next best app that stems from our laziness, we also coined a gazillion acronyms to consolidate a concept, framework or structure. While convenient to technical folks, these terms often end up confusing outsiders even more. 

Here are three acronyms that I found most useful as I ventured into the world of backend development.

<h3><b>CRUD</b></h3>

CRUD is short for <b>C</b>reate, <b>R</b>ead, <b>U</b>pdate, and <b>D</b>elete. It covers the most basic functions of an application. When brainstorming product feature ideas, developers and designers alike will make sure each user story adheres to at least one of the CRUD functions.

Think about the popular apps out there. Almost all of them allow us to create, read, update and delete our own accounts.

<h3><b>REST</b></h3>

You would think that REST is a combination of four words. Weirdly enough, it stands for <b>RE</b>presentational <b>S</b>tate <b>T</b>ransfer. 

What the what?

REST is a style for computer systems to communicate on the web. Every channel of communication starts anew. The communicators on both ends (client-side and server-side for instance) understand each other without having to remember any previous messages. This is called "stateless." Developers can, therefore, implement codes on either side without one side having to know about changes of the other.

The constraints of this REST paradigm, or RESTfulness, allow for flexibility across platforms and enable web applications to scale quickly.

<h3><b>MVC</b></h3>

MVC, or Model-View-Controller, is a web framework that separates the logic of designing web applications into three parts:

* <b>M</b>odels: 
This is where data is stored, manipulated, and saved.

* <b>V</b>iews:  
Generally consist of HTML, CSS and JavaScript files, Views represent the front-end part of a web application.

* <b>C</b>ontrollers: 
 The go-between for models and views. I tend to think of it as an air traffic control center. When a browser request "flies in," the controller will relay data from the browser to models and views, and respond to the browser after retrieving all necessary information from models and views.

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

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

CRUD, REST and MVC altogether enable developers to build an organized, functional web app. They strengthen the separation of concerns between subsections inside the framework. 

These structures also reflect the convention of single source of truth, which prevents duplication of the code and/or logic.

Is there any other acronym or terminology that every backend developer must know? Please tell me in the comments below!
Email Services Compared
Tags: email, gmail, ditchgoogle, googlefast
Published: 2020-01-18 20:46:56

---
title: Email Services Compared
published: true
description: Looking at some Gmail alternatives
tags: email, gmail, ditchgoogle, googlefast
---

# let's check them out!

I am switching from Gmail to a more privacy-focused email for one month as part of my google fast. Here are the different email services I checked out.

### Fastmail

Pros:
* Android, iOS apps
* $3-$9/mo. plans
* 30-day free trial
* Calendar and Contacts included

### ProtonMail

Pros:
* Open-source
* Completely Anonymous
* Swiss Privacy
* Made by CERN Scientists
* Android, iOS apps
* €5-30/mo. plans
* Limited free plan

### Zoho Mail

...

...

...

Sorry, I got distracted playing [pacman](https://www.zoho.com/mail/blog/zoho-mail-2019.html) on their website. 

Pros:
* automate.io, Zapier, Integromat, Blendr.io & Workato integrations
* Android, iOS apps
* Calendar, Contacts, Tasks, Notes, and Bookmarks included
* Integrates with their Docs and CRM
* Free plan?

Cons:
* Asks for a lot of information upfront

### GMX

Pros:
* Free

Cons:
* So. Many. Ads.

### Canary Mail

Pros: 
* Can use existing email account including Gmail
* iOS app

Cons:
* No Andoid app

### Tutanota

Pros:
* Open Source
* Completely Anonymous
* €1.20-6/mo. plans
* Free plan
* Android, iOS apps
* Android app available on FDroid so you don't have to use Google Play
* Calendar and Contacts included

## wot i fink

For me, Canary Mail is immediately out because I can't use it on my phone. Also I am going to rule GMX out because I literally never want to go on their site again. 

My top three are probably Zoho Mail for its integrations, and ProtonMail & Tutanota for their privacy and anonymity. Let's go into those in more detail.

## detailed comparison

               | ProtonMail | Tutanota   | Zoho Mail
---------------|------------|------------|----------
Price/mo.      | $5-30      | €1.20-6    | $1-4
Free Plan      | Limited    | Limited    | Yes?
Space          | 0.5-20GB   | 1-10GB     | 5-50GB
Custom Domains | Paid plans | Paid plans | Yes
Anonymous      | Yes        | Yes        | No
Calendar       | No         | Yes        | Yes

Both ProtonMail and Tutanota only have filtering and inbox rules on the paid plans which is very disappointing. I can't tell if Zoho Mail's free plan is limited without signing up.

## conclusion

I think I will probably give Tutanota a shot for a month. Then if I don't like it I will try ProtonMail. Zoho Mail kind of rubbed me as more of a more business-focused wannabe Google. I wasn't very keen on jumping from one all-in-one solution into another.
How to procrastinate while working hard
Tags: programming
Published: 2020-01-18 20:07:35

Refactoring is an important part of programming. If you are maintaining a non-trivial code base you need to constantly remove cruft and improve on solutions otherwise the code will slowly rot.

Working with improving abstractions and code quality there is also a lure which is mostly ignored, which is over-engineering. The urge to add code that feels “magical” and just does things in an extremely elegant way. You can find examples in amazing C++ templates, or some awesomely elegant Swift code that might use some combination of operator overloading, generics and pattern matching. It might look cool, but over-engineering is dangerous.

It’s dangerous because you can spend days on that “perfect abstraction” which might be elegant on the surface — but your teammates will have a less pleasant time trying to figure out how to debug or extend it later on.

It’s dangerous because all that time you spent might make you reluctant to find easier solutions, or throw it away when it’s no longer needed.

It’s dangerous because that complexity disguised as abstraction is making your code less maintainable and also less easy to understand.

It’s dangerous because you might have thrown away bug free code and replaced it with something new and untested because you thought it might look more elegant.

*But most of all it’s dangerous because it’s so damned satisfying to just find those beautiful abstractions. It’s so much fun that we forget how dangerous it is.*

So when you feel the urge — remember restraint. The “magically cool things” your language can do are usually exactly those parts that you should stay clear of.
Running Docker Container With Gunicorn and Flask
Tags: python, docke, flask, gunicorn
Published: 2020-01-18 20:00:45

In this post, I'll show how to serve a simple Flask application with Gunicorn, running inside a Docker container.

Let's begin from creating a minimal Flask application:

```python

from flask import Flask

app = Flask(__name__)


@app.route('/')
@app.route('/index')
def index():
    return 'Hello world!'
```

Next, let's write the command that will run the Gunicorn server:

```sh
#!/bin/sh

gunicorn --chdir app main:app -w 2 --threads 2 -b 0.0.0.0:8003
```

The parameters are pretty much self-explanatory: We are telling Gunicorn to spawn 2 worker processes, running 2 threads each. We are also accepting connections from outside, and overriding Gunicorn's default port (8000).

Our basic Dockerfile:

```docker
FROM python:3.7.3-slim

COPY requirements.txt /
RUN pip3 install -r /requirements.txt

COPY . /app
WORKDIR /app

ENTRYPOINT ["./gunicorn_starter.sh"]
```

Let's build our image:

```sh
docker build -t flask/hello-world .
```

and run:

```sh
docker run -p 8003:8003 flask/hello-world
```

Now we should be able to access our endpoint:

```sh
$ curl localhost:8003
Hello world!
```

### Bonus - Makefile

Let's create a simple *Makefile* that allows us to build, run and kill our image/container:

```makefile
app_name = gunicorn_flask

build:
	@docker build -t $(app_name) .

run:
	docker run --detach -p 8003:8003 $(app_name)

kill:
	@echo 'Killing container...'
	@docker ps | grep $(app_name) | awk '{print $$1}' | xargs docker
```

Now we should be able to run:

```sh
# build Docker image
make build
# run the container
make run
# destroy it
make kill
```
Deploy static vuepress site using now.sh and basic authentication
Tags: javascript, vue, vuepress
Published: 2020-01-18 19:46:42

Vuepress is a minimalistic, vue-powered static site generator. Now is free and easy-to-deploy static hosting. Both used together let us deploy generated static sites for free in seconds.

So, what if we would like to quickly deploy our site and restrict access with username and password? Here, I'm gonna show you how to set up a project step by step.

TL;DR:
Repo: https://github.com/daksamit/vuepress-basic-auth
Demo: https://vuepress-basic-auth.now.sh (credentials: admin | admin)

## Set up a new project

First of all, we need to create a project directory (vuepress-new-auth), init yarn project and add vuepress dev dependencies. 

```sh
mkdir vuepress-now-auth
cd vuepress-now-auth
yarn init -y
yarn add -D vuepress
```

For better dev experience, we add useful scripts to our `package.json` file.

```json
"scripts": {
  "start": "vuepress dev src",
  "build": "rm -rf public && vuepress build src && mv src/.vuepress/dist public"
}
```

## Vuepress development

Let's create our first vuepress page. If `src` directory doesn't exist yet, we need to make it. Let's add heading to our `README.md` and start dev server. 
```
mkdir src
echo "# Vuepress now auth" > src/README.md
yarn start
```

## Now deployment

If we don't have now installed yet, we can install it globally: `yarn global add now`. Then we have to sign in: `now login`
To deploy our site, we just need to run `now` and in a moment we have generated deployment links. Now our project is live :)

## Basic Authentication

The only thing left to do is adding basic authentication to our vuepress project.
the deployed site is available for everyone. We can protect app by adding `static-auth` module, creating now.json and index.js in root working directory. Here is what we need to do:

### Add now.json configuration file

```js
// now.json

{
  "version": 2,
  "name": "vuepress-now-auth",
  "builds": [
    { "src": "index.js", "use": "@now/node" }
  ],
  "routes": [
    { "src": "/.*", "dest": "index.js" }
  ],
  "env": {
    "USERNAME": "admin",
    "PASSWORD": "admin"
  }
}
```

### Add static-auth module

```sh
yarn add static-auth
```

### add index.js for now server

```js
// index.js

const protect = require('static-auth')
const route = '/'
const { USERNAME, PASSWORD } = process.env
const isAuthenticated = (user, pass) => (user === USERNAME && pass === PASSWORD)
const options = {
  directory: __dirname + '/public'
}
const app = protect(route, isAuthenticated, options)
module.exports = app
```

Finally, just run `yarn build && now --prod` and enjoy :)

Of course, you can read more about vuepress and now by following links:

- [base on repo: flawyte/now-basic-auth](https://github.com/flawyte/now-basic-auth)
- [create blog with vuepress](https://dev.to/itnext/creating-a-blog-easier-than-ever-starring-vuepress-and-vue-3p8c)
- [vuepress docs](https://vuepress.vuejs.org/guide/)
- [zeit now docs](https://zeit.co/docs/v2/introduction)