teleren/devto huggingface dataset:
Adding free Cursive(Italic) font to visual studio code
Tags: visualstudio, visualstudiocode, code, javascript
Published: 2022-08-13 06:47:56

---
title: Adding free Cursive(Italic) font to visual studio code
published: true
description:  Adding free Cursive(Italic) font to visual studio code 
tags: visualstudio, visualstudiocode, code, javascript
---

We all love visual studio code editor for it's features, extensibility. In this article I'm going to show a great tip about setting up the cursive(italic) font absolutely free.

Recently, It has been trend that people are using the fonts that supports cursive fonts when visual studio code show the keyword and other parts at italic. For that people were paying for the font like Operator Mono, Dank mono etc. 

I really like this kind of setup but I don't wanted to pay for it. I have searched couple options but I was not liking the font implementation specially the cursive parts and recently I came to know about this font and that blew up mind. It's look so cool you can see that in below image.

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

So do you want the same font for the your Visual Studio code editor. If yes, there tip is for you.

So let's me introduce the font it's called "Cascadia Code" font which is from Microsoft. Yeah Microsoft is making some cool fonts since so many years and this one is one of them. I also love consolas from Microsoft and I have used it so many year for the same. 

The "Cascadia Code" font is created by Microsoft and If you are using "Terminal" app by Microsoft then it's comes by default with that. You can download the font from the following GitHub link. 

https://github.com/microsoft/cascadia-code

After that you need to got setting of visual studio code and then you need to find the following setting font and add "Cascadia Code" as your editor font like below.

```json
"editor.fontFamily": "Cascadia Code ,Consolas"
```

And then you if you have enabled font ligature by default in visual studio code settings then you need to find the following settings.

```json
"editor.fontLigatures": true,
```

And replace that setting with following.
```json
 "editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'"
```

And that's it. You are good to go you will get great looking italic font.

P.S. Please do remember that you need to have visual studio theme that supports the italic fonts. There are tons of themes available for that and I'm sure you must be aware about it.

For more information about this font. You can see the GitHub link they have clear instructions on it.

If you struggling with setting up the font in visual studio code. I have created a youtub video for the same. You can watch this video and follow the instructions given this video.

{% youtube JetVBxrPT1s%}

I have been creating lots of video related to programing, Visual Studio code and If you like this video, Please do subscribe to my channel at https://bit.ly/subscribetocodewithv and hit like button on the video.
How I'm Learning How to Code
Tags: beginners, webdev, learn, codenewbie
Published: 2022-08-13 06:28:46

Hey folks! In this article I'm going to be sharing how I'm currently learning how to code. I've seen many videos related to this topic, especially videos like "how I'm learning how to code if I would start over", or "the best way to learn how to code". I'm also going to be sharing the resources I'm going to use to learn to code.

