teleren/devto huggingface dataset:
Weather-Care app: Self-care advice for the day
Tags: python, beginners
Published: 2023-12-09 15:35:19

This article is a small showcase/explanation of a beginner python project. I hope this can give others ideas for projects of their own, or allow others to take this idea and run with it further.

Weather-Care is a terminal app that takes in the day's weather in a given location to give hair and skin care advice. With that information you can plan your self-care for the day accordingly.

This was made as part of a self-driven project for the Codecademy computer science track. I used the python I learned there along with help from chatGPT to finish the project.


![GIF of app in action](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w98ch714tvchk751trbj.gif)

## Python code
I wanted to apply my OOP knowledge so I split the app into three classes, UserInterface, Weather, and BeautyAdvice.
* UserInterface handles displaying the app in the terminal, taking in user input, using Weather and BeautyAdvice to get results, and displaying the results.
* The Weather class handles getting weather data from an API from OpenWeather. I'm pulling weather data for the current day.
* The BeautyAdvice class is in charge of taking weather data and comparing it to a JSON file of self-care conditions. When a condition is met it is returned as advice to the user. chatGPT was used to get the hair and skin care advice for different weather conditions.
The code also uses the python-dotenv package and a .env file to hide away my API key so that it isn't exposed in the repo.

## Possible Improvements
* Move the app to a web interface
* Somehow use another API to return self-care advice rather than relying on a hardcoded JSON file
* Add personal profiles to get self-care advice better tailored to individuals

## Conclusion
The app is a project that was intended as a learning experience and thus isn't fully featured and break-proof. But it does serve as a starting point for something that I think would be pretty cool and useful.
If you want to try the app you can sign up for the OpenWeatherMap One Call API 3.0 to get an API key that you can drop into a .env file at the root of the app.

