teleren/devto huggingface dataset:
CMD tricks 
Tags: tutorial, beginners
Published: 2022-01-04 04:26:41

**_Well here are some cool and good tricks of cmd ( command prompt )

1.`md aux\` --- it will create a folder that can't be copy nor deleted
2.`attrib -h -s  -r` (folder u want to unhide)----------- this will unhide the folder 
3.`attrib +h +s +r` (folder u want to hide)----------- this will hide the folder reload it
4.`shutdown /s` ----------- it will shut down the computer
5.`shutdown /l` ----------- it will log off the computer
6.`shutdown /r` ----------- it will restart  the computer
7.`shutdown /s /t` (no. of seconds) /c "(Msg u want pop out  before the shut down )"--------- it will shutdown the pc after the seconds are over and display the msg u have written 
8.`shutdown /s /t` (no. of seconds) --------- it will shutdown the pc after the seconds are over 
9.`color help` ------- it will show the color code
10.`color`   (background code)(font code ) -------it will customize the cmd by codes eg color help 42 (it changes the background to red and font to green)
11.****prompt (name u want change )$G ---- it will change the prompt
title (whateve u wnat ) ----- it will chane the title _**
Self-Taught Developer Journal, Day 30: TOP JavaScript Fundamentals Part 3 - Functions
Tags: webdev, beginners, codenewbie, devjournal
Published: 2022-01-04 04:04:07

Today I learned...
 
## Function Declaration
A function declaration uses the function keyword and name of the function.

    function calculateAge(birthYear) {
      return 2022 - birthYear;
    }

*"Note: This form is always hoisted, so you can call function before function definition and it will work fine."*

## Anonymous Functions or Function Expression
A function without a name. Often used when a function expects to receive another function as a parameter. Anonymous expressions aren't hoisted.
 
    function (birthYear) {
      return 2022 - birthYear;
    }

    const calculateAge = function (birthYear) {
      return 2022 - birthYear;
    }

## Arrow Function
A shorter alternative form to Anonymous Functions.

    // parameter and return statement
    birthYear => 2022 - birthYear;

    const calculateAge = birthYear => 2022 - birthYear;
    const age = calculateAge(1997);

    // with multiple parameters and return statement
    const calculateAge = (birthYear, firstName) =>
    {
       const age = 2022 - birthYear;
       return `${firstName} is ${age} years old`;
    }
    
    // no parameters
    const hello = () => "Hello World";

* *If the function only has one line in the curly brackets, you omit the curly brackets*
* *If the only takes one parameter, you can also omit the brackets around the parameter*
* *If the function needs a return value and only contains one line, you can omit the return statement*

## Knowledge Check
**1. What are functions useful for?**
Functions are used to repeatedly execute a block of code.
**2. How do you invoke a function?**
Using the name of the function followed by parenthesis (and parameters if needed).
**3. What are anonymous functions?**
They are functions that use the function keyword but have no name.
**4. What is function scope?**
A function scope is the contained block of code inside the function, but is inaccessible outside of it.
**5. What are return values?**
The values returned by the function.
**6. What are arrow functions?**
They are a shorter and alternative to anonymous functions.


## Resources
[The Odin Project Project](https://www.theodinproject.com/paths/foundations/courses/foundations/)
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Functions
VTX - vite monorepo manager
Tags: showdev, vitejs, productivity, typescript
Published: 2022-01-04 03:00:42


Olá 👋, i'm very happy to introduce [VTX](https://github.com/miguelramos/vtx), an wrapper on vite-cli tool to help on management of multi-apps, libs and packages for vuejs. Feel free to contribute also.

## Features

- Create a workspace to share libs or custom packages thru your apps.
- Yarn workspaces only.
- Create apps and serve on your localhost
- Create libs to your apps or produce standalone dist to publish
- Build on top of vitejs
- Use all options from vitejs and a single configuration for your apps

## Install

You should install as a global package for use it as cli tool. Just hit:

```
yarn global add @websublime/vtx-cli
```

After, vtx binary will be available to use it.

## First steps

Start to create your workspace. Workspace is managed and design to use yarn as your dependency package manager. So for now is the only supported manager.

Create your workspace as:

```
vtx create-workspace
```
Nothing will be installed only created the initial directory structure to add apps and libs.

Ok, now just enter on your new workspace directory and create your first application. All applications and libs are created for typescript support. Let's initiate our first app:

```
vtx create-app
```

Cli will always put you questions to you refer what is name, directory our namespace.

Now on top of your root workspace perform an install:

```
yarn
```

Ok, you are now ready to run your first application as:

```
vtx dev
```

This are the initial steps to initiate multi-apps. You can perform lot of customisations, create libs, consume libs on your apps or share common code thru apps. For more info hit github link.

More like:

```
vtx create-lib
vtx dev --app todos --debug
vtx build --lib services -mode production
```
Feel free to contribute! 

## Links
Github link: [https://github.com/miguelramos/vtx](https://github.com/miguelramos/vtx)

## Current
- Create workspace
- Create app
- Create lib
- Build app
- Build lib
- Optimize and preview (to come)

## Happy coding! 🎉
Actualizando datos de la BD
Tags: javascript, webdev, programming, 100daysofcode
Published: 2022-01-04 02:03:43

Para actualizar un dato existente en la base de datos se usa el método `put(item, key)`, sin embargo, si el dato solicitado no existe este método lo crea e inserta en el *Object Store* correspondiente. Este método devuelve como resultado el `key` del elemento almacenado.

El método usado recibe dos parámetros, donde el primero es el objeto a actualizar o insertar, y el segundo parámetro es opcional y hace referencia al *key* del objeto, este último parámetro solo es necesario cuando se usa un valor `autoincrement` como la *key* de los objetos almacenados, ya que si no se especifica se creará un objeto nuevo con un `key` generado automáticamente.

Para actualizar, usualmente primero se usa el método `get(key)` para obtener el objeto almacenado, luego actualizar las propiedades necesarias y finalmente se usa el método `put(obj)` con el nuevo objeto.

```jsx
function updateStudent(key){
	const objectStore = db.transaction('students')
			              .objectStore('students');

	const request = objectStore.get(key);

	request.onsuccess = ()=> {

		const student = request.result;
		
		// Cambiamos el nombre
		student.name = 'Fulanito';
		
		// Creamos otro request para actualizar
		const updateRequest = objectStore.update(student);
		
		updateRequest.onsuccess = () => {

			console.log(`Estudiante acutalizado, correo: ${updateRequest.result}`)
		
		}
	}
}

