teleren/devto huggingface dataset:
How to make a Symbolic Link on Linux
Tags: webdev, tutorial, bash, linux
Published: 2022-06-19 17:06:31

Symbolic links are a link on Linux systems which point another file or folder. It means that navigating to one of these files may run a file that exists somewhere else, or it may bring you to a folder somewhere completely differently, based on how it is defined. For example, a symbolic link called `/etc/link` may be defined to bring you to `/var/www/httpdocs`.


## Types of symbolic links on Linux and Mac

There are two types of symbolic links on Linux systems - **hard links**, and **soft links**.
- Hard links are similar to another name for the same file or directory. They can only exist for files or directories on the same file system.
- Symbolic/Soft links are like shortcuts to files or directories, rather than direct mappings to them. They can point to files or directories on different file systems.

The type of symbolic link you make can affect how other commands work on linux on those files or folders. For example, hard links can be useful if we want to easily delete the reference when using commands like `rm`. 

For many basic uses, a symbolic or soft link works. Let's look at how to create them.

## How to create symbolic links on Linux and Mac

Creating symbolic links on Linux is relatively straightforward. to do it, we use the `ln` command. By default, this command only makes hard links. To create a symbolic or soft link, we use the `-s` command. For example, the below code will make a soft link to `/var/name.txt` from `/etc/name.txt`:

```
ln -s /var/name.txt /etc/name.txt
```

If the file `/etc/name.txt/` already exists, this function will throw an error. Instead, if you still want to make the file, use the `-f` option to overwrite `name.txt`:

```
ln -sf /var/name.txt /etc/name.txt
```

Symbolic links to directories also work in exactly the same way:

```
ln -sf /var /etc/fakevar
```

## Removing symbolic links

If you find yourself needing to remove an already created symbolic link, just use the `unlink` command. For example, in our above code, we linked to `/var/name.txt` from `/etc/name.txt`. To remove this symbolic link, we could write:
```
unlink /etc/name.txt
```

This command will actually remove the symbolic link entirely - so it won't appear in your directory system anymore. So, you can also just simply remove the file using the `rm` command:
```
rm /etc/name.txt
```

## Conclusion

Symbolic links are useful shortcuts to other files or directories. They differ from hard links in that hard links refer directly to the same file, and share the same permissions and owners. Symbolic links on the other hand may differ from the file or folder they link to.
Minio: high-performance multi-Cloud Object Storage
Tags: opensource, elestio, minio, multicloud
Published: 2023-10-11 12:14:50

---
title: Minio: high-performance multi-Cloud Object Storage
published: true
date: 2022-06-19 17:05:56 UTC
tags: opensource, elestio, minio, multicloud
canonical_url: https://elestio.hashnode.dev/minio-high-performance-multi-cloud-object-storage
---

With industry-leading performance and scalability, MinIO can deliver a range of use cases from AI/ML, analytics, backup/restore, and modern web and mobile apps. Its packed with powerful features.

**Update:** since June 2022, MinIO supports all the advanced features like Quota / Versioning / Object locking / Retention in all versions. Its a great achievement and was a long-awaited feature.

### Main benefits

- Cloud agnostic object storage, you can deploy it on any cloud & on-premise
- Modern Web UI with bucket browser, configuration, logs & traces
- Full AWS S3 API compatibility
- Support replication and cluster mode
- Support for IAM policies, quota, versioning, Object Locking, Retention, Lifecycle rules, Notifications, and more.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697005644775/d3a72dbb-cd1f-4754-9e43-fac2c4a223c6.png)

### Use cases

MinIO is a lifesaver if you are in one of those situations:

- You have a software that requires an S3 bucket but you have to deploy it in a specific cloud provider or on-premise
- You need an S3 bucket with very low latency, MinIO can achieve 10x lower latencies than an S3 bucket
- You need buckets for dev/staging/pre-prod quickly and for cheap
- You need a Web UI to manage your buckets / Users / Policies / Replication without calling an API (but you can also do it with the API)
- You need an off-site backup for disaster recovery needs

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697005646832/0c58b4d1-0e31-4be0-90fe-ddf7f5392f14.png)

### MinIO deployment checklist:

