teleren/devto huggingface dataset:
Simple Ecommerce site using Atlas search
Tags: atlashackathon
Published: 2022-01-13 23:59:49

[Instructions]: # (To submit to the MongoDB Atlas Hackathon on DEV, please fill out all sections.)


### Overview of My Submission
I build an ecommerce site very simple to get to know the atlas search feature. Thank you DEV and MongoDB for  this event is was great to participate. 
Demo here: https://polar-wave-18778.herokuapp.com/


### Submission Category: 

E-Commerce Creation


### Link to Code

 https://github.com/davidildefonso/hackatondev-ecommerce


### Additional Resources / Info

MERN stack used also tried to use typescript without success, still a noobie.

Thank you for reading !
Switching to Linux: Part 2 - the community
Tags: linux, operatingsystems, opensource
Published: 2022-01-14 07:17:48

Continuing on from the post yesterday, I thought I'd drop some links for, what I find valuable sources of information. If you've been following the Linux community for a while, you probably know some of them already. Feel free to contribute your favorites in the comments :)

## Sites

Distrowatch: News on new and updated distros
https://distrowatch.com/

Phoronix (news site):
https://www.phoronix.com/scan.php?page=home

GamingOnLinux:
https://www.gamingonlinux.com/

UbuntuHandbook: 
https://ubuntuhandbook.org/

Reddit Linux Subreddit (news, not for support):
https://www.reddit.com/r/linux/

Reddit: the LinuxQuestions subreddit (support forum)
https://www.reddit.com/r/linuxquestions/

LWN - news:
https://lwn.net/

Linux from Scratch:
https://www.linuxfromscratch.org/lfs/
Build your own Linux distro - sort of like a guided tour, not really for beginners, but you'll get a sense of how open & modular the platform is.

Linux Kernel hacking:
https://kernelnewbies.org/KernelHacking

Linux Today - news
https://www.linuxtoday.com/

Linux.org - community site
https://linux.org

LinuxDocs.org
http://linuxdocs.org/
Old site, but does still contain some cool tricks e.g. how to do kernel patches

---------------------------------

## Youtube channels:

LearnLinuxTV
https://www.youtube.com/user/JtheLinuxguy

Old Tech Bloke
https://www.youtube.com/channel/UCCIHOP7e271SIumQgyl6XBQ

This Week in Linux - news
https://www.youtube.com/channel/UCmyGZ0689ODyReHw3rsKLtQ

Linux Gamecast
https://www.youtube.com/channel/UC9F5SkQPgG1besItGOVkz0A

Linux Experiment
https://www.youtube.com/c/TheLinuxExperiment

DistroTube
https://www.youtube.com/distrotube

Brodie Robertson -
https://www.youtube.com/user/JtheLinuxguy
detour
Published: 2022-01-30 07:15:39

thought i was going to be making logic for spawning player pregame pawns tonight. but i freaked out, i realized in a quest to maximize the playable area of a phone, i had derived the size of my play area by the resolution size. this gave me anxiety about how different players my visualize the game, the layout of enemies, etc. i wasn't sure how to square this without having the black bars. then after some digging, i realized that 16:9 is by far and away the most common resolution ratio. so i believe as long as i play to that, i should be ok. 

gonna play some apex.
Why I am starting #100daysofblogging
Tags: writing, write, javascript, webdev
Published: 2022-01-30 09:58:58

Hi guys, I am Rajat. I am 28 and currently unemployed. I started learning web-development from this month itself (I know I am bit late to the party) and I don't have any IT or CS degree. previously, I used to work as officer at a bank in Delhi and got relieved on 5th January 2022 after serving for 2.5 years.

I am currently doing #100daysofcode challenge on twitter and also like to extend one more challenge to myself that is #100daysofblogging.
Yaa! you heard it right. I am going to publish one blog each day for 100 days straight. 

Just announcing it publicly (to make it more real for me).

So, Why I am doing this:

1. Because writing is a superpower. It gives structure to my thoughts and hence enable me to think and speak with clarity which in turn makes me a better coder (because I think coding is mostly just thinking clearly). 