updateStudent('andres@andres.com');
```
Use tmux, an essential tool for remote development
Tags: tmux, linux, ubuntu, wazaterm
Published: 2022-01-03 22:57:04

> This article is the 4th day of the Advent Calendar 2021 of [Wazaterm](https://www.wazaterm.com), an online Linux terminal for hackers.


[Wazaterm](https://www.wazaterm.com) comes with tmux installed by default. tmux is software that

> * Tmux stands for “Terminal Multiplexer.”
> * It allows you to split a Linux-style terminal screen into multiple sessions, windows, or panes.
> * A terminal can have multiple sessions.
> * A single session can have multiple windows.
> * A single window can have multiple panes.
> * The session is maintained even when the terminal is closed. You can avoid the tragedy of running a command and then getting logged out and ending up with no command result.

Tmux maintains the session, which is essential to open an editor and develop it remotely. It’s hard to set it up every time you connect. Please image if you use windows or mac, every time you unlock the screen, you need to relaunch the software or apps and adjust/arrange the window size and location. This can not be done.

And in the case of browsers, some OS will immediately kill the session when the main page goes to background (yes, it’s iPad!

So, since it is an indispensable tool in the server-side world (some people may be using “screen” for similar functions), I think there is no harm in learning how to use it.

In this article, I would like to explain the minimum necessary settings.

All operations are done with the keyboard only (cool, like a hacker!). It is necessary to distinguish it from regular input. This is why we have the prefix, which is an alphanumeric character that can be typed after the prefix to call a tmux action.

The prefix; default is ctrl-b. Here are some excerpts of the actions I often use.

* Ctrl-b c Create a new window (Create)
* Ctrl-b number Go to the window specified by the number
* Ctrl-b n Go to the next window (Next)
* Ctrl-b p Go to the previous window (Prev)
* Ctrl-b & Exit to window name (with confirmation)
* Ctrl-b “ Split pane vertically
* Ctrl-b % Split pane left/right
* Ctrl-b o Move to the next pane
* Ctrl-b ? Show list of key bindings (q to return)

Tmux allows you to add plugins by using tmux-plugin/tpm freely. I’m using the

* tmux-plugins/tmux-sensible - configures settings that everyone else uses (saves you the trouble of extra configuration)
* arcticicestudio/nord-tmux - theme
* tmux-plugins/tmux-resurrect - Save your session. You can also reboot from there. If you lose all your tmux sessions because of a reboot, you can restore the whole saved session.

Once you learn about 10 of these, you’ll be able to use them freely! Let’s take this opportunity to learn how to use them.
#5 - People in the Bus CodeWars Kata (6 kyu)
Tags: javascript, webdev, tutorial, 100daysofcode
Published: 2022-01-04 02:00:22

**Instructions:**
There is a bus moving in the city, and it takes and drop some people in each bus stop.

You are provided with a list (or array) of integer pairs. Elements of each pair represent number of people get into bus (The first item) and number of people get off the bus (The second item) in a bus stop.

Your task is to return number of people who are still in the bus after the last bus station (after the last array). Even though it is the last bus stop, the bus is not empty and some people are still in the bus, and they are probably sleeping there :D

Take a look on the test cases.

Please keep in mind that the test cases ensure that the number of people in the bus is always >= 0. So the return integer can't be negative.

The second value in the first integer array is 0, since the bus is empty in the first bus stop.



**My solution:**

```javascript
var number = function(busStops){
  let totalEntries = 0
  let totalDowns = 0
  
  busStops.map((arr)=> { 
    totalEntries += arr[0] 
    totalDowns += arr[1]
  })
  
  return totalEntries  - totalDowns
  
}
```

**Explanation**
I started with an accumulator for the total entries and the total of persons that get off the bus, then I mapped the busStops array,  I added the first value of every array to the total entries accumulator and the second value to the total downs accumulator, then I returned the total entries value minus the totalDowns value, so I get the people left in the bus


[My Github](https://github.com/Cesardlr)
[My twitter](https://twitter.com/cesar__dlr)
[Solve this Kata]
(https://www.codewars.com/kata/5648b12ce68d9daa6b000099)
100 Days of Code - Day 3
Tags: 100daysofcode, css
Published: 2022-01-04 01:54:00

Day 3 of [Modern HTML & CSS From the Beginning](https://www.udemy.com/share/1013eA3@vWdDAwIbTNKVDgdoKRg7QR2jUvRHDQ3ZaF3Dd-HzUhJUlzvcDZZUUPGMPdldaX2q/) begins a review of my mortal enemy of code, CSS. As much as I dislike CSS, this review is very much welcome as it will only help me grow as web developer, if you never practice a skill because you don't like it, how are you ever going to get good at it?

The first half of the review covered the very basics, the 3 ways to implement CSS, selectors, fonts, color types, backgrounds and borders. Fortunately these are things I don't struggle much with. Tomorrow brings the parts that frustrate me the most: box model, float, alignment all the stuff in which you make one small change and everything gets moved and messed up. Well, fortunately, that's tomorrow, not today.
Eliminando datos de la BD
Tags: javascript, webdev, programming, 100daysofcode
Published: 2022-01-04 01:49:00

La forma de remover objetos de un _Object Store_ es similar a cuando se [agregan](https://dev.to/pandresdev/agregando-datos-a-la-bd-1386). Primero, se crea un _request_ para eliminar un objeto mediante el método delete(key) y, finalmente, se manejan los eventos como sea necesario.

```jsx
function removeStudent(key){
	const request = db.transaction('students', 'readwrite')
                          .objectStore('students');
                          .delete(key);

	request.onsuccess = ()=> {
		console.log(`Student deleted, email: ${request.result}`);
	}

	request.onerror = (err)=> {
		console.error(`Error to delete student: ${err}`)
	}
}