- Deploy MinIO instance with Docker
- Configure a reverse proxy to expose your container to internet with SSL/TLS
- Configure a rate limiter to protect your instance and an output cache to optimize performance
- Monitor your instance and configure alerts
- Do upgrades frequently (every week)
- Do OS upgrades frequently (every week)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1697005649345/5b2141b2-282e-4ec3-9dae-ba6667932fa5.png)

If you want automated backups, reverse proxy with SSL termination, DOS protection, firewall, automated OS & Software updates (So your instance of MinIO stays always up to date), and a team of Linux experts and open source enthusiasts to ensure your services are always safe, and functional.

Click on the button below to get a [fully managed instance of MinIO](https://elest.io/open-source/minio?ref=blog.elest.io) ready to use in less than 3 minutes.

_Originally published at_ [_https://blog.elest.io_](https://blog.elest.io/minio-cloud-agnostic-object-storage/) _on June 19, 2022._
How to send events from a child to parent in Svelte
Tags: javascript, svelte, webdev, tutorial
Published: 2022-06-19 17:05:33

[Svelte events](https://fjolt.com/article/svelte-how-events-work) are the way we add interactivity to components in Svelte. A common issue with Svelte events is adding **arguments** to functions called within them. For example, suppose we have a basic counter, which increases any time the user clicks on it:

```html
<script>
    // we write export let to say that this is a property
    // that means we can change it later!
    let x = 0;
    const addToCounter = function() {
        ++x;
    }
</script>

<button id="counter" on:click={addToCounter}>{x}</button>
```

This works fine, but let's say we want to change it so that we increase the counter by a certain amount whenever it is clicked. We might try changing the code to something like this:
```html
<script>
    // we write export let to say that this is a property
    // that means we can change it later!
    let x = 0;
    const addToCounter = function(amount) {
        x += amount;
    }
</script>

<button id="counter" on:click={addToCounter(5)}>{x}</button>
```

**But this WONT work** - instead we need to change our event to contain a function instead. To add arguments to our `addToCounter` function, we have to do something like this instead:

```html
<button id="counter" on:click={() => addToCounter(5)}>{x}</button>
```

Here, we call a function, which returns the value produced by `addToCounter`. This also works for events, so if you want to pass the event or `e` object to your function, you could do something like this:
```html
<button id="counter" on:click={(e) => addToCounter(e)}>{x}</button>
```
Deployee Angular 13 on Node server
Tags: angular, node, webdev, javascript
Published: 2022-06-19 17:05:19

Hey everyone i am a beginner in angular, recently i created a angular application and i want to deployee it into a node server, so the deployment the steps i followed-

- done production build with ng build
the created a node server.js file on the same dir with express and added the following code

```
const express = require('express')
const app = express()
const port = 3000
app.use('/',express.static("dist/my-app"));
app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})
```
but i am getting 404 errors for all the js files. Please suggest me where am i doing wrong.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hulqr394kx0y0oeqxx95.png)
Calling all software engineers! 📣
Tags: career, productivity, news, help
Published: 2022-06-19 17:04:23

Come learn what it’s like to work at Capgemini Engineering and [Lohika](https://community.lohika.com/public/learn). Hear from Capgemini Engineering developers while enjoying food & beverages.

The event takes place in Zapopan, Jalisco (Mexico). 
Request an invite via https://www.lohika.com/happy-engineering-hour-2022
Introduction To Data Structures and Algorithms
Tags: dsa, python
Published: 2022-06-19 13:43:18

Scary topic huh! Well not really. Like every problem, to understand it, we divide it into sub-sections and combine what we've gathered.
**Data** - Data can be defined as facts or figures, or information that's stored in or used by a computer.

**Structures** - A structure is used to represent information about something more complicated than a single number, character, or Boolean can do.

Therefore **data structures** are a way of collecting and organizing data in such a way that we can perform operations on data. Example: Linked list, Graphs, Tree.

## Types of Data Structures
1. Linear Data Structures - Items are arranged in a sequence. Example: Array
2. Non-linear - Data items are not arranged in a sequence. Example: Tree, Graph
3. Dynamic - It expands or shrinks depending on the program requirements
4. Static - Are those whose size and structures associated memory locations are fixed.

**Algorithms** - They are a set of instructions(finite or logical) that are used to solve a problem
Algorithms are said to be efficient and fast when they take less time to execute and consume less memory.

## Properties of an Algorithm 

- Input
- Output
- Finiteness
- Definiteness
- Correctness

An algorithm generally requires the following components:

- _Instruction Space_: A space to store the the executable version of the program.
- _Data Space_: Space required to store the constants and variables.
- _Environment Space_: Stores the environment information.
Data Structures and Algorithms come in handy in problem solving.

A **problem** can be described as something that has an initial state, goal state and the number of steps taken to achieve from the initial to goal state.
Think of cooking as the problem we are trying to solve, an algorithm would be identifying the ingredients, cutlery, heating equipment.

We can't talk about Algorithms and avoid the topic on Time and Space complexity. 

1. **Time complexity** is the amount of time a program requires to execute until completion.
2. **Space Complexity** is the amount of memory space required by the program during execution.
How to convert a String to a Number in TypeScript
Tags: typescript, javascript, webdev, tutorial
Published: 2022-06-19 17:03:26

TypeScript is a strongly typed language, which means we have to give things a little more thought when converting between them. Fortunately, converting a string to a number is pretty easy in TypeScript.

## Converting a String to a Number in TypeScript
If we're using integers, the easiest way to convert a string into a number is to simply use the unary (`+`) operator. Here is an example using a simple integer:
```typescript
let someString:string = "4245"
let myNumber:number = +someString;

// Returns 4246
console.log(myNumber + 1);
```

We can also just use or `parseInt` for number-like integer strings:
```typescript
let someString:string = "4245"
let myNumber:number = parseInt(someString);

// Returns 4246
console.log(myNumber + 1);
```

### Converting Decimals
Unfortunately this method won't work very well for decimals, as `+` and `parseInt` deal only with integers. If we want to convert a decimal-like string to a number in TypeScript, we can use `parseFloat`, just like normal Javascript:
```typescript
let someString:string = "4245.1234"
let myNumber:number = parseFloat(someString);

// Returns 4246.1234
console.log(myNumber + 1);
```

### Number function
We can also use the `Number` function to convert number-like strings into numbers. This will work with both integers and decimals:
```typescript
let someString:string = "4245"
let myNumber:number = Number(someString);

// Returns 4246.1234
console.log(myNumber + 1);
```
5 Hard Truths about Engineering leadership
Tags: career, leadership, webdev, productivity
Published: 2022-06-19 17:00:35

Overall, becoming an engineer leader is great. All routes to seniority lead away from programming. But, once you make it up that ladder, based on hard work and your [engineering excellence](https://community.lohika.com/home/videos/what-engineering-leaders-should-be-focused-on-in-2022-2022-04-28), did you ever think you might not be as prepared to lead as you’d like?

1. - One of your most important talents as a leader will be delegating. You must know who is capable of doing what and who is willing to take on additional responsibility. People must be pushed without being drowned. If you can delegate everything, you'll be ready to take on greater responsibilities in the future.

2. - Big Tech does a superb job at putting together teams. The two-pizza team is the most effective. Take the model and use it.  It is not always a  good idea to experiment with organizational structures. 

3. - When it comes to managing engineers, what can non-technical leaders do? Many developers find it difficult to report to non-technical bosses. It's why, with a few exceptions for CEOs, all Engineering Managers in Tech-Driven companies are examined for technical skills during interviews. As soon as possible, place qualified technical individuals in the middle between them and the teams. If this will take time, promote and assign tech leads to be your right hand in the short term, and then pay attention to them.

4. - Engineers have a problem with empathy at times. Just because they've worked as an engineer before doesn't mean they're qualified to manage people's careers. People who lack empathy should not manage engineers, just as non-technical MBAs should not manage engineers. No amount of Management training can teach you to care about people. You have to find it in yourself. 

5. - Don't juggle the roles of Engineering Manager and Senior IC! Performing both jobs for an extended period of time is a bad idea. It will stifle your growth in the long run.. You're not going to get very good at either of these things. It's also a disservice to your employees, product, and clients.
6. - Corporations have a pressing need for trans-formative leaders who drive innovation in today’s complex, rapidly evolving global markets. This is true of many technical disciplines but incredibly true for software engineering. To become one of these highly prized leaders, technical professionals must transcend their silos and broaden their perspectives.

Leverage the expertise of peers and mentors. Search through and save resources interesting to you through a safe space for engineering leaders to connect and learn. Join [Lohika <ReThink>](https://community.lohika.com/public/learn) Community curated to bring together Engineering leaders  to share insights, explore trends, attend events, and [empower leadership and career growth.](https://community.lohika.com/home/blogs/growth-resilience-and-the-power-of-creative-possibility-2022-04-28)
Blogbeat - Our Motivation in a Nutshell
Tags: blogbeat
Published: 2022-06-19 16:53:00

**Blogbeat is a blog platform helping you to publish high-quality articles and to grow your audience fast. Our mission is to bring back valuable content and encourage people to share their knowledge.**

**Blogbeat is now open for public beta access. Join now.**



### Publish high-quality articles, share knowledge and build an audience

While most of us increased our social media consumption on a daily basis during the last decade, the quality of content on social media platforms deacreased. Nethertheless there is still tons of good content out there, but nowadays harder to find through all the noise.

Therefore Blogbeat is comitting to help everyone who wants to publish high-quality articles, share their knowledge and seeking to build an audience.

So far our journey has been amazing. We finished our core blog engine and established connections to LinkedIn, Facebook, Twitter, Medium and dev.to with our core beat engine.

Blobeat is now open for public beta access. Join now and send your feedback to support@blogbeat.app.
CSS: Wallet
Tags: css, programming, html, webdev
Published: 2022-06-19 16:22:16


![Wallet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xxtglg7odaeqspa37us3.png)

```html
<div class="wallet">
    <div class="rectangle">
      <div class="rectangle__front"></div>
      <div class="closure"></div>
    </div>

    <div class="card">
      <div></div>
      <div></div>
    </div>
  </div>
```
```scss
.wallet {
  --width: 400px;
  position: relative;
}

.rectangle {
  width: var(--width);
  height: calc(var(--width) * 0.72);
  position: relative;
  background-color: hsl(63, 74%, 35%);
  border-radius: calc(var(--width) * 0.06);
  z-index: 1;

  &__front {
    width: calc(var(--width) * 0.92);
    height: calc(var(--width) * 0.72);
    position: absolute;
    right: 0;
    background-color: hsl(62, 65%, 43%);
    border-radius: calc(var(--width) * 0.06);
    overflow: hidden;

    &::after {
      content: "";
      width: 100%;
      height: 100%;
      position: absolute;
      clip-path: polygon(100% 0, 0 100%, 100% 100%);
      background-color: hsla(0, 0%, 0%, 0.035);
    }
  }
}

.closure {
  width: calc(var(--width) * 0.4);
  height: calc(var(--width) * 0.26);
  position: absolute;
  left: calc(var(--width) * -0.04);
  top: 50%;
  transform: translateY(-50%);
  background-color: lighten(hsl(62, 65%, 43%), 8%);
  border-radius: calc(var(--width) * 0.12) calc(var(--width) * 0.6)
    calc(var(--width) * 0.6) calc(var(--width) * 0.12);
  overflow: hidden;
  box-shadow: 8px 8px 22px -10px hsla(0, 0%, 0%, 0.2);

  &::after {
    content: "";
    width: 100%;
    height: 50%;
    position: absolute;
    bottom: 0;
    background-color: hsla(0, 0%, 0%, 0.035);
  }

  &::before {
    content: "";
    width: calc(var(--width) * 0.12);
    height: calc(var(--width) * 0.12);
    position: absolute;
    right: calc(var(--width) * 0.06);
    top: 50%;
    transform: translateY(-50%);
    background-color: hsl(0, 0%, 100%);
    border-radius: 100rem;
  }
}

.card {
  width: calc(var(--width) * 0.72);
  height: calc(var(--width) * 0.4);
  position: absolute;
  top: calc(var(--width) * -0.18);
  left: calc(var(--width) * 0.06);
  background-color: hsl(0, 0%, 45%);
  border-radius: calc(var(--width) * 0.04);
  transform: rotate(-12deg);
  overflow: hidden;

  &::after {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: hsla(0, 0%, 0%, 0.035);
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
  }

  div {
    height: calc(var(--width) * 0.12);
    width: calc(var(--width) * 0.12);
    position: absolute;
    right: calc(var(--width) * 0.04);
    border-radius: calc(var(--width) * 0.04);

    &:first-child {
      top: calc(var(--width) * 0.04);
      background-color: hsl(41, 97%, 55%);
    }

    &:last-child {
      top: calc(var(--width) * 0.2);
      background-color: hsl(0, 0%, 100%);
    }
  }
}
```
Mixins with generics in Typescript
Tags: typescript, tutorial, react
Published: 2022-06-19 15:41:44

I spend 10h trying to find a solution!
I hope it will help someone

## Problem

I have a class with generic type. After wrapping it with a mixin I lost the possibility to define the type

```ts
type Data = { id: string } & Record<string, any>

class Store<TData extends Data> {
  constructor(data: TData) {
    super(idKey)
    this.data = data
  }

  getData(): TData {
    return this.data
  }
}
```

This is how I wrote my mixin at first

```ts 
type AnyConstructor<A = object> = new (...input: any[]) => A

const Updatable = <T extends AnyConstructor<Store<Data>>>(
  base: T
) => {
  // @ts-expect-error https://github.com/microsoft/TypeScript/issues/37142
  return class StoreUpdatable<TData extends Data> extends base {
    private _listeners: ((arg: this) => void)[]

    constructor(data: StoreData<TData>) {
      super(data)
      this._listeners = []
    }

    update() {
      this._listeners.forEach((fn) => fn(this))
    }
    addUpdateListener(fn: (arg: this) => void) {
      this._listeners.push(fn)
    }
  }
}

```

As you can see I mistakenly define type `Item` at the initialization but I need somehow to pass generic

##  Solution

```ts
const Updatable = <TData extends Data, T extends AnyConstructor<Store<TData>>>(
  base: T
) => {
  // @ts-expect-error https://github.com/microsoft/TypeScript/issues/37142
  class StoreUpdatable extends base {
    private _listeners: ((arg: this) => void)[]

    constructor(data: StoreData<TData>) {
      super(data)
      this._listeners = []
    }

    update() {
      this._listeners.forEach((fn) => fn(this))
    }
    addUpdateListener(fn: (arg: this) => void) {
      this._listeners.push(fn)
    }
  }

  return StoreUpdatable as AnyConstructor<StoreUpdatable> 
   & typeof StoreUpdatable & T
}
```
Swap Two Variables Value Without Temp Variable in PHP
Tags: php
Published: 2023-01-12 14:26:55

---
title: Swap Two Variables Value Without Temp Variable in PHP
published: true
date: 2022-06-19 15:41:00 UTC
tags: 
- PHP
canonical_url: https://fajarwz.com/blog/swap-two-variables-value-without-temp-variable-in-php/
---
![Swap things illustration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtpk5kxof6k9lk6wb1i7.png)

Maybe you find a real world project situation that you think maybe it’s good for you to know how to swap two variables without temporary variable for example for clean coding. Or maybe you are just trying to solve some kind of online coding test that force you to trying to do swap between two variables without third variable.

Is there a PHP function for doing that rather than having to create third variable for such a simple task?

## PHP Array Destructuring

Meet this array destructuring syntax. Available since PHP 7.1.

```php
[$a, $b] = [$b, $a];
```

An example with output 

```php
<?php

$a = 'foo';
$b = 'bar';

echo "Original value: $a, $b\n"; // Original value: foo, bar

[$a, $b] = [$b, $a];

echo "Result value: $a, $b\n"; // Result value: bar, foo
```

That's it. I hope it helpful.

## Conclusions
What you need for swapping variable without temp variable in PHP is array destructuring. I think it looks cleaner. 

Any thought on this approach? Please let me know in the comments section below. Thank you.

## References
[Is there a PHP function for swapping the values of two variables? | Stackoverflow | Answer by Pawel Dubiel](https://stackoverflow.com/a/39692850)
NolybabJS - i18n-to-csv and csv-to-i18n converter
Tags: showdev, webdev, tooling, javascript
Published: 2022-06-19 15:39:56

After many frontend projects that I've worked with and tackled with the same problem - manually convert i18n json files into csv or manually creating keys for each language with the given translation, I've finally decided to create an open source library that will do it for me and save me (and maybe you) some time.

### NolybabJS
Nolybab is a CLI based i18n-to-csv and csv-to-i18n converter, you can easily convert your i18n json files into csv, and send it to your translators and when they finish to translate and send you the csv back - just convert it back to i18n files.

#### More info and examples can be found in the README file in the Github repository - [nolybab-js](https://github.com/fima-taf/nolybab-js)

I would very much appreciate any kind of feedbacks or ideas that can improve this library.
And of-course contribution is always welcome :)