2. Although most of the times writing is just hard and taxing, I love going through the process.

3. I think it will unlock more opportunities for me.

4. Along with writing, consistency is also a superpower😀.


This is the first day and I don't have anything to write. So, I thought why not to announce #100daysofblogging on dev.to.


PS: My blogs will follow my web development journey. Hence, I will write mostly about javascript, react and web development in general. If you are learning web-development, follow this blog and I am sure it will add value.

My twitter handle: @therajatg
If you are the linkedin type:  https://www.linkedin.com/in/therajatg/

Have an amazing day ahead 😀!
[BTY] Day 5: Lessons when you're learning code
Tags: betterthanyesterday
Published: 2022-01-30 10:49:13

_This post was for 28.01.2022_

Those lessons are from a Youtube video I came across recently.

Link here: https://www.youtube.com/watch?v=s6dMWzZKjTs&list=PL0s6MZJVJ8HZ0eYoUt3KM8WR1AQJWQnXc&index=5

**Lesson 1: Don't learn things randomly,** 
but follow a pre-made roadmap or a structured path because you will be able to see your progress.

**Lesson 2: Focus on one thing at a time**. 
Stay on one subject until you have a decent grasp of the basics

**Lesson 3: Be an active learner.** 
Don't just passively consume content. Sitting back and watching an instructor go through materials without trying anything yourself is not going to get you very far.

**Lesson 4: Don't just memorize**. 
It's normal to use Google, StackOverFlow. 

**Lesson 5: Build stuff**. 
Of course. Learning by doing!
How to create stored procedure in mysql with example
Tags: mysql
Published: 2022-01-30 13:44:04

A procedure often called a stored procedure is a collection of pre-compiled SQL statements stored inside the database. It is a subroutine or a subprogram in the regular computing language. 
[
Mysql Database](https://kodblems.com/10287/how-to-create-stored-procedure-in-mysql-with-example)
ES6: Object destructing
Tags: tutorial, begginers, javascript, webdev
Published: 2022-01-31 20:19:50

## Introduction

In this blog article, we shall learn about Object destructing in JavaScript. Object destructuring syntax was introduced in ES6 to make accessing Object properties much easier and cleaner

## Object destructing

In pre-ES6, normally you'd read object properties and store the values associated to these properties in a variable like this:
```typescript
// some code omitted
const result = {
  userId: 'dummy_id_001`,
  username: 'foo_bar'
  avatar: 'https://gravatar/xrkpxys/k1szh.png',
  accent: '#fff'
}

// reading a few properties off this object literal: pre-es6
var username = result.username
var accent = result.accent
```

In ES6, the above becomes:
```typescript
// some code omitted
const result = {
  userId: 'dummy_id_001`,
  username: 'foo_bar'
  avatar: 'https://gravatar/xrkpxys/k1szh.png',
  accent: '#fff'
}

// reading a few properties off this object literal: pre-es6
let {username, accent, userId} = result
// now use username, accent as normal variables
```

This is useful especially if you need to read more than one property from the same object.

## Summary
Object destructuring syntax provides a cleaner way of accessing more than one property off an object literal.

Use object destructuring when accessing more than one property of an object and pre-ES6 syntax(using the "dot" operator) when accessing only one object.

```typescript
// possible code ommitted
const username = result.username // OK for single property
const {accent, avatar, userId} = result // use object destructing
```
***
Found this article helpful? You may follow my twitter handle [@nkmurgor](https://twitter.com/nkmurgor) where I tweet about interesting topics on web development.
modern and easy user login validation
Tags: javascript, webdev, react, css
Published: 2022-02-01 17:55:51

I made modern user login validation powerd by volder npm package 

volder: [https://github.com/devSupporters/volder](https://github.com/devSupporters/volder)
project link to github: [https://github.com/alguerocode/js-volder](https://github.com/alguerocode/js-volder)

![login](https://user-images.githubusercontent.com/75932477/152019675-586596f1-1670-403a-815f-a00b69302740.gif)

**volder** is powerful Object schema validation, it lets you describe your data using a simple and readable schema and transform a value to match the requirements, it has custom error messages, custom types and nested schemas.
How to display different components based on user authentication
Tags: react, rails
Published: 2022-02-02 02:56:16


Hey there! Ever want to display different components based on whether or not your user is logged in? Well, you're in the right spot. Let's dive right in.

To start off, you're going to want your two different components that you'll be displaying based on user authentication. For this example the two components I'm using are `<LoggedOut/>` and `<LoggedIn/>`. Next step is we need a route on the backend to render current user info. For this example the route I used is `/me` and heres what that looks like in my user controller:
```
def me
        if current_user
            render json: current_user, status: :ok
        else
            render json: {error: "Not logged in"}, status: :unauthorized
        end
    end