[Weather-Care GitHub Repository](https://github.com/lancerharris/Weather-Care)
KillNode Script For React Apps
Tags: webdev, terminal, productivity, bash
Published: 2023-12-09 15:32:57

TL;DR
This is a script to delete a running node process, if one exists. 

```bash
#!/bin/bash

lsof_output=$(lsof -i :3000)

if [ -n "$lsof_output" ]; then
  node_line=$(echo "$lsof_output" | grep "node")

  if [ -n "$node_line" ]; then
    pid=$(echo "$node_line" | awk '{print $2}')

    # Kill the Node.js process with SIGKILL (9)
    echo "Killing Node.js process with PID $pid"
    kill -9 $pid

    echo "Node.js process killed."
  else
    echo "No Node.js process found on port 3000."
  fi
else
  echo "No process is listening on port 3000."
fi
```

It's very useful when running `npm start` to spin up a React app and you get a `Port 3000 is already in use` message.


You can also pair it with the `npm start` command right after it for a better experience. If the port is not in use the script will not do anything.

I went ahead and created an alias for even more convenience, and to do that follow these steps:

1. Open your `.zshrc` or `.bashrc` with: `code ~/.zshrc`
1. Add `alias killnode="killnode.sh && npm start"`
1. Run it from you app's folder

Enjoy 🦾
SQL - Maintain Data Integrity with Constraints
Tags: sql, programming, tutorial, beginners
Published: 2023-12-09 15:30:00

To ensure the integrity and consistency of your database, use SQL constraints such as PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, and CHECK. Constraints help enforce rules and relationships within your data, preventing incorrect or invalid data from being inserted or updated.

Example:
Suppose you have a table called "employees" and you want to ensure that each employee's email address is unique.

Without a Constraint (Potential Data Duplication):
```sql
CREATE TABLE employees (
    employee_id INT PRIMARY KEY,
    first_name VARCHAR(50),
    last_name VARCHAR(50),
    email VARCHAR(100)
);
```

With a UNIQUE Constraint (Enforces Data Integrity):
```sql
CREATE TABLE employees (
    employee_id INT PRIMARY KEY,
    first_name VARCHAR(50),
    last_name VARCHAR(50),
    email VARCHAR(100) UNIQUE
);
```

By adding a UNIQUE constraint to the "email" column, you prevent duplicate email addresses from being inserted into the "employees" table. This ensures that each email address remains unique, maintaining data integrity and preventing data inconsistencies.

SQL constraints are essential for enforcing business rules, maintaining data quality, and preventing errors or conflicts within your database.
10 GitHub Repos to Become a Better Backend Developer
Tags: developer, backend, programming, github
Published: 2023-12-09 15:12:27


1. Awesome Backend Development - A curated list of resources, tools, and frameworks for backend development covering databases, APIs, serverless architecture, and more. 
{% github https://github.com/zhashkevych/awesome-backend?source=post_page-----55c9f5b72cec-------------------------------- %}

2. System Design Primer - Covers system design concepts, resources, articles, videos, and interview questions for building scalable and reliable systems.
{% github https://github.com/donnemartin/system-design-primer?source=post_page-----55c9f5b72cec-------------------------------- %}


3. Clean Architecture - A sample Node.js application demonstrating the implementation of Clean Architecture principles like separation of concerns and testability.
{% github https://github.com/panagiop/node.js-clean-architecture?source=post_page-----55c9f5b72cec-------------------------------- %}

4. RealWorld - Collection of sample applications in different frameworks showcasing backend implementations and best practices.
{% github https://github.com/gothinkster/realworld?source=post_page-----55c9f5b72cec-------------------------------- %}

5. Node Best Practices - Best practices, tips, and tricks for Node.js development covering topics like project structure, error handling, security, and performance. 
{% github https://github.com/goldbergyoni/nodebestpractices?source=post_page-----55c9f5b72cec-------------------------------- %} 

6. Backend Developer Roadmap - Comprehensive roadmap outlining the skills, tools, and concepts needed to become a backend developer.
{% github https://github.com/kamranahmedse/developer-roadmap?source=post_page-----55c9f5b72cec-------------------------------- %}

7. Node.js Best Practices - Guidelines and best practices focused specifically on Node.js development.
{% github https://github.com/goldbergyoni/nodebestpractices?source=post_page-----55c9f5b72cec-------------------------------- %}

8. Awesome Node.js - Curated list of useful Node.js libraries, frameworks, tools and articles. 
{% github https://github.com/sindresorhus/awesome-nodejs?source=post_page-----55c9f5b72cec-------------------------------- %}

9. Backend Engineering Resources - Collection of helpful resources, articles and tutorials related to backend engineering.
{% github https://github.com/shahednasser/awesome-resources?source=post_page-----55c9f5b72cec-------------------------------- %}

10. Project-Based Tutorials in C - Project-based C programming tutorials guiding you to build real-world applications.
{% github https://github.com/chesal/Project-Based-Tutorials-in-C?source=post_page-----55c9f5b72cec-------------------------------- %}

These repositories can boost your backend development skills.
Exploring Panama: A Digital Nomad's Disappointment
Tags: digitalnomad, travel
Published: 2023-12-09 14:15:13

Panama, a country known for its rich biodiversity and vibrant culture, may not be the paradise digital nomads envision. Like I did before coming here in December 2023. 

My dire sentiment comes after having seen stunning downtown dumpster beaches and the complete disregard of support for these natural wonders is disheartening. 



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

Let's delve into the challenges faced by digital nomads in Panama.


## Beaches Neglected: A Coastal Dilemma

Panama boasts stunning Caribbean coastlines that i’ve visited, but the lack of infrastructure and support for beaches downtown leaves me in desperation.  

Moreover infrastructure around affordable AirBnBs and tourist hotspots here struggle with a lack of facilities, making it challenging for digital nomads seeking a serene work environment. 

## The Uber-Touristic Trap

Panama's infrastructure caters to tourism but often at a high cost. Digital nomads accustomed to affordable living may find themselves disappointed by the uber-touristic approach that raises prices without offering commensurate value. The balance between attracting tourists and supporting a sustainable local economy remains elusive.

## Non-Walkable Roads: A Pedestrian Predicament

Navigating Panama City as a pedestrian can be a daunting task. The poorly designed roads and lack of walkable infrastructure make it challenging for those who prefer walking or biking. Digital nomads seeking a healthy and eco-friendly lifestyle may find themselves frustrated by the city's inadequate provisions for pedestrians.

## Architectural Identity Crisis

Panama's architecture mirrors an identity crisis, juxtaposing the historic charm of Panama Viejo with modern skyscrapers. The fusion, rather than harmonious, feels disjointed and uninspiring. Digital nomads seeking an aesthetically pleasing and culturally rich environment may be disappointed by this lack of architectural coherence.

In conclusion, while Panama offers natural beauty and cultural diversity, digital nomads should be aware of the challenges they might face. The neglect of beaches, the high costs associated with touristic infrastructure, non-walkable roads, and an architectural identity crisis collectively contribute to the disappointment some may experience when trying to make Panama their digital nomad haven.
Advent of Code #9 (in Crystal)
Tags: crystal, adventofcode
Published: 2023-12-09 14:14:04

The confusing year of Advent of Code continues... I thought weekend puzzles were meant to be harder than weekday puzzles, but today seemed like another soft ball. I suppose it nudged you towards a recursive solution, but it wasn't all that difficult once I wrapped my head around the recursion aspect. In previous years, there seemed to be a steeper ramp up in difficulty, but this year started a little harder than usual and hasn't really climbed as fast.

So after [live streaming](https://youtu.be/5mx8BXlLBd8) my solutions to today's puzzle, I went on to refactor my code ([also livestreamed](https://youtu.be/5qL3ciceEwI)). I really like how the code turned out, using a combination of OOP and FP.

Here it is!
```crystal
input = File.read("input").strip

dataset = input.split("\n").map(&.split(" ").map(&.to_i))

class Array
  
  def differences
    (1..(self.size - 1)).map do |x|
      self[x] - self[x - 1]
    end
  end

  def extrapolate(direction = 1)
    if self.uniq.size == 1
      self[0]
    else
      differences = self.differences
      if direction == 1
        self[-1] + differences.extrapolate
      else
        self[0] - differences.extrapolate(-1)
      end
    end
  end

end

part1 = dataset.map(&.extrapolate).sum
puts part1

part2 = dataset.map(&.extrapolate(-1)).sum
puts part2
```
شركة تنظيف سجاد بحفر الباطن🧹
Published: 2023-12-09 14:05:11

هل تبحث عن [شركة تنظيف سجاد بحفر الباطن](https://ikhles.com/carpet-cleaning-hafar-al-batin/) موثوقة وتقدم خدمة عالية الجودة؟ فأنت في المكان المناسب. حيث أننا نعلم تمامًا أن غسيل السجاد والحفاظ على نظافته يعتبر أمرًا مهمًا للحفاظ على بيئة صحية داخل منزلك. لذا، نحن نعمل على تقديم خدمات تنظيف سجاد شاملة وفعالة لتلبية احتياجاتك.

علاوة على الفنيين والأدوات التي يتم استخدامها، حيث نهدف إلى تحقيق مطالبكم وتقديم أفضل خدمة ممكنة وبأسعار مناسبة. لذلك، تواصل معنا الآن في (شركة الألمانية المتحدة) واحصل على خدمات تنظيف السجاد التي تستحقها، كما يمكنك متابعة القراءة للتعرف أكثر على خدماتنا.
Cannot connect to Mysql in Docker
Tags: mysql, docker, login
Published: 2023-12-09 13:40:57

**Error: Host ‘172.17.0.1’ is not allowed to connect to this MySQL server**

1. CREATE USER 'newuser'@'%' IDENTIFIED BY 'password';
2. GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%';
3. FLUSH PRIVILEGES;


https://github.com/docker-library/mysql/issues/275
BakaLLM, step 13, RMT mainlined
Published: 2023-12-09 13:22:55

Hello, fairy dairy diary.


![Flash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h79jhjn7f7raal7epn7s.png)

So, RMT curse continued. I redid training and after 3 epochs loss is 4.01302, no 3.9xx. Heresy! Blasphemy. The world is against us! Oh well, BakaPause is recorded as 4.02, so I'll count as a win, as RMT takes next to no parms (Pause: 190492800 vs RMT: 190505088)

Oh well, since drop of several SSM-based model and FlashFftConv library I want to test it next. .

Step4 is postponed for another time. It increases number of weights way too much for what it adds. Also I found new glorious activation function: `nn.Identity`, or more specifically `y = identity(linear(x)) * base_layer(x)`. Oh well, I'll remember it for later.

For now I want to check tasty tools in [HazyResearch/flash-fft-conv](https://github.com/HazyResearch/flash-fft-conv)
What if they will not waste memory? So elegant it will! So wonderful it will be! The MEGA will return? Monarch will be added? Experiments will be experimented! 

(But then again since current implementation of RMT turned out so bad compared to the old one, now solidifiers can be returned. This is also something to check. The roadmap is clear!)

Chill!~ (Oh, we have -30°C here BTW, so chill levels are pretty high! Yay, free cooling of my laptop, yes)

PS. Oh, also current code sets random seed to ⑨, it still not determenistic without jumping through loops of `torch.use_deterministic_algorithms(True)` and using env vars, but we are going for reproducability, yay!
Should listicles be forced to have a tag so we can hide them from feed?
Tags: meta, discuss
Published: 2023-12-09 13:12:36

I know, I know, many people have talked about, and hated on listicles here on DEV many times. 

But to be completely honest, they're some of the most annoying and un-creative articles you can come across. Most of them are useless or offer very little value apart from a collection of X or Y things, or are just cheap marketing. And you can't escape them it seems... They're also bad for beginners, making them feel like they MUST read them in order to progress as developers. And that's not good. 

Listicles are one of the reasons I left DEV for half a year or so. And after coming back it seems it's even worse than before. Maybe the rise of AI is making it even easier to create them.

I really like this platform. I've been an active member of DEV for many years, have posted numerous articles and have consumed many more. I've read some of the best articles here, and engaged in some of the most interesting discussions and conversations.

And i know I'm not the only one that dislikes listicles, or even stopped using DEV because of them. This makes me sad, because great articles get lost between all the listicles. 

**But I think it could be fixed quite simply.**

I want to bring up a possible solution to the table, which might've been already suggested, but in case it hasn't, here it is.

The idea is not to prevent creating listicles, but a way for people who dislike them to hide them from their feed. People who want to see them, can. People who want to create them, can. And people who don't want to see them, can.

The idea is to "force" listicles to have a tag `listicle` or something like that. So that we can hide it from the feed like we hide any other tag.

Forcing it could be done by the guidelines and mods I guess... 

Or maybe it can be algorithmically done in code or using AI 🤷

Just a little idea!
4th Time Hacktoberfest Contributor
Tags: hack23contributor, hacktoberfest23, hacktoberfest, opensource
Published: 2023-12-09 13:07:58

## Intro

Well, I have been working as a Software Dev for almost 4 years now. I often participate in various open-source programs and contribute to many open-source projects that pique my interest. This is the 4th time I am participating in Hacktoberfest and I look forward to contributing meaningfully once again to the best of my knowledge.

{% embed https://github.com/Rutam21 %}

## Highs and Lows

I always try to contribute both code and documentation in various open issues for different projects. This year also I came across several new projects such as DocsGPT, Trigger.dev, Hyperswitch and Bytebase, etc.

I tried to curate some blogs on some of these tools and also worked on some of their available tickets. Understanding the code base and running the code base locally always was a challenge and that is something I learned and executed properly towards the end.

Another challenge was to make sure that everything worked properly after doing a code change and testing it thoroughly which I did.

There were highs and lows but the overall experience was very rewarding.

## Growth

After working on several projects this Hacktoberfest, I have a wider knowledge of different OSS projects out there and have experience in utilizing these tools for different tasks as and when required in my personal and professional endeavors. 

Networking and knowing many different people who share the same vision and goal was another plus that I acquired during Hacktoberfest 2023.


### Cheers to Hacktoberest 2023!
VAULT
Published: 2023-12-09 06:52:56

vault is primarily implemented in the Go programming language.

HashiCorp is the company that develops and maintains the Vault tool.HashiCorp is an American technology company that focuses on providing infrastructure automation software.

**VAULT OVERVIEW**

**PURPOSE:**

Vault tool is to securely manage and store sensitive information such as passwords, API keys, and other credentials. It provides a centralized and encrypted repository for storing and managing secrets, ensuring that sensitive data is protected and accessed only by authorized users and systems. The vault tool helps enhance security, facilitates automated deployment processes, and ensures that sensitive information is not exposed or hardcoded in application code or configuration files.
 
**FUNCTIONALITIES:**
1.Secrets Management
2.Dynamic Secrets
3.Encryption as a Service
4.Access Control
5.Authentication and Authorization
6.Audit Logging

**LOGO:**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nc334oqt9hliqmlsp7e7.png)
Vault developed by HashiCorp is an open-source tool.
Selenium Flask app Issue
Tags: selenium, flask
Published: 2023-12-09 13:02:27

Hi Devs, 

when I'm deploying flask app which uses the selenium to scrape data when user opens website , web driver should be activated and it must open to scrape data or open in headless mode. 

I have mentioned driver packages and other dependencies in req.txt but still when I deploy app on vercel and other platforms it gives same error driver not installed. 

So, Please I need your help what to do to solve this problem?
56. Assignment 2 completed (Day 54 )
Published: 2023-12-09 12:54:05

What a long day of Python!

- 4 hours of LIVE lecture
- 6 hours of assignment work

As of 11:40 PM, I have completed all of the 16 assignment questions! I had a goal to hit, avoided distractions, and managed my time well. Discipline is the secret!

At the moment, I am formatting all my work in Markdown, and then tomorrow I will run through everything one more time before submitting it.

Speaking about Markdown, I ran into some issues with my VS Code Readme file. For some reason when I converted it to a PDF, it wouldn't render my images, although I had all the appropriate extensions installed. I didn't have much time to investigate and luckily one of the tutors recommended a desktop app called Obsidian.

[obsidian link](https://obsidian.md/)

Obsidian is a note-taking application in markdown. It has all the features of VS Code, and I like how intuitive it is. So, I used that pretty much for my assignment as it could render the images.

That's it, folks! I am happy and I need to continue working on my document formatting, perhaps till 1 AM.
📝Komodore's ✅TO-DO APP Sales
Tags: tooling, management, news, sales
Published: 2023-12-09 12:25:13

### Check out the Komodore's TO-DO APP December ❄️ Sales for -50%

### {% embed https://komodore.itch.io/komodore-todo %}
![itch cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/so3zc55v964j7tiy1fpa.gif)
### ➡️ [CHECK IT OUT BEFORE IT ENDS...](https://komodore.itch.io/komodore-todo) ⬅️
Adobe Photoshop: Use the Camera Raw dialog box
Tags: adobephotoshop, cheatsheet
Published: 2023-12-09 12:19:46

| Shortcut | Action |
| --- | --- |
| `Z` | Zoom tool |
| `H` | Hand tool |
| `I` | White balance tool |
| `S` | Color sampler tool |
| `C` | Crop tool |
| `A` | Straighten tool |
| `B` | Spot removal tool |
| `E` | Red eye removal tool |
| `Ctrl` `Alt` `1` | Basic panel |
| `Ctrl` `Alt` `2` | Tone curve panel |
| `Ctrl` `Alt` `3` | Detail panel |
| `Ctrl` `Alt` `4` | HSL/Greyscale panel |
| `Ctrl` `Alt` `5` | Split toning panel |
| `Ctrl` `Alt` `6` | Lens corrections panel |
| `Ctrl` `Alt` `7` | Camera calibration panel |
| `Ctrl` `Alt` `8` | Presets panel |
| `Ctrl` `Alt` `9` | Open snapshots panel |
| `Ctrl` `Alt` `Shift` `T` | Parametric curve targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `H` | Hue targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `S` | Saturation targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `L` | Luminance targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `G` | Grayscale mix targeted adjustment tool |
| `T` | Last-used targeted adjustment tool |
| `K` | Adjustment brush tool |
| `G` | Graduated filter tool |
| `Alt` | Temporarily switch from Add to Erase mode for the Adjustment brush tool, or from Erase to Add mode |
| `Alt` `]/[` | Increase/decrease temporary adjustment brush tool size |
| `Alt` `Shift` `]/[` | Increase/decrease temporary adjustment brush tool feather |
| `Alt` `=/-` | Increase/decrease temporary adjustment brush tool size flow in increments of 10 |
| `N` | Switch to New mode from Add or Erase mode of the Adjustment Brush tool or Graduated filter |
| `M` | Toggle Auto Mask for Adjustment Brush tool |
| `Y` | Toggle Show Mask for Adjustment Brush tool |
| `V` | Toggle pins for Adjustment Brush tool |
| `L` | Rotate image left |
| `R` | Rotate image right |
| `Ctrl` | Temporarily switch to zoom in tool |
| `Alt` | Temporarily switch to zoom out tool and change the image open button to open copy |
| `P` | Toggle preview |
| `F` | Full screen mode |
| `Shift` | Temporarily activate the White Balance tool and change the open image button to open object |
| `Arrows` | Move selected point in curves panel 1 pixel |
| `Shift` `Arrows` | Move selected point in curves panel 10 pixels |
| `Ctrl` `R` | Open selected images in Camera Raw dialog box from Bridge |
| `O` | Highlight clipping warning |
| `U` | Shadows clipping warning |
| `Ctrl` `1-5` | Add 1-5 star rating (filmstrip mode) |
| `Ctrl` `./,` | Increase/decrease rating (filmstrip mode) |
| `Ctrl` `6` | Add red label (filmstrip mode) |
| `Ctrl` `7` | Add yellow label (filmstrip mode) |
| `Ctrl` `8` | Add green label (filmstrip mode) |
| `Ctrl` `9` | Add blue label (filmstrip mode) |
| `Ctrl` `Shift` `0` | Add purple label (filmstrip mode) |
| `Ctrl` `K` | Camera Raw preferences |
| `Ctrl` `Alt` | Delete Adobe Camera Raw preferences (on open) |

> ## Useful links
> - [Create Online cheatsheet](https://simplecheatsheet.com/)
> - [Adobe Photoshop Cheatsheet](https://simplecheatsheet.com/adobe-photoshop)
AI Directory: Windows
Tags: aidirectory, cheatsheet
Published: 2023-12-09 12:19:44

* [![Favicon](https://icon.horse/icon/superannotate.com) Superannotate desktop](https://superannotate.com)

> ## Useful links
> - [Create Online cheatsheet](https://simplecheatsheet.com/)
> - [AI Directory Cheatsheet](https://simplecheatsheet.com/ai-directory)