removeStudent('andres@andres.com');
```
## Clear
Tambien se puede eliminar todos los datos almacenados en un _Object Store_ con el método `clear()`.

```jsx
function emptyStore(storeName){
	const request = db.transaction(storeName, 'readwrite')
                          .objectStore(storeName);
                          .clear();

	request.onsuccess = ()=> {
		console.log(`Object Store "${storeName}" emptied`);
	}

	request.onerror = (err)=> {
		console.error(`Error to empty Object Store: ${storeName}`)
	}
}

emptyStore('students');
```
Top 10 Most Popular JavaScript Frameworks for 2022
Tags: javascript, programming, webdev, beginners
Published: 2022-01-04 00:50:37

**Top 10 Most Popular JavaScript Frameworks for 2022**
In this blog we are going to see top 10 most popular JavaScript Frameworks for 2022. 
Here are the best JavaScript frameworks that you can consider in the year 2022 for developing software applications. 
**So lets Start:-**

1. React
2. Angular
3. Vue
4. Express
5. Ember
6. Meteor
7. Backbone
8. Mithril
9. Aurelia
10. Svelte

### You can read the whole blog here👇
[Click Here](https://codexashish.blogspot.com/2022/01/top-10-most-popular-javascript.html)  to see this post in detailed.

**_Thankyou_**
Which return type to use when there is nothing to return in a function in TypeScript?
Tags: typescript
Published: 2022-01-04 00:00:00

---
  title: Which return type to use when there is nothing to return in a function in TypeScript?
  published: true
  tags: TypeScript
  date: Tue Jan 04 2022 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/which-return-type-to-use-when-nothing-to-return-in-function-typescript
  cover_image: https://melvingeorge.me/_next/static/images/main-46e84211d382585cdeff11e40c46799f.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/which-return-type-to-use-when-nothing-to-return-in-function-typescript)
  
When there is nothing to return in a function, you can use the `:` symbol (colon) followed by the keyword `void` after the parameters brackets of a function in TypeScript.

### TL;DR

```ts
// logs string to the console
// The void keyword is to denote
// that the function doesn't
// return anything
function log(str: string): void {
  console.log(str);
}
```

For example, let's say we want to create a function where we need to only log the string to the console. Here the function doesn't have a return statement.

It can be done like this,

```ts
// logs string to the console
function log(str: string) {
  console.log(str);
}
```

Since the function doesn't have a return statement we can use the `void` keyword after the parameters brackets to denote that the function doesn't return anything.

It can be done like this,

```ts
// logs string to the console
// The void keyword is to denote
// that the function doesn't
// return anything
function log(str: string): void {
  console.log(str);
}
```

See the above code live in [codesandbox](https://codesandbox.io/s/which-return-type-to-use-when-nothing-to-return-in-function-typescript-rsssi?file=/src/index.ts).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
Salesforce Apex lets you use external IDs
Tags: salesforce
Published: 2022-02-23 15:43:00

---
title: Salesforce Apex lets you use external IDs
published: true
date: 2022-01-04 00:00:00 UTC
tags: salesforce
canonical_url: https://katiekodes.com/apex-external-id-dml/
---

How did I miss this?  [Salesforce Apex lets you DML lookup and master-detail relationships by external ID.](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_foreign_keys.htm)

This is huge for actually letting me leverage the [performance benefits of `@testSetup`](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_testsetup.htm) and not worry about the fact that it [doesn't let you see IDs of records you used it to DML without a SOQL query](https://salesforce.stackexchange.com/questions/160328/what-are-the-advantage-of-the-testsetup-annotation).

```java
@isTest
public class WowThisWorks {
    