```

From here, what we're going to be doing is fetching to this route `/me` to find out if our user is logged in, and if our user is logged in we're going set our current user to that and render our page based on that. That probably didn't make much sense but lets step through the code together.
In our App.js here is what we do:
We're starting off by setting 2 states 
```
const [currentUser, setCurrentUser] = useState(null);
```
Now we're going to fetch to our `/me` route to figure out if our user is logged in or not, and based on that info: if the user logged in we're setting our current user to that data, and if not then our current user remains null:
```
useEffect(() => {
    fetch("/me", {
      credentials: "include",
    }).then((res) => {
      if (res.ok) {
        res.json().then((user) => {
          setCurrentUser(user);
        });
      }
    });
  }, []);
```
then in our `return()` we're going to dynamically render the elements based on if currentUser is a truthy value or a falsey value:
```
return (
      <>
        {currentUser ? (<LoggedIn/>) : (<LoggedOut/>)}
      </>
  );
```
and that's all you need!

You can change the names for LoggedIn and LoggedOut to be whatever components you want to render based on if you're user is logged in or not. I hope this helped you out in any way and appreciate you following to the end!
A Quick 10-Second Programming Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-02-02 08:00:28

---
title: "A Quick 10-Second Programming Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259620ca4d.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Where does the pirate stash all of their digital treasures?

___A:___ RAR
 -->
Creating a Great Developer Experience Beyond the Portal
Tags: webmethods, apimanagement, apigateway, apiportal
Published: 2022-02-08 11:11:22

---
title: Creating a Great Developer Experience Beyond the Portal
published: true
date: 2022-02-02 11:15:59 UTC
tags: webmethods, apiManagement,apiGateway, apiPortal
canonical_url: https://tech.forums.softwareag.com/t/creating-a-great-developer-experience-beyond-the-portal/254951
---
**Part 2 of the “Improving the API Developer Experience” Series**

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

[https://www.youtube.com/embed/r3zHPgZUPiE](https://www.youtube.com/embed/r3zHPgZUPiE?autoplay=1&feature=oembed&wmode=opaque)



You likely already understand the value of deliberately designing end-user experiences. But when it comes to offering APIs to your partners and developers, are you putting out the welcome mat at the wide-open front door? Or forcing them to shove their way through the shabby side entrance?

In this webcast Dr. Matthias Biehl, Software AG’s Digital Evangelist for APIs/Integration, explores the multiplier effect developers have on any digital strategy attempting to create a platform business, participate in digital ecosystems or offer APIs as products.

You’ll also learn many other reasons your developers require a superior experience, as well as how to provide it via:
-Consistent API portfolios
-Self-service developer portals

•       Read blog post about API Developer Experience: https://blog.softwareag.com/api-developer-portal
•       To learn more about API's from Software AG, https://www.softwareag.com/en_corporate/platform/integration-apis.html
•       To view more Software AG webinars, please visit https://www.softwareag.com/en_corporate/company/events.html

[Visit original post](https://tech.forums.softwareag.com/t/creating-a-great-developer-experience-beyond-the-portal/254951)
Switching off RSpec generators 
Published: 2022-02-02 16:56:43

---
title: Switching off RSpec generators 
published: true
description: 
tags: 
//cover_image: https://direct_url_to_image.jpg
---

Finding the correct switch to turn off RSpec generators can be hard as it is sparsely documented. [However, RSpec has a number of generators that are listed in this file.](https://github.com/rspec/rspec-rails/blob/5-1-maintenance/lib/generators/rspec/scaffold/scaffold_generator.rb)

```ruby
# rspec-rails: lib/generators/rspec/scaffold/scafold_generator.rb
class_option :controller_specs, type: :boolean, default: false, desc: "Generate controller specs"
class_option :request_specs,    type: :boolean, default: true,  desc: "Generate request specs"
class_option :view_specs,       type: :boolean, default: true,  desc: "Generate view specs"
class_option :helper_specs,     type: :boolean, default: true,  desc: "Generate helper specs"
class_option :routing_specs,    type: :boolean, default: true,  desc: "Generate routing specs" 
```

You can then use the list to switch off generators in `application.rb`.

```ruby
config.generators do |g|
  g.test_framework :rspec
  g.controller_specs false
  g.request_specs false
  g.view_specs false
  g.helper_specs false
  g.routing_specs false
