teleren/devto huggingface dataset:
❮ ZI Annex - LinkBin ❯
Tags: zsh, tooling, hacktoberfest, contributorswanted
Published: 2022-04-09 15:57:45

<table style="align:center;width:100%;height:auto">
<tr><td align="center">
<h1><h3 align="center">
<a href="https://github.com/z-shell.png"><img src="https://github.com/z-shell.png" />
</a>❮ ZI ❯ Annex - <a href="https://github.com/z-shell/z-a-linkbin">LinkBin</a>
</h1><hr /><h2 align="center">Run programs and scripts without adding anything to <code>$PATH</code> via the automated <b>links</b> to <code>$ZPFX/bin</code>
</h2>
<hr />
<img align="center" src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dytilfp4nd285q0zzva0.png" alt="eval preview" />
</td></tr></table>
<div align="center">

[z.digitalclouds.dev](https://z.digitalclouds.dev) | [GitHub](https://github.com/z-shell/) | [Discussions](https://github.com/orgs/z-shell/discussions/) | [Localize](https://crowdin.digitalclouds.dev)

</div>

---

## Install

```shell
zi light z-shell/z-a-linkbin
```

---

## 💡 Wiki

- [annexes](https://z.digitalclouds.dev/docs/ecosystem/annexes)

---

## How it works

Exposing a binary program without modifying `$PATH` – `z-a-linkbin` will automatically create a hard or soft link to the binary in `$ZPFX/bin` exposing the program to the command line as if it were being placed in `$PATH`.

The command can then be accessed normally – not only in the live Zsh session, but also from any Zsh script.

The ice-modifier `lbin''` provided by the annex creates `links` for binaries and scripts.

It creates the `link` that calls the actual binary.
The link is created always under the same, standard and single `$PATH` entry: `$ZPFX/bin`

> The optional preceding `!` flag means create a soft link instead of a hard link.

Example:

```shell
zi ice from'gh-r' lbin'!fzf'
zi load junegunn/fzf
```

Check the output:

```shell
ls -l $ZPFX/bin/ | awk '{print $(NF-2),$(NF-1),$NF}'
fzf --version
```

**The ice can contain globs**. It will expand these when searching for the binary.

Example:

```shell
zi ice from'gh-r' lbin'**fzf -> myfzf'
zi load junegunn/fzf
```

Check the output:

```shell
ls $ZPFX/bin
myfzf --version
```

**The ice can be empty**. It will then try to create the link:

- trailing component of the `id_as` ice, e.g.: `id_as'exts/git-my'` → it will check if a file `git-my` exists and if yes, create the link `git-my`,
- the plugin name, e.g.: for `paulirish/git-open` it'll check if a file `git-open` exists and if yes, create the link `git-open`,
- trailing component of the snippet URL,
- for any alphabetically first executable file.

> Above also applies if just `!` were passed.

---

> This repository compatible with [ZI](https://github.com/z-shell/zi).

---

Have the best and leave the rest!
Git Switch
Tags: git, webdev, beginners, programming
Published: 2022-04-09 15:47:46

Another unknown command, but with a disclaimer

> THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

## How do I used to switch branch

`// switch to existing branch`
**$ git checkout \<existing_branch\>**
`// create and switch to new branch`
**$ git checkout -b \<new_branch\>**


## How I have started switching branch now

`// switch to existing branch`
**$ git switch \<existing_branch\>**
`// create and switch to new branch`
**$ git switch -c \<new_branch\>**




All `git switch` options

```
git switch [<options>] [--no-guess] <branch>
git switch [<options>] --detach [<start-point>]
git switch [<options>] (-c|-C) <new-branch> [<start-point>]
git switch [<options>] --orphan <new-branch>

```

[Read More](https://git-scm.com/docs/git-switch)


Kumar Nitesh
How to Write Quality Guest Posts?
Tags: webdev, blogging, discuss
Published: 2022-04-09 15:46:18

In this post we'll talk about how to write quality guest posts. You'll get more users to your site if they're written very well with interesting content that interests the readers.

But for that you have to follow these 10 tips for writting quality guest posts

1. Always write unique content.

2. Use your own images, or at least properly attribute if you use someone else's.

3. Make sure your post is long enough to be useful, but not so long that it's boring. We don't want to write a novel here—just be helpful!

4. Use internal links in the body of your post to point readers to other relevant posts on our blog.

5. Don't forget to include a call-to-action in your post!

6. Your post should educate and inform, but also entertain, as well as inspire action from the reader.

7. If someone doesn't know anything about the topic you're writing on, they should be able to read your post and understand it fully by the end of it.

8. Keep it concise, concise, concise—your words should be clear and easy for people to understand without making them feel like they're reading a textbook (unless you are writing on a very technical topic).

9. Make sure that any information provided is accurate! This includes spelling words correctly; grammar is also important too! Just do your best :).

10. Please do not copy/paste other people’s work without giving them credit

If you find these posts "[How to write quality guest posts](https://www.blogtriggers.com/2022/04/10-proven-ways-to-write-quality-guest.html)" useful then please share it to your friends that they will also know what this we have to include before writing guest posts.
An Organized List of Over 700 Educational C++ Videos
Tags: cpp, programming, list
Published: 2022-04-09 15:45:19

I've recently started a [list of educational C++ videos](https://hackingcpp.com/cpp/educational_videos.html) like conference talks by world-renowned experts, video tutorials, and other explanatory videos related to C++. 

The list currently contains links to over 700 videos including almost all episodes of Jason Turner's "C++ Weekly" series.

All videos are hierarchically organized by topic (using foldable sections) but one can also use the alphabetic index to quickly find a section by keyword.

This is only the first version, there's already more than 300 additional videos in the queue and I also might add a "search by tag" feature in the future.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgxfrpjejxzeqxcp46zp.png)
Tips to optimize database queries - Laravel
Tags: laravel, php, webdev, database
Published: 2022-04-09 15:22:23

I wanted to share this very cool article about some tips to optimize Laravel database queries which when taken into account will make your project more organized and faster in dealing with databases so I hope it helps you.

- https://dudi.dev/optimize-laravel-database-queries

I hope you enjoyed with me and I adore you who search for everything new.
CSS Variables: Quick guide
Tags: css, javascript, beginners, tutorial
Published: 2022-04-09 15:17:29

> Even though CSS Variables aka Custom Properties have been more than usable for 3-4 years now, not everyone knows about them or uses them.

> They are a great addition to CSS. One of the best since CSS 3. A lot of new features are coming and are announcing a great time for CSS again!

> I will write a short series about them and we will go deeper into their use.

---


## How do they work?

![Declaration of CSS Variables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6zqz5yi9ewgdjilzn4o8.png)

Looking at this picture, you will notice 3 things:

### Top level / Root level
CSS Variables are declared at root level. It's not an obligation and we are going to explore it but it became the standard approach.

```css
:root {
 --main-bg-color: grey;
 --font-family: 'Overpass', sans-serif;
 --font-medium: 16px;
}
```

### How to declare and use them
We declare them with double hyphen `--` and a name as we would do in a `SASS` variable :
`--main-bg-color` vs `$main-bg-color`

You add a value to them. Could be font-family, font-size, spacings, url images, ...

```css
--name: value;
```

## The use of the `var()` function
To read them, we will use the `var()` function and add two things:
- The first one is the variable itself 

```css
var(--main-bg-color)
```

- The second one is a default value if the variable is not defined:

```css
var(--main-bg-color, lightgrey)
```

If `--main-bg-color` doesn't exist, the color by default will be `lightgrey`

---

## What are the benefits of using them?

✅ They are easy to write, to use and to maintain. They are reusable in all your CSS files. Super useful when working with components and shared properties/values. 

🚀 They can be changed at local scope. I will cover it in the next article, be there!

⚙️ They are accessible at runtime. You can change one variable in your browser to see how it affects your design. Impossible with build time preprocessors. And are accessible by JavaScript: we can create them with JavaScript, use them or change them.

🔲 🔳 When working with dark/light mode or multiple themes in CSS, they are perfect. I will add an example and comparing with the use of SASS variables. Be there too 😉
Kubernetes Namespaces & Kubens
Tags: kubernetes, docker
Published: 2022-04-09 15:11:11

Kubernetes namespace helps to logically group your resources as multiple teams work on a single cluster. However using kubectl to switch between namespaces can be a bit annoying. kubens is a great productive tool which makes it easy to manage namespaces.

More details on this [link](http://belowthemalt.com/2022/04/09/kubernetes-namespaces/)
Control program flow with if statement in shell scripting
Tags: shellscripting, bash, beginners
Published: 2022-04-09 15:10:11

In the last post, we learned about tests in shell scripting.

{%embed https://dev.to/twinklelahariya/variables-and-tests-in-shell-scripting-2k81 %}

In this post, let's see how we can use them with if statement to control the flow of the script.

###What is `if` statement?

If statement allows us to make decisions in our script. It starts with the keyword `if` followed by a test expression, `then` list of commands followed by the closing `fi` keyword.

A basic `if` statement says that **if** the test expression is **true**, then perform the following commands. 

*Syntax*

```
if []
then
    command 1
    command 2
    .
    .
    command n
fi
```

Let's understand `if` with an example where we check if a given number is greater than 10.
```
#!/bin/bash

VAR=20
if [ $VAR -gt 10 ]
then
    echo "Variable is greater than 10"
fi
```
Output:
```
> ./IfDemo.sh
Variable is greater than 10
```

Let's see what we have done here:

`if [ $VAR -gt 10 ]` : `if` followed by a test condition `$VAR -gt 10`
`$VAR -gt 10` : returns true if the var is greater (`-gt`) than 10
`then` : if the condition is true, then execute the following commands
`fi` : end of `if` statement

What if you want to log both the scenarios, i.e. if the number is greater than 10 and then the number is less than 10.

###If..else statement

If-else statement follows the following form:

*Syntax*

```
if []
then
    command 1
else 
    command 2
fi
```
If-else tells that **if** the test is **true**, then run **command 1**, **else** run **command 2**.

Let's extend the same example of a number greater than 10 and print a message if the number is not.
```
#!/bin/bash

VAR=5
if [ $VAR -gt 10 ]
then
    echo "Variable is greater than 10"
else 
    echo "Variable is less than 10"
fi
```
Output:
```
> ./IfDemo.sh

Variable is less than 10
```

Now, if we want to check the second test condition if the first one fails and handle it differently, then we use `if-elif-else` ladder.

###If..elif..else statement

Let's check if the number is greater than 10, then print 'greater than'. Else, if the number is equals 10, print 'equals to', else print 'less than'.

```
#!/bin/bash

VAR=5
if [ $VAR -gt 10 ]
then
    echo "Variable is greater than 10"
elif [ $VAR -eq 10]
    echo "Variable is equals to 10"
else 
    echo "Variable is less than 10"
fi
```
Output:
```
> ./IfDemo.sh
Variable is equals to 10
```

There is more to if statements. To list some of the scenarios:

1: Nested if statements:
```
if [[ Test condition ]]
then
  if [[ Test condition ]]
  then
    command 1
  else
    command 2
  fi
fi
```

2: Multiple test conditions
```
if [[ Test condition ]] && [[ Test condition ]]
then
  command 1
elif [[ Test condition ]] || [[ Test condition ]]
then
  command 2
else
  command 3
fi
```

Cool, I'll go now and try these scenarios out, do let me know if you try them and have any questions about it.

Up next is loops in shell scripting. Stay tuned.

Until next time. Love ❤️
JAVASCRIPT EVENT AND THE MAGIC OF IT IN THE WEB BROWSER
Tags: beginners
Published: 2022-04-09 14:49:00

This article is primarily written with the beginners in javascript in mind.
As a beginner, we often wondered and are curious as to how a button or text will be clicked and something will change in the UI(user interface). It usually confusing at the beginning of our journey and not so simple to grasp the concept of how every event is been linked together to affect the browser UI and the DOM (Document Object Model).
Let's get started with what event is in javascript.

Client-side JavaScript programs are almost universally event-driven: rather than running some kind of predetermined computation, they typically wait for the user to do something and then respond to the user’s actions. The web browser generates an event when the user presses a key on the keyboard, moves the mouse, clicks a mouse button, or touches a touchscreen device. Event-driven JavaScript programs register callback functions for specified types of events in specified contexts, and the web browser invokes those functions whenever the specified events occur. These callback functions are called event handlers or event listeners, and they are registered with addEventListener():

we will be demonstrating two of the above-mentioned event, namely, click and keyup.

HTML
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/coh6dcq1loos4bhmvdjy.png)

CLICK EVENT

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr8g04lktmjg0h0c1pt7.png)

KEYUP


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/psjaljdoz2c94y1inetx.png)

RESULT


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgvy6tdey8idpoq7cxjj.png)

Thank you for reading!
Paracetamol.js💊| #97: Explica este código JavaScript
Tags: javascript, spanish, webdev, beginners
Published: 2022-04-09 14:46:22

## **<center>Explica este código JavaScript</center>**

```js
const toBolean = x => Boolean(x);

console.log(toBolean(37));
console.log(toBolean(0/0));
console.log(toBolean(0));
console.log(toBolean({}));
console.log(toBolean(Symbol("Soy un symbol")));
```

A. `true`, `false`, `false`, `true`, `true`
B. `false`, `false`, `true`, `true`, `false`
C. `true`, `true`, `false`, `false`, `false`
D. `false`, `ReferenceError`, `false`, `false`, `true`

Respuesta en el primer comentario.

---
The Defensive Code Reviews
Tags: webdev, productivity, development, codequality
Published: 2022-04-09 14:27:34

---
title: The Defensive Code Reviews
published: true
description: The reviews would come in. I read them. I got angry. How dare anyone question "MY CODE?"
tags: WebDev, Productivity, Development, CodeQuality
series: Code Review
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvxkt270iwrz8dlhx6x1.png
---

I refer to the code I write as "MY CODE."

In reality, it's my client's code the majority of the time.

## The Problem

In the past, this caused issues when I would push up a Pull-Request and ask for a Code Review.

The reviews would come in.

I read them.

I got angry.

How dare anyone question "MY CODE?"

I got defensive and struggled to see the need for someone to look over the great code I was writing.

## The Issue

The issue was that it wasn't my code.

The issue was that it wasn't always great code.

## The Situation

The code I wrote was for the client. The Code Reviews were made to improve the code I wrote.

The only difference here was my perspective.

The reviews hadn't changed.

The reviews were never an attack on my code, any by extension me.

They were only meant to help me: improve my code, see other perspectives, and grow as a developer.

## The Code Review

Considering the subject of code review itself (the code), there are two conceptual levels at play.

A code review has important human ramifications. People learn and share knowledge through the review process. And they use it to prevent the kind of defects that result in frustration for the team. Developers get emotionally invested in their creations (we own the code we write).

A good code review process helps with code quality and helps developers learn. It is the most effective defect prevention method. This put a good code review ahead of even automated unit tests.

## Conclusion

I find that maintaining this balance of code ownership to be a challenge that comes back to visit me now and then.

When I first started and had my first code reviews it was much more challenging. I often find myself working with other developers to ensure that they understand my intent to help them learn and grow throughout this process.
Installing Oracle DB 11g on linux using Docker
Published: 2022-03-28 15:33:21

Oracle DB is one of the most popular Database Software

Here I am going to show how to install Oracle DB 11g an older but easy to use version on linux in a docker container.

### 1. Setup Docker
So first let's install docker:-

debian based systems
`sudo apt install docker.io`

arch based systems:-
`sudo pacman -S docker`

Now it's time to start with it

You need add current user to docker group
`sudo usermod -aG docker $USER`

then reboot or relogin your mechine or run
`newgrp docker`

### 2. Add swap space
now you need to have enough swap space for installing oracle DB.
Minimum 2GiB is required.
But it will be better to add swap space equel to total ram of the mechine.
(_If you already have swap space added you can skip to Oracle Linux Installation_)

create a swap file
`sudo fallocate -l 4G /swapfile`

set permissions 
`sudo chmod 600 /swapfile`

set swap area and activate
`sudo mkswap /swapfile`
`sudo swapon /swapfile`

swap space will be deactivate on reboot.
to actvate automatically on reboot add
> `/swapfile swap swap defaults 0 0`

this line to `/etc/fstab`
using editor or by
`sudo nano /etc/fstab`


now to verify swap added successfully run
`sudo swapon --show`

### 3. Install or add oracle db to docker
To pull oracle db image from docker repo and run it 
`docker run -d oracleinanutshell/oracle-xe-11g`

But you need to expose necessary ports.
Default port for Express WebApp is `8080` and Database will run on `1521` (_you can change it while installing_)

so now stop and delete the docker container using
`docker stop <container-id>` then
`docker rm <container-id>`
(container id will be printed on terminal while running docker)

so final command with open port will be
`docker run -d -p 1521:1521 -p 8080:8080 oracleinanutshell/oracle-xe-11g`

now if you want to restart the server (docker container on restart) then instead of above command you need to run
`docker run -d --restart unless-stopped -p 1521:1521 -p 8080:8080 oracleinanutshell/oracle-xe-11g`

and to manually start the container run
`docker start <container-id>`
Easily enforce git branch naming conventions
Tags: git, githooks
Published: 2022-04-09 14:03:45

In many software development projects there is often some kind of branch naming conventions the developers follow. What if not all developers follow the naming rules? This has been a recurring problem at my work. I came up with a solution that was the easiest to implement.

I created a githooks script that will run right before the `git push` command. For the script to automatically run, a new .githooks folder needs to be created in the Git repository's root folder. Git needs to know it exists so run `git config core.hooksPath .githooks` while in the repository root folder. The script needs to be named `pre-push` with no file extension.

My githooks script is set up so if the git branch being pushed doesn't start with certain words and contains more than 10 characters, an error message is thrown and the push doesn't occur. 

Here is the script and [GitHub Gist link](https://gist.github.com/mdailey77/fd6ba0121854c511395607ac902f330e).
```
#!/usr/bin/env bash
LC_ALL=C

local_branch="$(git rev-parse --abbrev-ref HEAD)"

valid_branch_regex="^(task|master|develop|qa|tb|bug|story)[a-z0-9._-]{2,10}$"

message="This branch violates the branch naming rules. Please rename your branch."

if [[ ! $local_branch =~ $valid_branch_regex ]]
then
    echo "$message"
    exit 1
fi

exit 0
```
Die 11 besten Divi WooCommerce Themes und Templates
Tags: wordpress, divi, elegantthemes, woocommerce
Published: 2022-04-09 15:41:15

---
title: Die 11 besten Divi WooCommerce Themes und Templates
published: true
date: 2022-04-09 13:59:28 UTC
tags: WordPress,divi,ElegantThemes,WooCommerce
canonical_url: https://bloggerpilot.com/divi-woocommerce-themes/
---

![Die 11 besten Divi WooCommerce Themes und Templates](https://bloggerpilot.com/wp-content/uploads/2022/04/divi-wocommerce-themes.png)

Ein Divi-Theme für deinen Online-Shop zu finden, erfordert ein bisschen Arbeit, und das kann Stunden dauern. Zum Glück haben wir die harte Arbeit für dich erledigt. Wir haben uns durch Hunderte von schönen Vorlagen gewühlt und die 10 besten Divi WooCommerce-Themes für deinen Onlineshop 2019 ausgewählt.

Der Original-Artikel erschien auf [Die 11 besten Divi WooCommerce Themes und Templates](https://bloggerpilot.com/divi-woocommerce-themes/).

Divi ist schnell. Es ist schnell. Das ist das Einzige, was an Divi wichtig ist. Divi ist sehr schnell. Es ist schnell, schnell und schnell. Es ist blitzschnell. Es ist das Schnellste, was du je gesehen hast. Es ist blitzschnell. Blitzschnell. Das schnellste Ding, das du je gesehen hast. Es ist blitzschnell. Die Grafik ist blitzschnell. Es ist das Schnellste, was du je gesehen hast. Es ist schnell wie der Blitz.

Als Inhaber eines E-Commerce-Unternehmens willst du sicherstellen, dass du deine Besucher in zahlende Kunden verwandelst. Du kannst die Konversionsrate deiner Website, also die Anzahl der Besucher, die einen Kauf abschließen, erhöhen, indem du ein paar Änderungen an deiner Website vornimmst, z. B. indem du mehr hochwertige, relevante Bilder verwendest.

Zusammenfassend lässt sich sagen, dass Divi vielleicht das beste [E-Commerce-Theme](https://www.scoop.it/topic/marketing-by-j0e/p/4131467461/2022/04/09/die-11-besten-divi-woocommerce-themes-und-templates-2022) auf dem Markt ist. Es ist responsive und mobilfähig, d. h. es sieht in jedem Browser und auf jedem Gerät gut aus. Außerdem ist es voll von wunderbaren, subtilen Designmerkmalen, wie z. B. Bannern, die animiert werden, wenn du auf deiner Seite nach unten scrollst.

Divi ist WooCommerce-fähig und wird mit Dutzenden kostenloser, professioneller Child-Themes geliefert, mit denen du dein Theme genau an deine Bedürfnisse anpassen kannst. Divi ist ebenso anpassbar wie schön und bietet alles, was du brauchst, um einen beeindruckenden Shop zu erstellen.