teleren/devto huggingface dataset:
Sinatra Project
Published: 2021-03-28 18:16:21

I just got my sinatra project done for Flatiron School. My project was called Cars Nation. I'm very interested in cars and have built a few in my life. I chose 3 very famous car collectors for my project. 

To start the project I ran corneal to get the simple layout for my project. I ran into a few issues with corneal. For example I had to update everything to only run sqlite3 so there weren't multiple databases, I had to update Active Record, and had to change some code in my config.ru file so it worked properly. I also had to create a database yml file to get corneal to work.

After I sorted these issues I got to work. First I built out my controllers and models. There was a lot of issues within them and are still a few issues on the localhost that I need to fix. I then did .erb files to render everything. I should've done the rendering while I was doing the controllers so I didn't run into issues or as many issues. There are currently a few issues with params and "," and stuff like that. 

Lastly I seeded my data in the end and used tux to make sure everything actually worked and had a id like it should. I added some pictures and some comments on the car collections. 
Now I am working to finish up the little errors and preparing for my review.

Overall I ran into lots of issues but some help, google, and debugging helped me very much to fix these issues. A lot of my issues were very easy to read cause it specifically said where and on what line the issues were. I'm about done with project just changing some layout stuff and little errors. The project was difficult but it wasn't horrible because I know it's going to help me with ruby on rails. The project also taught me to look at key errors and helped me with debugging. On to the review!!
Coding Shorts: Demystifying Bitwise Operators in C#
Tags: coding, softwaredevelopment, tutorials, videos
Published: 2021-03-28 22:42:11

---
title: Coding Shorts: Demystifying Bitwise Operators in C#
published: true
date: 2021-03-28 17:47:08 UTC
tags: Coding,SoftwareDevelopment,Tutorials,Videos
canonical_url: http://wildermuth.com/2021/03/28/Coding-Shorts-Demystifying-Bitwise-Operators-in-C
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86bws0hxwcpt1i39efvn.jpg
---

I have a new episode of my "Coding Shorts" series on YouTube. In this episode, I dig into something a little more esoteric: Bitwise operators. I show how binary math works and how it relates to enumerations (with Flags).

Enjoy!

<iframe src="https://www.youtube.com/embed/qWCUoLCRY38" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