end
```
Powershell find size logs and delete
Tags: powershell, script, logs, azure
Published: 2022-02-03 01:30:39

This script is for list or delete logsfiles. You can change parameters to adjust code for You need.


###Invoke-Comman for many host

```css
$machines = @(
    'COMPUTER_NAME_1',
    'COMPUTER_NAME_2'
)
foreach ($machine in $machines) {
    Invoke-Command -ComputerName $machine -ScriptBlock {
         
        Write-Host "Host: $env:COMPUTERNAME ($(Get-Date -Format “MM/dd/yyyy”)) "  -foregroundcolor "green"
        
        #LIST SIZE
        $path ='C:\logs'
        $days = -7  #numer days you can preserve in negative - last 7 days
        $t = ((Get-Childitem -Path $path -Recurse -Include *.log  | Where { $_.Length / 1gb -gt 0 } | Measure-Object Length -Sum | Where-Object LastWriteTime -LT (Get-Date).AddDays($days) | select-object -ExpandProperty Sum)/1GB).ToString('0.00')
        Write-host "Total Size: $t GB " -NoNewline -foregroundcolor "yellow"
        Write-host "PATH: $path"


        #DELETE
        $path ='C:\logs'
        $days = -7  #numer days you can preserve in negative - last 7 days
        $t = ((Get-Childitem -Path $path -Recurse -Include *.log  | Where { $_.Length / 1gb -gt 0 } | Measure-Object Length -Sum | Where-Object LastWriteTime -LT (Get-Date).AddDays($days) | select-object -ExpandProperty Sum)/1GB).ToString('0.00') | -Remove-Item -recurse
        Write-host "Total Size: $t GB " -NoNewline -foregroundcolor "yellow"
        Write-host "PATH: $path"

    }
}
```

###LOCAL HOST or Enter-PSSession <ComputerName>

```css
Write-Host "Host: $env:COMPUTERNAME ($(Get-Date -Format “MM/dd/yyyy”)) "  -foregroundcolor "green"
        
        #LIST SIZE
        $path ='C:\logs'
        $days = -7  #numer days you can preserve in negative - last 7 days
        $t = ((Get-Childitem -Path $path -Recurse -Include *.log  | Where { $_.Length / 1gb -gt 0 } | Measure-Object Length -Sum | Where-Object LastWriteTime -LT (Get-Date).AddDays($days) | select-object -ExpandProperty Sum)/1GB).ToString('0.00')
        Write-host "Total Size: $t GB " -NoNewline -foregroundcolor "yellow"
        Write-host "PATH: $path"


        #DELETE
        $path ='C:\logs'
        $days = -7  #numer days you can preserve in negative - last 7 days
        $t = ((Get-Childitem -Path $path -Recurse -Include *.log  | Where { $_.Length / 1gb -gt 0 } | Measure-Object Length -Sum | Where-Object LastWriteTime -LT (Get-Date).AddDays($days) | select-object -ExpandProperty Sum)/1GB).ToString('0.00') | -Remove-Item -recurse
        Write-host "Total Size: $t GB " -NoNewline -foregroundcolor "yellow"
        Write-host "PATH: $path"

        