    @testSetup static void insertSampleData() {
        Lowest__c l = new Lowest__c(External_ID__c='L01', Name='L 0 1');
        INSERT l;
        
        Middle__c m  = new Middle__c(External_ID__c='M01', Name='M 0 1', Lowest__c=l.Id);
        INSERT m;
    }
    
    static testMethod void runTest01() {
        Middle__c mFake = new Middle__c(External_ID__c='M01'); // THIS IS THE MAGIC
        
        Highest__c h = new Highest__c(Name='H 0 1', Middle__r=mFake); // NOTE THE __r INSTEAD OF __C

        Test.startTest();
        INSERT h;
        Test.stopTest();
        
        Highest__c hAfter = [
            SELECT Name, 
            Middle__r.Name, 
            hAfter.Middle__r.Lower__r.Name 
            FROM Highest__c 
            LIMIT 1
        ];
        String concat = hAfter.Name + ' ~~ ' + hAfter.Middle__r.Name + ' ~~ ' + hAfter.Middle__r.Lower__r.Name;
        System.assertEquals('H 0 1 ~~ M 0 1 ~~ L 0 1', concat);
    }
    
}
```

I've got many, many [validation tables](http://etutorials.org/SQL/Database+design+for+mere+mortals/Part+II+The+Design+Process/Chapter+11.+Business+Rules/Validation+Tables/) that Contact can point to, all of which feed into a trigger I need to write tests for.  They all have unique required external IDs built into their schemas.

It's going to be amazing to be able to create test-data **Contact** records that look up these "validation table" records by their external IDs without using up any SOQL queries or caching the "validation table" records in memory in test classes.

Happy new year to me!
What is OpenTelemetry?
Tags: opentelemtry, opentelemetry, observability, monitoring
Published: 2022-01-05 06:52:17

---
title: What is OpenTelemetry?
published: true
date: 2022-01-04 00:00:00 UTC
tags: OpenTelemtry,OpenTelemetry,Observability,Monitoring
canonical_url: https://www.mourtada.se/what-is-opentelemetry/
---

This is the first post in a planned blog series about OpenTelemetry.

OpenTelemetry is an open source observability framework which is the result of merging the projects OpenTracing and OpenCensus. It’s goal is to provide language agnostic tools for telemetry data such as tracing, metrics and logging in distributed architectures.

## Signals

The architecture of OpenTelemetry is designed around signals and can be thought of as categories of telemetry. Each signal provides a way for software to describe itself.

There are four signals defined in the specification:

- Tracing
- Metrics
- Logs
- Baggage

## Tracing

A trace tracks the progress of an request as it’s flows through services in a distributed application. A trace contains a tree of spans. A span represents a unit of work for example in a service or a component.

## Metrics

A metric is measurement of work being done by a service or a component in a specific point in time. An example of a metric can be a counter of total requests for a http endpoint.

## Logs

A log entry is a text record that has a timestamp. Logs is an independant data source but can also be attached to spans.

## Baggage

Bagagge is a mechanism for propagating observability events as name/value pairs in a distributed transaction. This can be used to store data about a trace across process-boundaries.

## Context propagation

Signals are built on shared a mechanism called context propagation. The context provides a way to store state and accessing data over the lifetime of a distributed transaction. Propagators are used to serialize and deserialize context over different protocols.
Con este escenario, y tratando de adaptarse a las demandas
Published: 2022-01-03 21:50:27

de los consumidores, el mercado funerario ha decidido digitalizarse y adentrarse en el ecommerce a través de Electium Smart. “Mediante este nuevo servicio cualquier persona puede adquirir un entierro de forma completamente online, así como seleccionar los detalles deseados para este proceso que más se adapten a sus necesidades”, explica Christian Gimeno, responsable del proyecto.

Esta rompedora forma de contratación para el sector tiene, a su vez, la intención de normalizar la adquisición de este tipo de productos de forma anticipada. Según Gimeno, “Se trata de una alternativa digital y accesible, gracias al pago a plazos, en una sociedad en la que aproximadamente el 30% de personas fallecen sin tener un servicio funerario previamente contratado y dejando a la familia a cargo de los trámites y del alto coste económico que conlleva su fallecimiento”. Se ofrecen como una opción sencilla, cómoda y disruptiva para una situación inevitable.

Otra de las novedades de este tipo de producto es que es transferible, desde la empresa aseguran que durante los meses que llevan funcionando el 80% de sus clientes son personas que adquieren el servicio para sus padres cuyas edades se encuentran entre los 70 y 90 años.
[leer mas](https://diariomallorca.es/)
The Blind Leading the Sighted: What We Can Learn From an Ex-Software Engineer Without Sight
Tags: podcast, video, interview, a11y
Published: 2022-02-17 01:03:23

---
title: The Blind Leading the Sighted: What We Can Learn From an Ex-Software Engineer Without Sight
published: true
date: 2022-01-04 00:00:00 UTC
tags: podcast,video,interview,accessibility
canonical_url: https://jhall.io/archive/2022/01/04/the-blind-leading-the-sighted-what-we-can-learn-from-an-ex-software-engineer-without-sight/
---

This week on Tiny DevOps I’m joined by Parham Doustdar, Engineering Manager of Accessibility at Booking.com. We discuss his life as a fully blind sofware engineer, and how we can make engineering tools more accessible for everyone, not just those with disabilities.

[Listen](https://share.transistor.fm/s/7a26ec52),[watch](https://youtu.be/p4a-e-INQjE), or[read the transcript](https://share.transistor.fm/s/7a26ec52/transcript)  
[![](https://jhall.io/images/icon-podcast-512_hudba6b7b089bf867fab369dd7c8de54ef_15339_0x100_resize_q85_box_3.png)](https://share.transistor.fm/s/7a26ec52)  [![](https://jhall.io/images/icon-youtube-512_hu472b17e2e29474aa989a586bfaf501e7_5679_0x100_resize_q85_box_3.png)](https://youtu.be/p4a-e-INQjEs)  [![](https://jhall.io/images/icon-transcript-512_hu61121fb4158683053abb5347949e43dd_14667_0x100_resize_q85_box_3.png)](https://share.transistor.fm/s/7a26ec52/transcript)
* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._