teleren/devto huggingface dataset:
install macOS high sierra on Virtualbox
Tags: macos, windows10, motivation
Published: 2020-08-22 13:18:28

macOS high sierra was rolled out in the year 2017. And its last update was released in 2019. there is always an fortunate that mac operating system is only installable on Mac machines. Non mac users cannot install mac operating systems on their computer. 

Is it untrue?

Well, not quite. there is a third method to install macOS high sierra on non mac systems.

You can install mac operating systems on non mac systems including Windows OS or Linux with the help of Virtualbox. 

Virtualbox including VMware are softwares orignally developed for the desktop virutalization. These are used by the non mac users to install macOS on their system. Or it is also used to run multiple operating system on one hardware. So, therefore, if you want to install mac operating system on Windows. Then we have already covered this section in another article.

So, if you like to install macOS high sierra on Windows PC with the help of Virtualbox. Then please visit the following article.



https://techvatan.com/install-macos-high-sierra-on-virtualbox-on-windows-os/



Moreoever, if you want to read some more knowledgeble upto date content Please visit the following articles.



https://techvatan.com/download-macos-high-sierra-torrent-image/
Node Workshop part 2 - free online workshop by SCS Concordia
Tags: node, mongodb, beginners, workshop
Published: 2020-08-22 13:12:57

---
title: Node Workshop part 2 - free online workshop by SCS Concordia
published: true
description: SCS presents a NODE.JS workshop in collaboration with Autodesk!
tags: #node, #mongodb, #beginners, #workshop
cover_image: https://scontent.fybz1-1.fna.fbcdn.net/v/t1.0-9/74632421_3023094597772698_4026103923882845235_o.jpg?_nc_cat=102&_nc_sid=340051&_nc_ohc=ZZp4TP4F44wAX_-WyFF&_nc_ht=scontent.fybz1-1.fna&oh=9b8990342767858331e19283c55b8cb9&oe=5F2C76CF
---

Come learn about web technologies at second installment of the Node.js workshop! 

This workshop will cover code and concepts to help you build a solid foundation for your next web project! 


### Registration: Workshop happening at August 27 (Thursday) 17:30 EST

> Sign up through Facebook events: 
https://www.facebook.com/events/751112552346326


> or sign up directly through this Google Form:
 https://forms.gle/oa8TLc3J5Yh1F11E9


### Topics

This is part 2 of the previous Node Workshop, the content will continue where we left off on part 1:

Discussed in Part 1
✅ use Node and Express to build a web server and REST API
✅ understand routing, request and response
✅ implement CRUD with HTTP methods

Recording of Part 1: https://www.youtube.com/watch?v=F7adheneS-8

Will be discussed in Part 2
🔲 build a server-rendered website using templates
🔲 connect to a Cloud NoSQL database: MongoDB Atlas DB
🔲 user authentication with sessions, cookies and tokens
🔲 using external APIs, such as Github Jobs, Giphy, Spotify and more!

### Preview

Here's a quick preview of the content, including a review of part 1 if you missed it:

[Workshop preview in Google slides] (https://docs.google.com/presentation/d/10L2wbMPKmtNYBb7i1kO9JPAoHoPICLLcZGNMbrK0IRQ/edit?usp=sharing)


### Screenshots

![mongodb](https://dev-to-uploads.s3.amazonaws.com/i/xx7wbws3t8tzwm0jxoxc.PNG)


![CRUD pages preview](https://dev-to-uploads.s3.amazonaws.com/i/x03d43cv3d94ns27hl9z.gif)


![CRUD pages challenges](https://dev-to-uploads.s3.amazonaws.com/i/r06o1oxrbff6j6mflzuz.PNG)


![login and logout](https://dev-to-uploads.s3.amazonaws.com/i/v7o5tvq5pyngstp5l5h8.gif)


![authentication general flow](https://dev-to-uploads.s3.amazonaws.com/i/rduyx6b5icn3dkt3ddkv.PNG)


![one-time hash](https://dev-to-uploads.s3.amazonaws.com/i/fzpku4wblsauklexzlze.PNG)


![session-based auth]
(https://dev-to-uploads.s3.amazonaws.com/i/rnwe7bwc1zkihizmcotb.PNG)


![token-based auth](https://dev-to-uploads.s3.amazonaws.com/i/5mn2391rs1w6i0k9ey98.PNG)


![CORS](https://dev-to-uploads.s3.amazonaws.com/i/4ir5rzcmxfw0xkmmrjvn.PNG)


![using public APIs](https://dev-to-uploads.s3.amazonaws.com/i/dy73bxan3zj2bj5mg3za.PNG)


![Spotify API](https://dev-to-uploads.s3.amazonaws.com/i/b7jd9ajydisih3f152qa.PNG)




*Note: This is an online event that will be conducted live on YouTube. The link will be provided prior to the event, so make sure you sign up!


See you there! 🤓 
👩‍💻 👨‍💻
Headless WordPress + Sapper Navigation with Menus (Part 4)
Tags: svelte, javascript, sapper, wordpress
Published: 2020-08-22 09:18:13

WordPress API doesn't have an endpoint for obtaining menu and menu items this requires [WP-REST-API V2 Menus](https://wordpress.org/plugins/wp-rest-api-v2-menus/) Plugin and after installing it unlocks new routes

* /menus/v1/menus list of every registered menu.
* /menus/v1/menus/<slug> data for a specific menu.
* /menus/v1/locations list of every registered menu location in your theme.
* /menus/v1/locations/<slug> data for a specific menu location.

#### Testing plugin

In the browser `https://YOUR-DOMAIN/wp-json/menus/v1/menus` hitting this should give you the menus if not check if the plugin is activated and make sure that you have created a menu with items

```json
[{
	"term_id": 2,
	"name": "Main Menu",
	"slug": "main-menu",
	"term_group": 0,
	"term_taxonomy_id": 2,
	"taxonomy": "nav_menu",
	"description": "",
	"parent": 0,
	"count": 2,
	"filter": "raw"
}]
```

`https://YOUR-DOMAIN/wp-json/menus/v1/menus/main-menu` will give all the items in the menu so we will be interested in that and populate the respective `slugs`.

#### Accessing page via menu
In the previous [post](https://dev.to/shriji/headless-wordpress-sapper-part-3-1b4g) (IMHO a better solution) but if you tend to have too many pages then menu would work better *I guess*🤷.

Just like how we were able to pass props via `/pages` API a similar method can be used for Menu API but remember this code is not designed for custom links which don't have the `slug` property and my suggestion for this to fully use custom links and target `url` instead of `slug`.

In your `_layout.svelte`

```html
<script context="module">
    //uses menu endpoint
    export async function preload() {
        const res = await this.fetch(`https://YOUR-DOMAIN/wp-json/wp/v2/menus/v1/menus/main-menu`)
        const data = await res.json()
        return {
            data
        }
    }
</script>

<script>
	export let data;
	import Nav from '../components/Nav.svelte';
	export let segment;
	export let pageData = [];
       //data.items are an array of menu items.
	data.items.map(e=>{
		let obj = 
		{
			id:e.ID,
			slug:e.slug
		}
		
		pageData.push(obj)
	})

</script>
```

On the Nav.svelte has no change from the previous [post](https://dev.to/shriji/headless-wordpress-sapper-part-3-1b4g)

```html
<script>
	export let segment;
	export let pageData;
</script>
```

To the list of existing menus add this snippet that compares and adds the active class


```html
{#each pageData as page }
	<li><a rel=prefetch aria-current="{segment === page.slug ? 'page' : undefined}" href="{page.slug}">{page.slug}</a>
	</li>
{/each}
```

Next part in the series would be setting up Sapper to be SEO ready for all the pages.
#053 Kubernetes - Environment Variables
Tags: kubernetes, devops, tutorial
Published: 2020-08-22 13:10:30

# Introduction
![intro](https://media1.tenor.com/images/f15057a41413c960db1f328ca5a732e3/tenor.gif?itemid=6203225)

this is part 53 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.

And I will cover lot of tools as we move on.
***
# Environment Variables
if we remember the example of [voting app](https://dev.to/elkhatibomar/047-kubernetes-voting-app-example-4j1) we have something in the yml file > spec called env , it's our environment variables it's same as docker where you can pass variables between container in case of docker and Pods in case of Kubernetes.
```yaml
# db-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: db
  name: db
spec:
  replicas: 1
  selector:
    matchLabels:
      app: db
  template:
    metadata:
      labels:
        app: db
    spec:
      containers:
      - image: postgres:9.4
        name: postgres
        env:
        - name: POSTGRES_USER
          value: postgres
        - name: POSTGRES_PASSWORD
          value: postgres
        ports:
        - containerPort: 5432
          name: postgres
        volumeMounts:
        - mountPath: /var/lib/postgresql/data
          name: db-data
      volumes:
      - name: db-data
        emptyDir: {} 
```

this is the old file from voting app , if we just focus on this part
```yaml
 env:
        - name: POSTGRES_USER
          value: postgres
        - name: POSTGRES_PASSWORD
          value: postgres
```
we can see that we are passing the username and the password as variables so we didn't hard coded inside our code.
but wait we have now 2 variables one in docker and one in Kubernetes with same env names ?
Kubernetes will override your environment variables in the docker file.
example let's say that we specify an environment variable inside of docker
```DOCKERFILE
ENV DBURL mongodb://localhost:27017/OrdersDB
```  
and inside our Kubernetes config we override it
```yaml
env:
  - name: DBURL
    value: mongodb://mongo:80/OdersDB
```
mongo is the name of our service in this case and 80 is the port of the service.

we can control our environment variables , in big projects we have lot of environment variables so it's very hard to manage them in this way , also maybe some of them are secretes like tokens.
Setting Up Python Virtual Environments
Tags: python, venv, bash
Published: 2020-08-22 13:08:08

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mpar8g3weo6jqsyz5doe.png)

**venv** is a package shipped with Python 3, which you can run using python3 -m venv (although for some reason some distros separate it out into a separate distro package, such as python3-venv on Ubuntu/Debian). It serves the same purpose as *virtualenv*, but only has a subset of its features [see a comparison here](https://virtualenv.pypa.io/en/latest/). — [source](https://stackoverflow.com/questions/41573587/what-is-the-difference-between-venv-pyvenv-pyenv-virtualenv-virtualenvwrappe)

What is the benefit of using wrapping your code into a virtual environment?
 - it isolates the project-related libraries and it doesn’t access the globally installed libraries.
We can think of it as if the project would live on its own island, isolated from the rest of the world, having its own little things going on 🌴

## Creating aliases

Before we move on, let’s create some aliases for convenience of use.
If you type `which python` in terminal, it will print out the path for the python executable, which should be something like this `/usr/local/bin/python3`.
Then, open `~/.bashprofile` you can type `cat ~/.bashprofile` to open it directly in terminal or use any other way suitable for you. And add there the following line:
`alias python=”/usr/local/bin/python3”`
Basically, we created an alias **python** for **python3**, and what it will do is each time you will be using python command it will be referring to **python3**, which I find neat. And, of course, you can skip this step if you want to.

## Creating a virtual environment

Creation of virtual environments is done by executing the command `venv`:
In my case, I already had some script saved in folder in Desktop, so I wanted to sort wrap it in the venv.
`➜ script git:(master) python -m venv  /Users/user/Desktop/script`
In the example above I refer to the script using the *absolute path*, however the *relative path* like `~/Desktop/script` should also work.

## Activating the virtual environment

To activate virtual environment type the following command:
`➜ script git:(master) ✗ source  /Users/user/Desktop/script/bin/activate`
And let’s say we have a `requirements.txt` file, which specifies all the dependencies required to successfully running the python project, now all those dependencies/libraries will be installed and accessible only within this virtual environment.

### Note

If you exit the terminal, next time you want to run your project you will need to source `~/.bashprofile` **AND** re-enable the virtual environment (using activate command from above).
*That’s all Folks!* ☕
RxJS Subjects
Tags: angular, rxjs
Published: 2020-08-22 12:56:59

Subjects are multicast. An RxJS Subject is a special type of Observable that allows values to be multicasted to many Observers. A Subject is an Observable and Observer. There are also a few specializations of the `Subject` type: `BehaviorSubject`, `ReplaySubject`, and `AsyncSubject`.


## Subject

Subject does not return the current value on Subscription. It triggers only on .next(value) call and return/output the value.
The below code snippet will loss `value 1` as no one is subscribed to the `sub` yet. After that `A` subscribed to `sub` and it will wait untill sub emits some value. When `sub` emit `value 2` it will console log `A - 2` and so on.


    const sub = new Subject<number>();
    sub.next(1); // It's lost as no one is observing sub currently
    // A start observing sub
    sub.subscribe({
      next: (v) => console.log(`A - ${v}`)
    });
    sub.next(2); // A - 2
    // B start observing sub
    sub.subscribe({
      next: (v) => console.log(`B - ${v}`)
    });
    sub.next(3); // A - 3 , B - 3
    // C start observing sub
    sub.subscribe({
      next: (v) => console.log(`C - ${v}`)
    });
    setTimeout(() => { 
      sub.next(4); // A - 4, B - 4, C - 4
    },5000);


## BehaviorSubject

BehaviourSubject will return the initial value or the current value on Subscription.
The below code snippet where we have `bsub` a `BehaviorSubject` with initial value as  `0` . So, when `A` subscribed to it - it will receive the initial value. In case of  `C`  , when it subscribed to `bsub` it will received the current value which is  `3`  and will console log  `C - 3` 


    const bsub = new BehaviorSubject(0);
    bsub.subscribe({
      next: (v) => console.log(`A - ${v}`)
    });
    bsub.next(1);
    bsub.subscribe({
      next: (v) => console.log(`B - ${v}`)
    });
    bsub.next(3);
    bsub.subscribe({
      next: (v) => console.log(`C - ${v}`)
    });


## ReplaySubject

ReplaySubject works some what simillar as BehaviourSubject but It will not tak any initial value.
It’s take a numeric parameter which acts as buffer for the number of old values it will hold. So, when  `B`  subscribed to  `rsub`  it recived  `2, 3, 4`  as buffer size is 3. Therefore  `1`  is lost. It will also recive  `5`  later when it emit. 


    const rsub = new ReplaySubject(3);
    rsub.next(1);
    rsub.next(2);
    rsub.next(3);
    rsub.next(4);
    rsub.subscribe({
      next: (v) => console.log(`B - ${v}`)
    });
    rsub.next(5);


## AsyncSubject

The AsyncSubject is a variant where only the last value of the Observable execution is sent to its observers, and only when the execution completes. 


    const asub1 = new AsyncSubject();
    const asub2 = new AsyncSubject();
    
    asub1.next(1);
    asub2.next(1);
    asub1.subscribe({
      next: (v) => console.log(`A - ${v}`)
    });
    asub1.complete(); // A - 1
    asub2.next(2);
    asub2.next(3);
    asub2.subscribe({
      next: (v) => console.log(`B - ${v}`)
    });
    asub2.next(4);
    asub2.complete(); // B - 4


Checkout all the above code in action at https://stackblitz.com/edit/kdev-rxjs-subjects
Share your Github Profile Readme
Tags: github, beginners, git, discuss
Published: 2020-08-22 12:49:21

I spent 3 hours trying to make it looks good ✌🏻 I'm thinking of how I can improve it 🤔.

> Here is the final look:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9dvg051apomqvchbdyui.png)

👾 Link to my Github: [https://github.com/trinwin](https://github.com/trinwin)

#### What does your Readme look like? ⬇️
> Don't forget to show the one you live some 😍🌟💫🌟⭐️🥰
Mastering rm command
Tags: ubuntu, linux, devops, devshow
Published: 2020-08-22 12:36:55

---
title: Mastering rm command
published: true
description: deleting files in *nix system can be tricky, in this post will we'll explore all things
tags: #ubuntu #linux #devops #devshow
cover_image: https://i.ibb.co/HBDXy8V/rm.png
---

we use the `rm` command to delete files from the server/local machine, this is `rm` is lifesaver command but sometimes it can be a life destroyer, so here we're gonna master of the `rm` command to be a lifesaver, not a destroyer. let's get into that.


#### Basic
Let's first create fake fille to practice with it:
```shell
$ touch myfile-{1..10}.txt
```

the above command will create 10 files, `{1..10}` will just give you 10 number, if you're curious to see run this `$ echo {1..100}`.

now to delete single fire,
```bash
$ rm myfile-1.txt
```

this will delete `myfile-1.txt` only. to delete multiple files add the file name after it:
```shell
$ rm myfile-2.txt myfile-3.txt myfile-4.txt
```
simpler is that!

if you wish to delete all files
```shell
$ rm -rf *
```

- `-r` flag recursively
- `-f` flag force, don't prompt

The above command will delete all the files in the current directory without showing any warning just because we're using `-f` flag to force and don't show any warning. using `-rf` flag, verify you're in the right directory by using `$ pwd` command, then proceed to delete files.

#### Advance

so far we've learned the basic of deleting files, what about the delete all files except some files, if you want to delete files but not all some fo them you want to keep, let's do it:

first enable the extglob shell option:
```
# shopt -s extglob
```
1. To delete all files in a directory except filename, run this below command:
```shell
$ rm -v !("filename")
```

2. To delete all files with the exception of filename1 and filename2:
```shell
$ rm -v !("filename1"|"filename2") 
```

3. The example below shows how to remove all files other than all .zip files interactively:
```shell
$ rm -i !(*.zip)
```

4. Next, you can delete all files in a directory apart from all .zip and .odt files as follows, while displaying what is being done:
```shell
$ rm -v !(*.zip|*.odt)
```

Once you've done, turn off the extglob shell:
```shell
$ shopt -u extglob
```


There you've it! Thanks for reading my post, let us know what you tink, or find good solution!

my github: https://github.com/lifeeric
How do users remember a product?
Tags: ux, technicalwriting, learnedthroughexperience
Published: 2020-08-22 12:25:13

Here is a quick overview of how a user remembers a product. A product can be a random application, however, the points discussed below implies to all;

1. **Identifying analogous** and **Discrimination**: Products that are similar to the ones a user has used before and different from ones a user has used in the past.

2. **Consistency**: *Consistency* across the entire product ensures quick referencing. Easy navigation, interactive designs, flexibility, and the efficiency of use (Keyboard shortcuts) reinforce the idea of quick referencing. Furthermore, consistency is indispensable between style and UI elements. 

A user never remembers the mismatched UI elements, some elements in UI that create confusion, or weak association and navigation throughout.
The ergonomic backspace
Tags: ergonomics, tech, keyboard
Published: 2020-08-22 12:01:22


TLDR; taken from [orbjet.org](https://www.orbjet.org) changing the useless caps-lock key into something useful - backspace.

The space key is the most used key on every keyboard, regardless of intended usage. Fact.

Probably that’s why it looks like a long kitkat bar, made to be difficult to miss I guess.

The way I see it, wasted space. It’s better to have it split and use the other half as some other command (enter, tab or backspace).

Anyway, back on our track. It’s only natural to think about what’s the next likely used key.As it turns out, and you will probably agree, the next most used key is - backspace.

Having used Colemak as an alternative layout, I got the backspace functionality configured instead of the useless caps-lock. I found this little hack remarkable, so much that I ended up changing my home systems to have the same function. What’s cool about it is that you spare your wrist from the constant twitch in order to correct some wrongly typed key.

And unless you’re a super slow typist or a professional data entry clerk, you’re reaching for that right corner key all the time.

The caps-lock position is ideal for the pinky finger. Before I saw this hack, I used the key as Ctrl. It also eases with the constant usage of copy, cut and paste.

If I got your curiosity running, the easiest way to try this is with autohotkey on Windows and Karabiner on MacOS systems. As for Linux, it depends on different window managers and it would require some web search in order to configure it correctly due to many distros and variants.
Daily Developer Jokes - Saturday, Aug 22, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-08-22 12:00:27

---
title: "Daily Developer Jokes - Saturday, Aug 22, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Saturday%2C%20Aug%2022%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258c00f974.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What does a baby computer call his father?

___A:___ Data!
 -->