```
Move from one fragment to another
Tags: kotlin, android, beginners, devops
Published: 2022-02-03 10:08:55

I would like to try to create an app.

I want to move from my home (MainActivity where there are the names of the film directors) to fragment using a button (name of the director) to show a list of movie posters;
I want to move from this fragment to another fragment on a click of an Imageview(the poster) to show the plot of the movie.
Can anyone explain to me step by step? I need the code in Kotlin.
Dos and Don'ts of Developer Hiring
Tags: hiring, devops, coredna, devrel
Published: 2022-02-03 23:40:27

As a developer getting hired in an agency can require so much criteria to pass. As an agency, choosing who to hire can require so much investigation to commit. 

Make your like a little easier and give yourself the best fighting chance with your choices with Core dna's blog on the[ 5 Dos and Don'ts of Hiring a Developer](https://www.coredna.com/blogs/5-dos-and-donts-of-hiring-a-developer). Download our free Agency Growth Secrets guide today to answer all your questions!

For instance,
**DO: Consult somebody on your actual position requirements**

First and foremost, if you’re inexperienced in hiring technical talent, it helps to go and find somebody who is experienced to nut out the position description. Often, what we think are the requirements are not what they seem and talking to another developer or technical recruiter can help distinguish whether or not you’re making any unfounded assumptions about the role, overcomplicating the PD or even oversimplifying it. Getting a clear understanding of questions like:

- 
What language skillset/s is required?

- 
What level of seniority is required (i.e. junior, mid, senior developer)?

- 
What development methodology will be used (if working with teams)?
 
…and many other questions will help ensure you’re pre-qualifying your applicants (and not scare off the good ones through ambiguous expectations either!)

## What do you think are the Dos and Don'ts of Developer hiring? Let's start a discussion in the comments!
Quick Poll: Fav/Most Used Python Virtual Environment manager?
Tags: python
Published: 2022-02-05 04:31:13

Hi All,

I've used Anaconda, Minicoda, venv, and pipenv. I'm (mostly) indifferent about which is "better". Now I want to get a point of reference of what other python devs are using and/or prefer.

Is there one you like or use the most?

Is there one your work enforces explicitly?

Is there one outside of this list you prefer or use a lot? If so, what is it and why do you prefer it over the others?

Thanks for helping me learn something new ya'll, I hope your week has gone well!
The importance of seeing red
Tags: tdd, xp
Published: 2022-02-11 22:32:22

---
title: The importance of seeing red
published: true
date: 2022-02-05 00:00:00 UTC
tags: tdd,xp
canonical_url: https://jhall.io/archive/2022/02/05/the-importance-of-seeing-red/
---

Today I was working on a small REST service for a client. As I follow Test-Driven Development, the first thing I wanted to do when adding a new endpoint was add a function to test it. Of course I already have several test functions, so I copied one to modify for my new endpoint.

I renamed the test function, and deleted all the specific test cases. Then I copied the first test case from another endpoint into the new endpoint. It was just a test to ensure that I’d get a `415 Unsupported Media Type` response if I sent a non-JSON payload.

I also copied the content-type check logic from another function into the new one, then ran the test. It passed. Obviously. So I went on to the next step.

I added a new test, this time to return a `400 Bad Request` if I sent invalid JSON to the endpoint.

And I ran the test… and it passed.

Wait, what?

I hadn’t added yet told the new endpoint to parse JSON. What’s going on?

* * *

It turns out I had cheated a bit above. When I wrote my first test case, I didn’t actually validate that it failed before I added the code to make it pass. So when it _did_ pass, I wasn’t surprised… **even though it was a completely invalid test**.

You see, I had forgotten to update the copy-pasted test code to call the new endpoint. It was still calling the old endpoint, which _also_ had a content-type check. And it _also_ did JSON parsing.

This isn’t the only time I’ve tried to take a TDD shortcut. These shortcuts always bite me in the rear end.

There’s a reason for the “Red - Green - Refactor” cycle of TDD. Every one of those steps is there for a reason. Skipping Red invalidates the TDD cycle!

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._