First of all, I'm going to be finishing [freeCodeCamp's Responsive Web Design curriculum](https://www.freecodecamp.org/learn/2022/responsive-web-design/). You can learn about HTML, CSS, responsive web design, and more by following this curriculum. I know that this isn't real programming yet, but to be honest, I wasn't ready to dive in those stuff yet. I tried to do a beginner Python course in the past, but I can't really stick with it, and I got really frustrated with it, so I'm just going to stick to the basic stuff now. I'm currently already halfway throughout the curriculum, and I'm really enjoying it so far.

After completing the RWD course from freeCodeCamp, I'm going to consider between finishing [The Odin Project](https://www.theodinproject.com/), or dive in straight to . I can't really decide right now, as currently I only know HTML and basic CSS. But what I know is that I need to learn the JavaScript language next. I'll probably watch some YouTube tutorials and build projects to learn this.

My goal is to master HTML, CSS, and JavaScript, and to be able to build awesome websites by the end of the year. I'm going to be learning at least one hour everyday, and I will try to code every time I can. I'll be documenting my journey in this blog, so stay tune for that. Also, feel free to comment any suggestions or stuff that could help me and others below.

Alright, that's it for this article. Thank you for your time, and I'll see you next time.
Alright, that's it for this article. Thank you for your time, and I'll see you next time.
What are named tuples in Python?
Published: 2022-08-13 06:28:28

Python's named tuples are a very simple yet interesting feature that can make a developer's life easier. They are part of the `collections` module and act very similar to regular tuples, the main difference being that values stored in a named tuple can be accessed using field names instead of indexes.

For example, a point in the two-dimensional plane can be represented using two coordinates. In a regular tuple, these values would be accessed by index (`[0]` and `[1]`), but if we define a named tuple, `Point`, we can access them using `x` and `y` instead (although we can still use indexes, too, if we want):

```py
from collections import namedtuple

# Regular tuple
p = (2, 4) # p[0] = 2, p[1] = 4

# Named tuple
Point = namedtuple('Point', 'x y')
q = Point(3, 5) # q.x = 3, q.y = 5
```

Apart from the increased readability of your code, named tuples provide a few other quality of life improvements. First and foremost, they allow for default values to be specified via the `defaults` iterable argument. Secondly, they have the ability to automatically rename duplicate or invalid fields via the `rename` boolean argument. And, finally, they even provide a convenient option to specify field names as a list or comma/space-separated string.

```py
from collections import namedtuple

Point = namedtuple('Point', ['x', 'y', 'z'], defaults = [1]);
a = Point(1, 1, 0); # a.x = 1, a.y = 1, a.z = 0

# Default value used for `z`
b = Point(2, 2); # b.x = 2, b.y = 2, b.z = 1 (default)
```

_Where's the catch?_ you might ask. Well, it seems like there's none! The obvious parallel to dictionaries in terms of syntax doesn't seem to go any further, as named tuple instances do not have per-instance dictionaries, meaning they require as much memory as regular tuples.

---

_Do you like short, high-quality code snippets and articles? So do we! Visit [30 seconds of code](https://www.30secondsofcode.org/) for more articles like this one or follow us on [Twitter](https://twitter.com/30secondsofcode) for daily JavaScript, React and Python snippets!_ 👨‍💻
Hello world
Tags: helloworld, devjournal, github, blog
Published: 2023-04-06 08:50:15

---
title: Hello world
description: Eating GitHub for cereal with a punch of DEV.to
published: true
date: 2022-08-13 06:17:39 UTC
tags: helloworld, devjournal, github, blog
canonical_url: https://keepontruckin.hashnode.dev/hello-world
cover_image: https://user-images.githubusercontent.com/958227/233758726-1276ec39-db7b-43ac-922c-c645fb47b22c.jpeg?auto=compress
---

[GitHub](https://github.com/) used to be my unicorn and now it is _my bitch_.

I interact with GitHub more often than [Twitter](https://twitter.com/kosalanuwan) or [LinkedIn](https://www.linkedin.com/in/kosalanuwan), so why not use it for everything else, say, todos, bookmarks, links, ahaa thoughts, notes for future me, journaling, and the like? It makes more sense, at least for me. I'm that nerd 🤓

![Kosala Nuwan's GitHub contributions](https://ghchart.rshah.org/AF0000/kosalanuwan?auto=compress)

The truth is I tried out all those widespread productivity and notes-taking apps from Evernote to OneNote, Workflowy, Trello, Todoist, Asana, and even Notion. For the record, they all seemed great apps but <mark>this is just my personal preference</mark>.

### About the site

In case you were wondering, these journal notes are:

- Written on a Mac in Colombo, Sri Lanka.
- Written in [Markdown](https://support.hashnode.com/docs/markdown-guidelines) with [Typora app](https://www.typora.io/).
- Served with [GitHub](https://github.com/kosalanuwan) in a [public repo](https://github.com/kosalanuwan/keep-on-truckin/#readme).
- Published on [Hashnode](https://keepontruckin.hashnode.dev/hello-world).
- Synced to [DEV.to](https://dev.to/kosalanuwan) via RSS
- Originally, a flavor of my [Developer Journal](https://opensource.com/article/19/4/what-developer-journal).

You can find more about my work on [my GitHub Page](https://kosalanuwan.github.io/).

For comments or questions, feel free to [ask me on GitHub](https://github.com/kosalanuwan/ama), [on Twitter](https://twitter.com/kosalanuwan), or via email at kosala dot nuwan at gmail dot com.

/KP
How to call HTTP delete using axios in React
Tags: react
Published: 2022-08-13 05:55:56

In my previous article, I explained [using axios in react](https://www.codingdeft.com/posts/react-axios-api-calls/). In this article, we will see how to call a delete API from react application using axios.

## Project setup

First create a react app using the following command:

```bash
npx create-react-app react-axios-delete
```

Now install [axios](https://axios-http.com/docs/intro) using the following command:

```bash
npm i axios
```

In App.js, add a delete button and bind a handler to it as shown below:

```jsx
function App() {
  const deleteHandler = () => {}

  return (
    <div>
      <button onClick={deleteHandler}>Delete</button>
    </div>
  )
}

export default App
```

## Deleting using axios

We will be using the [JSONPlaceholder API](https://jsonplaceholder.typicode.com/) for demonstrating the delete functionality.

```jsx
import axios from "axios"

function App() {
  const deleteHandler = () => {
    axios
      .delete("https://jsonplaceholder.typicode.com/posts/1")
      .then(response => {
        console.log("deleted successfully!")
      })
  }

  return (
    <div>
      <button onClick={deleteHandler}>Delete</button>
    </div>
  )
}

export default App
```

You can call the delete API as shown above.

## Deleting using async await

If you want to use async await syntax, you can use the following code:

```js
const deleteHandler = async () => {
  const response = await axios.delete(
    "https://jsonplaceholder.typicode.com/posts/1"
  )
  console.log("deleted successfully!")
}
```

## Passing header while deleting

If you need to pass any headers to the delete request, you can do it as shown below:

```js
const deleteHandler = () => {
  const headers = { foo: "bar" }
  axios
    .delete("https://jsonplaceholder.typicode.com/posts/1", { headers })
    .then(response => {
      console.log("deleted successfully!")
    })
}
```

## Error handling which calling delete API

You can add a catch callback to handle errors:

```js
const deleteHandler = () => {
  const headers = { foo: "bar" }
  axios
    .delete("https://jsonplaceholder.typicode.com/posts/1", { headers })
    .then(response => {
      console.log("deleted successfully!")
    })
    .catch(error => {
      console.log("Something went wrong", error)
    })
}
```

If you are using async-await syntax, then you can wrap the code inside a try-catch block:

```js
const deleteHandler = async () => {
  try {
    const response = await axios.delete(
      "https://jsonplaceholder.typicode.com/posts/1"
    )
    console.log("deleted successfully!")
  } catch (error) {
    console.log("Something went wrong", error)
  }
}
```
Javascript Tagalog - Break Statement
Tags: javascript, tagalog, filipino, break
Published: 2022-08-13 05:54:33

**Ano ngaba ang Break Statement sa Javascript?**
Yung break na keyword ginagamit siya sa mga loops,switch para ma skip ang execution... something like that

Sa tingin ko yung best way para ma-understand niyo yung break statement ay to show it to you nalang

---

**Break Statement sa while loop (also works on for loops ofcourse**)

**Without Break**
![Javascript Tagalog - Break Statement](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50ay8p3ul2wuyxv4ju6s.png)

**With Break**
![Javascript Tagalog - Break Statement](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fzjll00ayholwlg3qgt.png)

Naterminate yung execution kasi na execute yung break sa block ng  if condition therefore 1,2,3,4 nalang yung na console.log. 

---

one thing to note that if yung while loop ay nasa loob ng function tapos may "Break" sa loob ng while loop. Yung effect ng Break non ay enclosed lang sa while loop and di pwedeng maapektuhan yung execution ng function

![Javascript Tagalog - Break Statement](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrzhgf0c21ktf5rftxtf.png)

---

**Break on switch statement**
![Javascript Tagalog - Break Statement](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2q4gox066ks2fezw6srd.png)
Break sa switch statement na kapag na fullfill na yung case e-execute nayung codeblock, in this case it is `console.log('x is 2') then break na in return be break na yung switch statement

---
**More tagalog Javascript Learning Resources:**
https://javascript-methods-in-tagalog.vercel.app/
30. Leetcode solution in CPP
Tags: cpp
Published: 2022-08-13 05:31:03

```
class Solution {
public:
    vector<int> findSubstring(string s, vector<string>& words) {
        vector<int> res;
        unordered_map<string, int> dict;
        int len = words[0].size();
        int n = s.length(), m = words.size();
        for (const string& word : words) {
            dict[word]++;
        }
        for (int i = 0; i < len; i++) {
            int cnt = 0;
            unordered_map<string, int> copy = dict;
            for (int j = i; j <= n - len; j += len) {
                string cur = s.substr(j, len);
                copy[cur]--;
                if (copy[cur] >= 0) {
                    cnt++;
                }
                
                int pop_start = j - m * len;
                if (pop_start >= 0) {
                    string pop_word = s.substr(pop_start, len);
                    copy[pop_word]++;
                    if (copy[pop_word] > 0) {
                        cnt--;
                    }
                }
                if (cnt == m) {
                    res.push_back(pop_start + len);
                }
            }
        }
        return res;
    }
};
```
#leetcode
#challenge
here is the link for the problem: 
https://leetcode.com/problems/substring-with-concatenation-of-all-words/submissions/
Sweater By BAPE
Published: 2022-08-13 05:11:00

*Want some style inspiration?* Check this out. Sweatshirts add variety and make you stand out. Besides being trendy, Bape sweatshirts are also warm. Visiting or living in a cold place will require you to wear many wearables. An ape sweater looks great with sweatpants and a bape sweatshirt.
Bape sweaters: what's your take? Do you love them too? In addition to being super comfy, their style is cool too. There's nothing like a Bape sweatshirt to keep you warm this winter, especially if you're in need; check out our collection to find your next favorite. Clothing item. [Bape Hoodie](https://bapehoodie.uk/) a Bathing Ape sweatshirts look good no matter what you're wearing. Fashionably speaking, bape sweaters are extremely popular. They've been worn by rappers and celebrities for years. The official Bape Hoodie website sells Bape products.
How to open rails console in safe mode on GCP k8s
Published: 2022-08-13 04:25:00

Here is how to open rails console in safe mode on GCP k8s.

First you need to list the pods: 

```bash
kubectl get pods | grep <name>
```
replace <name> with the name of the pod that you want to connect with rails console.
In the list that you see copy the name of one of the pods. 

Then you can execute

```bash
kubectl exec <pod_name> -i -t -- rails c --sandbox
```

This will open your rails console in sandbox mode. 

**Futher read: **

1. Read  [here](https://guides.rubyonrails.org/command_line.html#bin-rails-console)  more about rails console with sandbox.

2. Directly execute locally `rails console --help` to see all available options.

---
*This works so far up until and including Rails 6. Did not tested this yet on Rails 7.*
Minimal OpenShift 4.x Multi Node Cluster Set up on AWS for personal practices
Tags: beginners, devops, aws, openshift
Published: 2022-08-13 04:21:01

I tried a lot to run OpenShift 4.x Cluster using CRC on my local system. But it requires lot of resources as well as you will not get the feeling of working on multi node cluster.

If you go to ROSA (RedHat OpenShift On AWS), it's a production level cluster & it costs too much because of its intensive resource usage. That's why I did various testing to find out the best possible way to provision OpenShift 4.x cluster on AWS which will save extra costs. 

- Check out the detailed procedure: https://faun.pub/basic-openshift-4-cluster-setup-on-aws-7b8ea694fd41

Note: All my blogs are free to read.
Mirror Shine on Hover
Tags: css, html, beginners
Published: 2022-08-13 04:05:19

Today, I am going to show you how to create mirror shine effect on hover.

##HTML
```html
<div class="glass-shine-effect"></div>
```
> Important thing to note is `:before` and `:hover` styling. 

##SCSS
```scss
.glass-shine-effect {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(107, 107, 107, 0.37);
  backdrop-filter: blur(6px); // Just for effect
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  height: 125px;
  width: 125px;
  cursor: pointer;
  position: relative;
  transition: transform 200ms ease;
  overflow: hidden;
  &:before {
    content: "";
    position: absolute;
    height: 150%;
    width: 50px;
    transform: rotate(30deg);
    background-color: rgba(255, 255, 255, 0.2);
    left: -100px;
  }
  &:hover {
    transform: scale(1.1);
    &:before {
      transition: left 500ms ease;
      left: 170px;
    }
  }
}
```
##CSS
```css
.glass-shine-effect {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(107, 107, 107, 0.37);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 125px;
  width: 125px;
  cursor: pointer;
  position: relative;
  transition: transform 200ms ease;
  overflow: hidden;
}
.glass-shine-effect:before {
  content: "";
  position: absolute;
  height: 150%;
  width: 50px;
  transform: rotate(30deg);
  background-color: rgba(255, 255, 255, 0.2);
  left: -100px;
}
.glass-shine-effect:hover {
  transform: scale(1.1);
}
.glass-shine-effect:hover:before {
  transition: left 500ms ease;
  left: 170px;
}
```

That's it. You can check out working demo [here on codepen](https://codepen.io/raghavbhardwaj/pen/yLKRBMq).
Fix license agreement issue on Flutter Doctor
Published: 2022-08-13 02:11:24

If you run `flutter doctor` after the fresh flutter installed  on your machine, you might encounter an error says `license agreement not satisfied` or even strange error says `Exception in thread "main" java.lang.NoClassDefFoundError`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxf0nurzbgxp55w84fcf.png)



## Here is how i fixed it

1. install `Android SDK command line tools (latest)`on your Android studio
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhcdtg2jhepyctiuflbx.png)

2. run `flutter doctor --android-licenses`

> It might not work right away after you run this command so you need to "Accept the license agreements" manually

> press Y to review what agreement not satisfied 
and simply press y and enter all the way through :)

Finally, check if that license error thing is gone by running `flutter doctor` again.

I hope this simple walkaway might be helpful to some of you guy struggling to setup flutter to work seamlessly, so enjoy and have a good day with Flutter :)
Ministry of JavaScript
Tags: javascript, react, nextjs, webdev
Published: 2022-08-13 03:56:00

We have created a youtube channel, in which we have covered almost all the main topics of JavaScript development, by learning these topics you can be able to master your coding interviews.

https://www.youtube.com/channel/UC9WtUscS9EUCaJuazSYjUlQ

We are currently working on TypeScript series along with ReactJS and NextJS.
Érase una vez Brew Doctor y el Warning: ‘config’ scripts exist …
Tags: macos, terminal, homebrew, python
Published: 2022-08-13 03:38:00

Es algo frustrante cuando quieres tener tu amada terminal de macOS pulcra y libre de errores y al realizar el comando “brew doctor” aparece lo siguiente:

```bash
+ ➜ brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don’t worry or file an issue; just ignore this. Thanks!

Warning: “config” scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following “config” scripts:

 /Users/rigelgc/.pyenv/shims/python3.10-config
 /Users/rigelgc/.pyenv/shims/python3.9-config
 /Users/rigelgc/.pyenv/shims/python-config
 /Users/rigelgc/.pyenv/shims/python3-config

```
Puede verse más o menos así, no comprendo del todo a que se debe el error, según entiendo brew doctor es como la vecina comunicativa de la cuadra, en lugar de buscar únicamente en los directorios de entorno:

```bash
/usr/local/bin
/usr/sbin
/usr/bin 
/bin 
/sbin
```

Va y se mete en otros directorios, donde nadie le llama, y crea problemas donde no los hay 😒.

Quedó muy ruda mi explicación, mis vecinos son buena onda, disculpa si alguno se pudo sentir ofendido. Cualquier parecido con la realidad es mera coincidencia 🤣

En fin, para solucionar esto solo basta una línea de código; ahora bien, también dependerá de sí utilizas **zsh** ó **bash**, por defecto las nuevas versiones de macOS ya vienen con zsh, pero si utilizas un macOS anterior al 10.15 Catalina posiblemente tengas bash.

Agregaremos un alias a nuestro archivo **~/.zshrc** (ò si utilizas bash al archivo **~/.bash_profile**) del siguiente modo.

```bash
+ ➜ vim ~/.zshrc
```

y añadimos:

```bash
alias brew='PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin brew'
```

Básicamente lo que hacemos es decirle a nuestra vecina que solo revise en esas carpetas y nada más 🙊

Reiniciamos la terminal y _voila_!



Esta solución la obtuve de este [link](https://is.gd/Ta2ngx), pero literal está en chino jaja
Day 4/100 day of SwiftUI
Tags: 100daysofcode, swift, ios, mobile
Published: 2022-08-13 02:47:16

Mission log 4.

**Type Annotation**

> _Type annotation let us state what data type we want for our variable and constant._

example:
```swift
var name: String = "Opeyemi"
```

Type inference is when swift is able to figure out the data type of a variable or constants, based on value we assign.

example:

```Swift
var name = "John Doe"
```
From the snippet above , swift will infer the data type to be String, because we assign text value to the variable.