teleren/devto huggingface dataset:
Keyboard Shortcuts To Make Life Easier(For Mac).
Published: 2023-01-17 19:06:19

When starting your journey to becoming a master at developing code one of the most arduous parts of creating code is the time spent typing or highlighting. The painstaking process of going back to find the one line you made an error or highlighting and right-clicking to copy and paste just adds countless minutes to an already lengthy process. To make life easier we can use keyboard shortcuts to edit/create in a more timely fashion. Although it is not necessary to use shortcuts, the time and energy you'll save will be worth it in the long run. What was once a 30-minute process for you could be cut in half. In this post, I will take you through some keyboard shortcuts to help you save time on your next coding endeavor. 

 

-The Undo 
This button will save you vast amounts of time. If you create a line of code that's typed out incorrectly this will undo anything you have just typed. Type command + z or ⌘ + z on your keyboard. 

-Undo the Undo 
If you're like me and make mistakes often you might command + z one too many times. In this instance Type command + shift + z or ⌘ + shift + z on your keyboard. To revert the changes. 

-Select All 
When it comes to highlighting multiple lines of code this one will save you a plethora of time. Hit command + A or
⌘ + shift + L. One of my favorite ways to use this command is if you have multiple lines of code you need to comment out for pusedo-coding. You can select all and then press /. Which will comment out everything you have highlighted 

-Select All Matching Instances
Let's say for example you're trying to select the same matching variable in multiple lines of code, you should give this shortcut a try. command + shift + L or ⌘ + shift + L.

-Select Current Word
If you want to highlight one particular word instead of many. Depending on whether your cursor is to the right or left of the word you'd like to highlight, hit option left arrow or option right arrow to highlight that word.

-Delete code from a current position to the start of a line. 

If you would like to delete a line of code starting from the beginning of the line and ending at your cursor hit option + delete

-Delete the whole line of code
If you're looking to delete the whole line of code simply hit control + k and the entire line will vanish. 

These are my favorite shortcuts that I use with frequency. They have saved me copious amounts of time when developing code. Add these shortcuts to your coding arsenal and see how much time they save you.
How to Make Images Retina-Ready for your WordPress Theme without any plugin?
Tags: wordpress, performance
Published: 2023-01-17 18:50:58

# Step 1: Define Image Sizes

`add_action( 'after_setup_theme', function(){

	$image_sizes = [
		[
			'size'		=>	'thumbnail',
			'width'		=>	150,
			'height'	=>	150
		],
		[
			'size'		=>	'medium',
			'width'		=>	300,
			'height'	=>	300
		],
		[
			'size'		=>	'medium_large',
			'width'		=>	768,
			'height'	=>	0
		],
		[
			'size'		=>	'large',
			'width'		=>	1024,
			'height'	=>	1024
		]
	];

	foreach( $image_sizes as $sizes ) {
		add_image_size( sprintf('%s', $sizes['size']), $sizes['width'], $sizes['height'] );
		add_image_size( sprintf('%s@%dx', $sizes['size'], 2), $sizes['width']*2, $sizes['height']*2 );
		add_image_size( sprintf('%s@%dx', $sizes['size'], 3), $sizes['width']*3, $sizes['height']*3 );
	}

} );`

# Step 2: Insert Retina Sizes in `SRCSET`

`add_filter( 'wp_get_attachment_image_attributes', function( $attr, $attachment, $size ) {

	$img_id			= $attachment->ID;
	$requested_image	= wp_get_attachment_image_src( $img_id, $size );
	$res			= ['2x', '3x'];
	$srcset			= [];
	$size_args       	= [
		'width'		=> $requested_image[1],
		'height'	=> $requested_image[2]
	];

	$srcset[] = $requested_image[0] .' 1x';
	foreach($res as $r) {
		$r_img = $size .'@'. $r;
		$r_src = wp_get_attachment_image_src($img_id, $r_img);
		if($r_src[3] == true) {
			$srcset[] = esc_url($r_src[0]) .' '. $r;
		}
	}

	$attr['src']    = $requested_image[0];
	$attr['srcset'] = implode( ', ', $srcset );
	unset($attr['sizes']);

	return $attr;
}, 10, 3 );`