[![Creative Commons License](http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png)](http://creativecommons.org/licenses/by-nc-nd/3.0/)

 This work by [Shawn Wildermuth](http://wildermuth.com) is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License](http://creativecommons.org/licenses/by-nc-nd/3.0/).  
 Based on a work at [wildermuth.com](http://wildermuth.com).

* * *

If you liked this article, see Shawn's courses on [Pluralsight](http://shawnw.me/pscourses).
 ![](http://feeds.feedburner.com/~r/ShawnWildermuth/~4/_On44Y3ja_w)
Resolving E404 on global install of a private npm package (Linux)
Tags: javascript, node, webdev, linux
Published: 2021-03-28 17:46:28

I was logged into npm (via `npm login`) and went to do a global install of one of my private packages (`npm i -g`), only to be confronted with an `E404` NOT FOUND error.

After some initial confusion, I realized it was because my setup requires using `sudo` for global npm installs: `sudo` makes you take on the role of the root user, and so it doesn't have access to your regular user's npm credentials!

There are two easy solutions to this:

## Log into npm with `sudo`

The easiest thing to do is to *also* log into your npm account with `root`, so that when you use `sudo` the command will have access to your npm credentials.

```bash
sudo npm login
```

## Stop having to use `sudo` for global installs

It's probably better to not have to use `sudo` at all for your global installs.

To address that, you need npm to use a directory that your regular user has permissions to access. Fortunately, npm makes this easy to do. A handful of people have put together a [super simple guide for this](https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md). In short:

First create a new directory with your regular user and tell npm to use it:

  ```bash
  mkdir "${HOME}/.npm-packages"
  npm config set prefix "${HOME}/.npm-packages"
  ```
Then give npm a little more help finding binaries and such by updating your `.bashrc` file:

  ```bash
  # @file ~/.bashrc
  NPM_PACKAGES="${HOME}/.npm-packages"
  
  export PATH="$PATH:$NPM_PACKAGES/bin"
  
  # Preserve MANPATH if you already defined it somewhere in your config.
  # Otherwise, fall back to `manpath` so we can inherit from `/etc/manpath`.
  export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"
  ```

[The guide](https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md) has more details to help out with other use cases.
File Ops - A VS Code extension to easily tag/alias files & quick switch between files
Tags: productivity, sideprojects, showdev, vscode
Published: 2021-03-28 17:40:07

Hellooo Developers,

I just launched `File Ops` - **A VS code extension to easily tag/alias files & quick switch between files.**

### Overview
1. File Tag - `Tag/Alias/Bookmark` files
2. Quick Switch - Quickly switch between files. ex. Switch between `example.css` & `example.js` using hotkey (Useful if you are a power user)
3. Switch to Related Files - View files from the current directory and switch using hotkey

###Features
#### File Tag
- Create, Open, Edit, Delete file tags using commands.
- Open, View, Edit, Delete file tags from the tree view.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3dxirzmge4y9s5rbp4i.gif)

--- 
#### Quick Switch
Quickly switch between extension pairs. ex., Switch between `.css` & `.js` files in the same folder.
_Extend the functionality by providing custom pairs._

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3sqjyp2y66khv12rbl2.gif)
---
#### Related Files
View all the files from the current directory

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aittwkifwsmjgds6v1ab.gif)
---
Demo - [https://youtu.be/ze9KtYe3f48](https://youtu.be/ze9KtYe3f48)

Download - [https://marketplace.visualstudio.com/items?itemName=mehullakhanpal.file-ops](https://marketplace.visualstudio.com/items?itemName=mehullakhanpal.file-ops)

If you liked the product, please consider upvoting on Product Hunt - [https://www.producthunt.com/posts/file-ops](https://www.producthunt.com/posts/file-ops)

---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for daily posts.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript  
**[codedrops.tech](https://www.codedrops.tech/)**
How to run PHP in Visual Studio Code in 2021?
Published: 2021-03-28 17:26:21

#1) Download and Install XAMPP
You can find the XAMPP installer on the following permalink:
https://www.apachefriends.org/index.html

#2) Create a new project/folder
Go to the <ROOT>xampp\htdocs folder and create a new folder (with your project name)

#3) Create a PHP file inside the project folder
Open vs code in the project folder and create a new PHP file with a .php extension (i.e FileName.php) with the following code
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0r6g7e87xl1dm55fu747.png)

#4) Open XAMPP Control Panel and start Apache server.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8fgs7q2mrl8awsvxw3p.png)
  
#5) Open the browser and search localhost/FolderName/FileName.php
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzpth7bg1k0ubcqez0j6.png)

Congratulations you have successfully created and run your first PHP code using visual studio code🎉.

You can also check my youtube video “how to run PHP in Visual Studio Code in 2021” if any doubt.👇
[![IMAGE ALT TEXT HERE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr9rgnwhkhdqpym0o87p.png)](https://youtu.be/ceEeHn35kBI)
LeetCode Longest Substring Without Repeating Characters
Tags: go, cpp, javascript, leetcode
Published: 2021-03-28 17:18:48

---
title: LeetCode Longest Substring Without Repeating Characters
published: true
description: LeetCode Longest Substring Without Repeating Characters in C++, Golang and Javascript.
tags: #golang #cpp #javascript #leetcode
---

https://alkeshghorpade.me/post/leetcode-longest-substring-without-repeating-characters
Day 89 Of 100DaysOfCode: Written Blog For Another News Portal
Tags: 100daysofcode, codenewbie, womenintech, beginners
Published: 2021-03-28 17:15:20

This is my day 89th day of #100daysofcode and #python learning journey. Like usual, day today also keep learning from DataCamp. 

Written blog for another news portal. I thing I will complete tomorrow. And did practice of code for random topic.
The  link of that blog is [Nepali News (Gorkhapatra) Scrapping Using BeautifulSoup and Python.](https://iamdurga.github.io/2021/03/28/nepali-news-scrapping-gorkhapatra/)
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Day 89 Of <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> and <a href="https://twitter.com/hashtag/python?src=hash&amp;ref_src=twsrc%5Etfw">#python</a><br>Written blog for another news portal<a href="https://twitter.com/hashtag/WomenWhoCode?src=hash&amp;ref_src=twsrc%5Etfw">#WomenWhoCode</a> <a href="https://twitter.com/hashtag/CodeNewbie?src=hash&amp;ref_src=twsrc%5Etfw">#CodeNewbie</a> <a href="https://twitter.com/hashtag/beginner?src=hash&amp;ref_src=twsrc%5Etfw">#beginner</a> <a href="https://twitter.com/hashtag/DEVCommunity?src=hash&amp;ref_src=twsrc%5Etfw">#DEVCommunity</a> <a href="https://t.co/RWofa5nmmj">pic.twitter.com/RWofa5nmmj</a></p>&mdash; Durga Pokharel (@mathdurga) <a href="https://twitter.com/mathdurga/status/1376219756949172225?ref_src=twsrc%5Etfw">March 28, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
How to create a alias for terminal
Tags: terminal, bash, ubuntu, linux
Published: 2021-03-28 17:08:35

In this post i will show you how to create alias for long commands in terminal.
There is two way to do that
1. Use alias command in your terminal
2. Changing the .bashrc file

#1. using alias command in terminal

```bash
alias files=ls
```
it will map **ls** command to files(and the name is completely your personal choice you can use whatever like:-nobita )

but the drawback is you can't use the alias in different terminals you have to use the command in that terminal only

#2.  Changing the .bashrc file

open your root path of the system and find **.bashrc** file (remember it uses '.' in prefix so that file may be hidden for you to show the hidden file press **ctrl+H** in keyboard
then you can show your hidden files)
and write the following command. You can use your own custom alias and  by adding alias directly to your **.bashrc** file you can use the alias in different terminal also
```bash
alias pg="ping google.com"
```
if you use zsh as your default terminal then change **.zshrc** file
AdonisJS vs NestJS | NodeJS API Frameworks
Tags: showdev, javascript, nestjs, node
Published: 2021-03-28 16:50:14

---
title: AdonisJS vs NestJS | NodeJS API Frameworks
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmhjtfshgwz65ge6w181.jpg
published: true
description: In this video we compare AdonisJS 5 head-to-head against NestJS! 
tags: showdev, javascript, nestjs, node
---

[In this video](https://youtu.be/Zfl4Wwcqfoo) we compare AdonisJS 5 head-to-head against NestJS (with ExpressJS and TypeORM behind the scenes) and see which one comes out on top! 

If you've been trying to decide which of these two Typescript-based frameworks to use, this is the content for you!

### Topics covered include:
- Starting a project
- CRUD
- Routing and Controllers
- Exception Handling
- Request body, query params, url params
- Validation
- Inversion of Control and Dependency Injection
- Testing

... and more!

## You can watch here:

{% youtube Zfl4Wwcqfoo %}
Four Ways To Make An API Calls In Javascript
Tags: javascript, codenewbie, html, ajax
Published: 2021-03-28 16:32:36

Hello developers!! In this post, we'll discuss various ways to make an API call for your next project.

## 🔎 XML HTTP Request

- All modern browsers support the XMLHttpRequest object to request data from a server.
- It works on the oldest browsers as well as on new ones.
- It was deprecated in ES6 but is still widely used.

```javascript
var request = new XMLHttpRequest();
request.open('GET', 'https://api.github.com/users/anuradha9712');
request.send();
request.onload = ()=>{
    console.log(JSON.parse(request.response));
}

```

## 🔎 Fetch

- The Fetch API provides an interface for fetching resources (including across the network) in an asynchronous manner.
- It returns a **Promise**
- It is an object which contains a single value either a **Response** or an **Error** that occurred.
- **.then()** tells the program what to do once Promise is completed.

```javascript
fetch('https://api.github.com/users/anuradha9712')
.then(response =>{
    return response.json();
}).then(data =>{
    console.log(data);
})
```

## 🔎 Axios

- It is an open-source library for making HTTP requests.
- It works on both Browsers and Node js
- It can be included in an HTML file by using an external CDN
- It also returns promises like fetch API

```html
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

```

```javascript
axios.get('https://api.github.com/users/anuradha9712')
.then(response =>{
    console.log(response.data)
})
```

## 🔎 jQuery AJAX

- It performs asynchronous HTTP requests.
- Uses `$.ajax()` method to make the requests.

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
```

```javascript
$(document).ready(function(){
    $.ajax({
        url: "https://api.github.com/users/anuradha9712",
        type: "GET",
        success: function(result){
            console.log(result);
        }
    })
})
```

## Wrap Up!!

Thank you for your time!! Let's connect to learn and grow together.

[LinkedIn](https://www.linkedin.com/in/anuradha-aggarwal-4a2751107/) [Twitter](https://twitter.com/Anuradh06359394)
[Instagram](https://www.instagram.com/blogcode404/)

[![Buy-me-a-coffee](https://cdn.buymeacoffee.com/buttons/v2/default-blue.png)](https://www.buymeacoffee.com/anuradha2612)
4 Super Useful Python Features
Tags: python, programming, datascience, tutorial
Published: 2021-03-28 16:17:51

Python is a wonderfully easy-to-read language and increasingly the go-to for many programmers.

However, this ease of use and mass adoption results in some really useful functionalities getting lost in the noise.

Here are four super useful functionalities that I have been using more and more over the last few months.

{% medium https://towardsdatascience.com/4-super-useful-python-features-993ae484fbb8 %}

[Friend Link (free access)](https://towardsdatascience.com/4-super-useful-python-features-993ae484fbb8?sk=e88e672de2a996437fb67bc2c20abdd1)
Singing the praises of gdu
Tags: gdu, ncdu, tools, linux
Published: 2021-03-28 16:03:50

---
title: Singing the praises of gdu
published: true
date: 2021-03-28 15:52:12 UTC
tags: gdu,ncdu,tools, linux
canonical_url: https://kylerconway.com/2021/03/28/singing-the-praises-of-gdu/
---

I’m a long-term _[ncdu](https://dev.yorhel.nl/ncdu)_ user, but I recently discovered _[gdu](https://github.com/dundee/gdu)_ which is much faster. This isn’t to say ncdu is bad or undesirable anymore, but for most cases I’ll be replacing _ncdu_ with _gdu_ moving forward for the speed advances alone.

If you haven’t seen either of these tools I suggest you check them out. They’re fantastic for quickly identifying directories and files that are taking up the most space on your hard disks via the command line in a more visual way that makes it easy to both find and delete unneeded files and directories.

[![](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-42-43-1024x169.png)](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-42-43.png)<figcaption><em>A sample output looking in a home directory (gdu is shown).</em></figcaption>

You can navigate into and out of sub-directories that are also calculated and use keyboard shortcuts for all relevant actions.

[![](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-42-56-1024x531.png)](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-42-56.png)<figcaption><em>gdu keyboard shortcuts — accessible from the application by pressing “?”</em></figcaption>

I’ve shown _gdu_ here because I’m newly enamored by it, but _ncdu_ still has more features even though it is truly slower.

- [![](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-46-23-1024x524.png)](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-46-23-1024x524.png)

- [![](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-46-33-1-1024x523.png)](https://kylerconway.com/wp-content/uploads/2021/03/Screenshot-from-2021-03-28-10-46-33-1.png)

<figcaption><em>note the extra options in ncdu</em></figcaption>

At any rate, these are both highly recommended applications. I’ve used them on local computers, remote computers via ssh, mounted drives locally (nfs, smb, etc) and on Linux and BSD. I’m currently using this on TrueNAS Core (FreeBSD) and [TrueNAS SCALE (Linux)](https://kylerconway.com/2021/03/24/the-server-that-might-be-truenas-scale/) to generally sort out some erroneous backup strategies I tried over the years.

Bottom line: highly recommended.
Remove White Border From Blurry Background Image
Tags: css, codenewbie, beginners, webdev
Published: 2021-03-28 15:52:00

I was half way through writing about another topic but then got stuck with fixing the white border. 
So I was like okay change of plans!<br>

Now let's talk about the annoying white border!<br>
If you create a blurry background image this will happen :

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7a1sb5nh4tjrrk4458g9.png">

You see those white edges? 
In this article I'll show you how to get rid of them


- First create a simple background image 

```css

.blurry-bg {
    width: 100%;
    height: 100vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.63), rgba(0, 0, 0, 0.623)), url(img/000333.jpg);
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}
```

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o98gke1z6z8k68i1od9s.png">


You could add <code> filter: blur(); </code> but it'll add white edges, like the first pic that I showed you.
So in order to get rid of them We need to use pseudo element and give it backdrop-filter 

```css

.blurry-bg::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100vh;
    backdrop-filter: blur(5px);
}
```

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlc2ztkjo9bn6ehv6kxd.png">

We have successfully managed to get rid of that annoying blurry border.
But let's say you want to add something in front your image , there is a little trick for that, which I'll talk about it in my next week's article . So stay tuned!

<hr>


Someone just pointed out another way of doing this trick and it has better browser support than backdrop-filter 

So instead of setting a background image for blurry-bg , we could just set it for its pseudo element and  then give it <code> filter: blur(); </code>

```css
.blurry-bg::before {
  content: "";
  background-image: linear-gradient(rgba(0, 0, 0, 0.63), rgba(0, 0, 0, 0.623)),
    url(img/000333.jpg);
  position: fixed;
  background-attachment: scroll;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  filter: blur(5px);
  margin: -10px; /* this will do the trick */
}
```

PS. if you use this second trick, you can easily add texts and image in front of your background.

<br>
Credit to this guy :<br>
{% comment 1cp23 %}
Why can't Apple do a patch?
Published: 2021-03-28 15:30:08

The cover image for this post shows updates being recommended for four (4) of the applications on my Mac. They represent 3+ Gb of download from Apple's App Store. So I guess I just wanted to wonder out loud...

At this size, these certainly don't seem to be binary patch files, and if not, why not?

BinaryMisfit on this [StackExchange](https://apple.stackexchange.com/questions/44368/do-apple-software-updates-really-take-up-as-much-space-as-it-shows-in-the-size-c) thread from 2 years ago states the following:

```AppStore updates at the moment is always a complete full version of the new application being downloaded, the copy you have replaced, and the balance trashed.```

This seems really wasteful for the millions of MacOS App Store users' bandwidth and for Apple's bandwidth.

Comments, or insight, appreciated.
Most Handy Ruby Hash Methods
Published: 2021-03-28 15:47:50

**The Handiest Ruby Hash Methods**

Ruby Hash is a dictionary-like collection of unique keys and their values. Also called associative arrays, they are similar to Arrays, but where an Array uses integers as its index, a Hash allows you to use any object type.
It is used so much that it would be beneficial to know and even memorize some of the most commonly used methods for hashes. If you want to know more about Ruby hashes, take a look at [Ruby-Doc](https://ruby-doc.com/core/Hash.html)

for this article our hash will be :
```
languages_creators = { ruby: "Matz", javascript: "Brendan",  python: "Guido" }
```
**.keys**
The .keys method access the keys of the hash
```
languages_creators.keys
[:ruby, :javascript, :python]
```
**.values**
The .values method access the values of the hash
```
languages_creators.values
["Matz", "Brendan", "Guido"]
```
**[key]**
This method gets the value of a certain key, notice we are using the colon since keys are symbols in our hash
```
languages_creators[:ruby]
Matz
```
**.length**
The .length method returns the count of the pair number in the hash
```
languages_creators.length
3
```
**.clear**
The .clear method removes all key-value pairs from the hash
```
languages_creators.clear
{}
```
**.delete(key, or value)**
The .delete method removes the pair based on the given key or the value.
```
languages_creators.delete(:python:)
"Guido"
{:ruby=>"Matz", :javascript=>"Brendan"}
```
**.empty?**
The .empty? method returns true if the hash has no key-value pairs 
```
languages_creators.empty?
false
```
**.has_key?(key)**
The .has_key? method returns true if the hash has the given key
```
languages_creators.has_key?(:javascript)
true
```
**.has_value?(value)**
The .has_key? method returns true if the hash has the given value
```
languages_creators.has_value?("Matz")
true
```

**.member?(key)**
The .member? method returns true if the given key is present in the hash
```
languages_creators.member?(:ruby)
true
```
**.invert**
The .invert method returns a new hash created by using hash values as keys, and the keys as values. 
```
languages_creators.invert
{"Matz"=>:ruby, "Brendan"=>:javascript, "Guido"=>:python}
```

**.to_a**
The .to_a method converts a hash into a nested array.
```
languages_creators.to_a
[[:ruby, "Matz"], [:javascript, "Brendan"], [:python, "Guido"]]
```
**.flatten**
The .flatten method returns a new array that is a one-dimensional flattening of the hash.
```
languages_creators.flatten
[:ruby, "Matz", :javascript, "Brendan", :python, "Guido"]
```
**For More Information**

[Ruby Hash docs](https://ruby-doc.com/core/Hash.html)