{% embed https://www.ahmadthedev.com/wordpress/retina-ready-images-without-plugin/ %}

Have fun coding!
GitHub resources to level up your JavaScript coding skills
Tags: javascript, react, reactnative, programming
Published: 2023-01-17 18:48:46

## 1. You-Dont Know-JS

This is a series of books diving deep into the core mechanisms of the JavaScript language.
[https://lnkd.in/dDUZ_8zH](https://lnkd.in/dDUZ_8zH)


## 2. wtfjs

A list of funny and tricky JavaScript examples. Learn with fun.
https://lnkd.in/dsUYwkGZ

## 3. JavaScript30

Learn to build 30 things in 30 days with 30 tutorials. No Frameworks, Compilers, Libraries or Boilerplate.
https://lnkd.in/dke98qS3

## 4. clean-code-javascript

→ Clean Code concepts adapted for JavaScript. Find the best code snippets here.
https://lnkd.in/dTr4tKMf

## 5. javascript-questions

A long list of (advanced) JavaScript questions, and their explanations
https://lnkd.in/dXebxPAm

## 6. ES6-for-humans

A Kickstarter guide to writing ES6. Best practices for code optimization, organization, and practicals.
https://lnkd.in/dN3qPjEP

## 7. javascript-algorithms

Algorithms and data structures implemented in JavaScript with explanations.
https://lnkd.in/dvDFZq92

## 8 js-stack-from-scratch

Learn JavaScript from scratch. A straight-to-the-point guide to assembling a JavaScript stack.
https://lnkd.in/daJJ4RQU
Is Kim Kardashian a Libra or Scorpio?
Published: 2023-01-17 18:34:27

Kim Kardashian was born at 10:46 in the morning on October 21, 1980, in Los Angeles, California. As a result, she has the sun in Libra, the moon in Pisces, and the rising sign of Sagittarius.
Read More: [https://astrology-seek.com/birth-charts/kim-kardashian/](https://astrology-seek.com/birth-charts/kim-kardashian/)
waec news 2023
Published: 2023-01-17 18:34:17

[https://multischolar.com/waec-timetable/](https://multischolar.com/waec-timetable/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)
https://plaza.rakuten.co.jp/chenlee/diary/202301170001/
https://www.provenexpert.com/waec-news-2023/
https://www.producthunt.com/@waecnews2023
https://www.divephotoguide.com/user/waecnews2023/
https://www.diggerslist.com/waecnews2023/about
http://www.heromachine.com/forums/users/waecnews2023/
https://wakelet.com/@waecnews2023955
https://vocal.media/authors/waecnews2023
https://www.lifeofpix.com/photographers/waecnews2023/
https://seedandspark.com/user/waecnews2023
https://rosalind.info/users/waecnews2023/
http://phillipsservices.net/UserProfile/tabid/43/userId/194706/Default.aspx
https://app.roll20.net/users/11520903/waecnews2023
http://uid.me/waecnews2023
https://speakerdeck.com/waecnews2023
https://social.msdn.microsoft.com/Profile/waecnews2023
https://www.iheart.com/podcast/269-waec-news-2023-107381815/
https://active.popsugar.com/@waecnews2023/profile
https://unsplash.com/@waecnews2023/likes
https://camp-fire.jp/profile/waecnews2023
https://plazapublica.cdmx.gob.mx/profiles/waecnews2023/activity
https://www.metal-archives.com/users/waecnews2023
https://artmight.com/user/profile/924971
https://storium.com/user/waecnews2023
https://trabajo.merca20.com/author/waecnews2023/
https://telegra.ph/waec-news-2023-01-17
https://www.intensedebate.com/people/waecnews2023
https://www.mifare.net/support/forum/users/waecnews2023/
https://pinshape.com/users/2556043-waecnews2023
http://foxsheets.com/UserProfile/tabid/57/userId/118411/Default.aspx
https://www.kompasiana.com/waecnews2023
https://www.credly.com/users/waec-news-2023/badges
https://www.myminifactory.com/users/waecnews2023
https://www.speedrun.com/user/waecnews2023
https://www.sqlservercentral.com/forums/user/waecnews2023
https://leanin.org/circles/waecnews2023
https://myanimelist.net/profile/waecnews2023
MERN Stack Learning path
Tags: mern, webdev, react, node
Published: 2023-01-17 18:27:19

Been a long time I wrote, but here I am. Hopefully I'll write more these days. So in my React journey (also learning Node JS along), I started this tutorial building a social media application and I'm currently at the back end part of it. I was stuck in one aspect for hourssss. Left it, watched a movie to clear my mind and came back but I still didn't get it. I even asked ChatGPT lol (it must've been tired of me today if it could get tired). Tried different methods and stuff. What I was trying to achieve was updating a particular post and I was testing the function on the postman app. Code snippet below: 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fip1vqo3uchnjvgeqh4.PNG)

So I followed the tutorial well, and it just wasn't working. The console gave the error below: 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zug4ms4nbi98oisa560.PNG)

So after googling and asking ChatGPT for help, I found out that BSON error means that the arguments passed in the url wasn't complete so I checked my Postman url again and noticed that there was a new line after the url and wondered how in the world I could've missed such. Picture below:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9x3c8rinz6dtk7e5ezkh.PNG)

It's amazing how a simple error set me back and I'm currently pissed at myself for that, but then it's all part of the learning journey so it's cool. So whoever is reading this, don't give up. If your code isn't working, check over and over again. Don't forget the details. Alright, till next time.
Django VS Flask
Tags: django, python, programming, webdev
Published: 2023-01-17 18:11:47

Python is a programming language with many options for web development frameworks. Two of the most popular frameworks are Django and Flask. In this article, we’ll compare and contrast these two frameworks so you can make the best decision for your project.

Django is a full-stack web framework for Python. It’s open source and released under the BSD license. Django was designed to help developers create complex, database-driven websites. It’s a comprehensive framework that includes everything you need to create a website, from the backend database and models to the frontend templates and views. Django also has a strong community that provides helpful resources and support.

Flask is a micro-framework for Python. It’s open source and released under the BSD license. Flask was designed to be lightweight and easy to use. It’s a minimalistic framework that doesn’t include all the bells and whistles of a full-stack web framework. This makes Flask a good choice for small projects or projects that need more flexibility. Flask also has a strong community that provides helpful resources and support.

Both Django and Flask are popular choices for web development with Python. They’re both open source and released under the BSD license. They both have strong communities that provide helpful resources and support. So, which one should you choose for your project?

The answer depends on your project requirements. If you need a full-stack web framework with all the bells and whistles, Django is the best choice. If you need a lightweight micro-framework with more flexibility, Flask is the best choice.
What do you think about wordpress hosting management saas?
Tags: wordpress
Published: 2023-01-17 18:04:00

Greetings everyone,

I hope this post finds you well and having a great time. I am excited to share that I am working on building Pivotlar, a SaaS software that simplifies the process of setting up and managing a WordPress website. Our software allows for easy provisioning of a VPS with your chosen server provider(amazon, linode, vultr, digitalocean ...), and then takes care of installing all the necessary tools for a WordPress site to function properly. Once the server is set up, you can easily add as many websites as you want by simply providing your domain name and Pivotlar will handle the rest - from installing WordPress to adding your chosen themes and plugins.

The website for Pivotlar is now live at https://pivotlar.com, and I would greatly appreciate any feedback on the product idea and landing page. If you think Pivotlar could be beneficial for you, please sign up for our waiting list.

Thank you for your support and I look forward to hearing your thoughts.
Gericht
Tags: javascript, react, programming, webdev
Published: 2023-01-17 18:03:08


![🍽️🗽🥂](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zs1wyaaojham1i9mkzgj.png)
Hi guys this is my new React.js practice project
UI UX from Javascript mastery
[Gericht](https://candid-pegasus-c7e26a.netlify.app/)
[<> Code](https://github.com/aaradj/gericht)
B52 - Game Đánh Bài Đổi Thưởng BOM TẤN Uy Tín Nhất
Published: 2023-01-17 18:02:25

https://b52f.club/ B52 Cổng game bài đổi thưởng uy tín nhất việt nam✔️Trang chính thức go88✔️Đa dạng thể loại tài xỉu, bắn cá, quay hũ✔️✔️✔️
https://plaza.rakuten.co.jp/b52fclub
https://app.bountysource.com/people/112298-b52fclub
https://matters.news/@b52fclub
https://penzu.com/p/434d36d6
https://peatix.com/user/15550422
JavaScript: O que são funções IIFE?
Tags: javascript, programming, beginners, node
Published: 2023-01-17 17:57:29

Nesse texto quero te mostrar o que é, e como usar uma função IIFE

Primeiro, o que é uma IIFE? O que significa isso? Bom IIFE é a sigla para Immediately-Invoked Function Expression que em uma tradução livre ficaria função auto executável.

## Conceito

Quando nós temos uma função em qualquer linguagem, nós a declaramos e a chamamos quando e onde quisermos, correto? Correto! Porém, no JS existe uma forma de você declara uma função e no momento de execução, a mesma ser executada, porém sem chama-lá usando `nomeDaFuncao()`.

## Prática

Abaixo eu mostro como utilizar uma as função auto executável de duas formas diferentes.


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

Basicamente para criarmos e usarmos um IIFE nós criamos uma função comum, no exemplo acima eu criei funções anônimas usando a palavra-chave `function`, porém, nada te impede de criar `arrow functions` ou até mesmo nomear as suas funções.
Para que a função seja auto executável ela deve estar entre  parênteses `()` e logo após a sua declaração você deve adicionar novamente parênteses dentro (1° Forma) ou fora (2° Forma) dos parênteses que ficam em volta da função.

E por fim basta executar o seu código e a função será executada sem nenhuma sem precisar chama-lá.


Muito obrigado por ler 🙃

[Links úteis](https://bento.me/cmsdev)
Object in JavaScript
Published: 2023-01-17 17:56:24

Today I learned that I can create an Object using the **Dot (.) notation**, the **bracket [] notation**, and the **Coma (,) delimited key-value pairs**.

What is actually an Object?
Well from my understanding, It is the grouping of different variables(properties) that descript a character and it helps JavaScript to understand that all variables are related.

1. **Using the Dot (.) notation**

The Properties are represented as **Key-value pairs** where variable names become property key and variable value becomes property value of the object.

example
`var dogColor = "Red";`
_dogColor_ will be the property key
_Red_ will be the property value

The Syntax for dot (.) notation is

```
let Car = {}
car.color = "Red";
car.type = "Honda";
```

2. **The Bracket [] Notation**
It is an alternative syntax to the Dot notation.
The difference is that instead of using dot (.), it uses square brackets [].

The syntax

```
let car = {}
car["color"] = "Black";
car["type"] = "Honda"
```


3.** The Coma (,) delimited key-value**
This is listing the key-value pairs inside the Object literal (i.e. the curly braces {}) and it specifies them as coma (,) delimited property because at the end of each key-value will be a coma (,) separating each key-value pair

The Syntax for it

```
Let car = {
color: "Red",
Type: "Honda",
```

After each Property comes a colon (:) and follows by its value, after the value is a coma (,).

We can add a new property (Update) and value to the Object by using a dot (.) notation

```
car.status = "Sold";
car.priceUSD = 1400;
```

This Syntax of updating the Object works for all types of creating Objects.
Volumes in Kubernetes - Part 2 (hostPath)
Tags: kubernetes, devops, beginners, tutorial
Published: 2023-01-17 17:50:06

**hostPath:**
The emptyDir volume is a very basic volume and has a few downsides as well. Let's suppose if the count of pods running is more than one, and data is stored in these emptyDir volumes and if a pod crashes, the data stored in that volume also gets lost.
Here comes hostPath driver in the action.
hostPath driver basically allows us to map a path on the worker / slave node on which the pods are running to a specific path inside the pods, i.e. the data from inside of this path will be exposed to multiple pods, therefore, multiple pods can use same path on the host (worker) machine to store the data instead of specific path for specific pods.
hostPath is very much like the bind mount in docker, similar to docker we can perform read / write actions in this hostPath.

Syntax:
```
apiVersion: apps/v1
kind: Deployment
metadata:
    name: <name_of_deployment>
spec:
    replicas: 1
    selector:
        matchLabels:
            a: b
    spec:
        template:
            metadata:
                labels: 
                    a: b
            containers:
                - name: <name_of_container>
                  image: deocker_repo/<image_name>
            volumes:
                - name: <name_of_volumes>
                  hostPath:
                      path: <path_on_the_host_machone_where_data_should_be_stored>
                      type: <declares_how_the_above_declare_path_is_to_be_handled>
                            DirectoryOrCreate
```

**type:** Directory defines the path that already exists.
        Creates defines that the path does not exist but needs to be created.

**Disadvantage of hostPath:**
Let's suppose there are multiple pods, running on multiple slaves / worker nodes, now defining hostpath lets you map a volume on the slave / worker node to the N number of pods running on that particular slave / worker node i.e. all other pods that are running on other slaves / worker nodes will not be able to access the volume defined in this slave / worker node.
Some popular JS topics
Tags: webdev, javascript, beginners, career
Published: 2023-01-17 17:47:26

This blog post is mainly beneficial for freshers who started interviews. As a Fresher, I know its very difficult to face interviews and answer the questions.

Here, I mentioned some popular topics with proper definition which is useful during your interview preparation.

## Closure-
A function bundle with its lexical environment forms the closure.

In other words, a Closure gives you access to outer function scope from an inner function. In JS, closures are created everytime a function is created at function creation time.

```
function x(){
var a =7;
function y(){
console.log(a);
}
y();
}
x();

//output:- 7
```
Whenever function is returned, even if its vanished in execution context but still it remember the reference it was pointing too.

**Uses Of Closure:**
- Module design Pattern

- Currying

- Memoize

##Hoisting-

Hoisting in JavaScript is a behavior in which a function or a variable can be used before declaration.

Hoisting is a behavior in JavaScript where variable and function declarations are moved to the top of their scope.

In JavaScript, variable declarations are moved to the top of their scope (either the global scope or a function scope) during the compilation phase. This means that you can reference a variable before it is actually declared in your code.

```
getName();
console.log(x);
var x=7;
function getName(){
console.log("Hello!");
}
//output:
//Hello!
//undefined
```
## Event Loop-
Event Loop in JS is a mechanism through which the 'calls waiting for execution' in the callback queue/job queue can be put on the call stack. For any event from the callback queue/job queue to come to call stack, the call stack will have to be empty.

## DOM-
The **Document Object Model(DOM)** is a programming interface for HTML and XML documents. It represents the structure of a document as a tree-like hierarchy of nodes, allowing programs to access and manipulate the content and structure of a document. The DOM can be used with any programming language, such as JS to make dynamic changes to a webpage.

## Function Borrowing-
Function Borrowing allows us to use the methods of one object on a different object without having to make a copy of that method and maintain it in two separate places. It is accomplished through the use of call(), apply(), bind().

```
let name={
firstName:"shubham",
lastName:"gupta",
printName:function(){
console.log(this.firstName + " " + this.lastName);
}}

let name2={
firstName:"shivam",
lastName:"gupta"
}

name.printName.call(name2);
//output: shivam gupta
```
That's all about for this post. I hope as a reader of this blog, you get knowledge about this topic after reading this post. Thank you!
Minha Configuração para Rodar React Native CLI com Java 17
Published: 2023-01-17 17:38:13

Toda a vez que eu preciso trabalhar em algum applicativo com React Native acabo lidando com o problema de ambiente de desenvolvimento. 

Em geral isso acontece porque eu tive que realizar alguma atualização no meu Ubuntu ou porque rolou algum upgrade de hardware (troquei o HD por SSD pro Android Studio rodar sem parecer que a máquina vai se transformar em um reator ARC). 

Eu ja estava com o ambiente JAVA 17 arrumado e não queria perder tempo. Iniciei o projeto com 

```
npx react-native init meuProjeto
```

e, depois de passar por todo o processo de criação do boilerplate, inseri meu endereço do SDK em um arquivo "local.properties"  no diretório 'android'

```
sdk.dir=/home/rodrigo/Android/Sdk
```
Apesar disso o gradle não conseguia buildar o app e instalar no Android Emulator

Dando uma olhada no github do [facebook](https://github.com/facebook/react-native/issues/32948) para o projeto React Native encontrei uma solução:

Alterar a 'distributionURL' em gradle-wrapper.properties, atualizando-a para a versão 7.3 . Na minha máquina ficou assim: 

```
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
```

Além disso, foi preciso adicionar ao gradle.properties o seguinte trecho de código ( no meu inseri ao final do arquivo): 

```
org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
```

Após isso, iniciei o servidor do react-native novamente: 

```
npx react-native start
```

e depois mandei instalar o app no Android Emulator, que já estava rodando bonitinho ao fundo: 

```
npx react-native run-android
```

e Voilá! 


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

Rodou bonito. Agora posso voltar para minha aula da Formação React Native da @Alura