teleren/devto huggingface dataset:
How to set up HTMX in Django
Tags: htmx, django, setup
Published: 2024-05-16 20:57:00

**HTMX** makes it absolutely easy and straightforward for a backed engineer like me to be able to efficiently write code from end to end without loosing quality and over engineering the front end, simple code and simple products I believe is a core indicator of success for any software system. The more you over engineer the less you focus on product functionality.
A client or user doesn't care whats beneath the hood, it just need to work and be fast. Modern web frameworks make a developers experience a bit gnarly.
So, this is my set up for the same:

I will assume your Django installation is up and running...
first install with pip and register the django_htmx library:

1. Install with **pip**:

```
python -m pip install django-htmx
```


2. Add django-htmx to your `INSTALLED_APPS`:
    
   

```python
 INSTALLED_APPS = [
        ...,
        "django_htmx",
        ...,
    ]
```

3. Add the middleware we will use for htmx:

```python
MIDDLEWARE = [
    ...,
    "django_htmx.middleware.HtmxMiddleware",
    ...,
]
```

Then after you'd set up the static files directory:

1. download the htmx.min.js here - https://unpkg.com/browse/htmx.org@1.9.12/dist/

2. Then put it in the static directory of your application. (Youd normally have this defined in your settings.py file). You can use whatever standard fits you e.g 'static/js/' etc.

3. Add the htmx script tag top your base template i.e:
	

```html
{% load static %}
	<script src="{% static 'htmx.min.js' %}" defer></script>
```

After that you're set to go!

**Additional Notes:**
The purpose of installing `django-htmx` separately from pip is due to the following reasons :
1. Django-htmx comes installed with middleware (that adds request.htmx attribute to the views) that can help make it easier to handle requests from the client side of the application. It does this by checking if a request is coming as an htmx request then handling it appropriately.
2. It contains template tags that can be added globally to save time and adhere to the DRY(Dont Repeat Yourself) principle when dealing with Django templates.
3. It can also be used to bundle in a debug error handler to help catch errors as they occur either for debugging or any other purpose.
	 You can load the debug handler as below:
		

```html
{% load static %}
		<script src="{% static 'js/htmx/htmx.min.js' %}" defer></script>
		<!--Right under this-->
		<script src="{% static 'js/htmx/debug.js' %}" defer></script>
```

And a degub.js files would look like:
		 

```javascript
htmx.defineExtension('debug', {

    onEvent: function (name, evt) {
			
      if (console.debug) {
			
      console.debug(name, evt);
			
        } else if (console) {
			
         console.log("DEBUG:", name, evt);
			
	} else {
			
	throw "NO CONSOLE SUPPORTED"
			
	}
			
	}
			
});


```
How to setup MySql on MacOS using Brew.
Tags: webdev, sql, database, macos
Published: 2024-05-16 20:52:15

# Setting up MySql with MacOs



**Step1:** Installation from brew.

```bash
brew install mysql
```

**Step2:** Run this command if we don't want to run `MySql` in background.

```bash
/opt/homebrew/opt/mysql/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql
```


or for running it in `background` or at `login` run this command.

```bash
brew services start mysql
```

I prefer not to run it in background or when i login into my mac.


**Step3:** Let's check it is working correctly.

Connect to `MySQL`.

```bash
mysql -u root -p
```

Run the `Query`.

```sql
SHOW DATABASES;
```

**Step4:** For turning it off we can use this command (Only if you not running it in background).
```bash
/opt/homebrew/opt/mysql/bin/mysqladmin -u root -p shutdown
```


**Step5:**(Optional): We can add alias for it for `starting it` and `stopping it`.

add alias in `~/.zshrc` file or if you bash add it in `~/.bashrc` file.

`sql-start`
```bash
alias sql-start='/opt/homebrew/opt/mysql/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql'
```

`sql-stop`
```bash
alias sql-stop="/opt/homebrew/opt/mysql/bin/mysqladmin -u root -p shutdown"
```

By doing this you can start and stop it when need.
DevSecOps Made Easy (Pt 2) - Stay clear of any lock-in
Tags: devops, devsecops, cicd, devsecopsmadeeasy
Published: 2024-05-16 20:34:32

## The Sad Status Quo

You must be prudent about what you’re signing up for with a DevSecOps vendor. There are so many clever ways they can lock you into an undesirable situation. Check out a few examples below.

1. Some limit your flexibility to move your SCM, CI/CD pipelines (for ex) when your requirements change.
2. They can offer a CI/CD solution as a free add-on to a separate multi-year licensing agreement. And then force you to pay after you’re well embedded into their CI/CD solution. 
3. You’re dealing with a sudden increase in your annual DevSecOps subscription price because you decided to use their competitor’s cloud infrastructure.
4. You have to learn a specific DSL to configure pipelines, even though every developer within your company finds it hard to understand. 
5. You must modify your internal processes since their DevSecOps offering can’t meet you where you are right now. 
6. You suddenly have to rewrite your infrastructure code in their terms; otherwise, their solution doesn’t work.

This list continues to grow!

## How CloudBees Makes DevSecOps Easy

We meet you where you are. We proceed the way you prefer. 

What does this mean in less marketing terms? A multitude of things, but here’s a snapshot. 

**CloudBees can help you transition to cloud native at your own pace**. You can start greenfield projects in a cloud native environment while still retaining your older infrastructure. For example, you can run both Tekton-based workflows and Jenkins pipelines in parallel within the same platform.

**Your developers can continue to use the tools they know** or even choose the best-of-breed tools they need for your complex environments. You’re not stuck using lightweight tool replacements. CloudBees offers multiple opportunities to integrate.

**We make it easy for you to integrate legacy systems and customize projects at scale**. You don’t have to deal with the inability of some vendors to integrate or adopt internal processes. 

## Start using the CloudBees platform for [FREE](https://id.cloudbees.io/realms/cloudbees/protocol/openid-connect/auth?client_id=nextgen-ui&redirect_uri=https%3A%2F%2Fcloudbees.io%2F&response_type=code&scope=openid+profile+email&state=c403e8e263704d03b76e8086f2b42317&code_challenge=POt_YwsMTalXu_APvYAzYZ5_7rps8HrW2DPP3yvSpgc&code_challenge_method=S256&response_mode=query) today and find out for yourself!
Really: Infra policy language that doesn't suck
Published: 2024-05-16 20:19:00

## Announcing Really

When we started building [Resourcely](https://www.resourcely.io), the global configuration engine for cloud infrastructure, we slowly realized that the status quo of policy-as-code was broken. Writing our first Resourcely guardrails in Rego took hours to create and even more time to maintain. Writing new policies was extremely tedious and time-intensive, especially given the fact that we wanted to make them flexible. To help achieve our mission of making infrastructure more secure, it became evident that a new policy language would be needed that allowed policy to be written and maintained without headaches.

The Resourcely team has spent the last 6 months working on developing that new policy language, and today we are introducing Really: a policy language and enforcement engine that is built to be written and read by humans - not machines. With the introduction of Really, policy can be created in minutes compared to hours, with a human-readable syntax that looks remarkably like SQL. The readability of our structured policy language means that writing, deciphering, and adjusting policy isn’t a nightmare, and your policy team can take vacation without worrying about their pager going off.

Read more about why we built Really [here.](https://www.resourcely.io/post/announcing-really)
Debugging with Precision: Conditional Breakpoints
Tags: debug, breakpoint, productivity, visualstudio
Published: 2024-05-16 20:06:39

Breakpoints are one of the most used debugging techniques. Mastering their use in your favorite _**Integrated Development Environment (IDE)**_ will greatly increase your productivity. 

This article provides guidance on using breakpoints within Visual Studio.


## What is a breakpoint? 

A breakpoint is a marker, usually represented by a small red dot in the left margin of the editor window, that is set manually in a specific line of the code. When the program reaches the marker during execution, it pauses before executing the code on that line. This pause allows the programmer to inspect the state of variables values and flow of execution.


## When to use it?

When you encounter unexpected behavior or errors in your program, setting breakpoints at critical points can be helpful. However, when you need to test a specific scenario or if a loop failure occurs, instead of hitting the breakpoint marker several times, you can optimize your debugging process by using **conditional breakpoints.**

Here´s a simple example of an iteration code in C#. According to the image below, the program would hit the breakpoint all 100 times during execution.  

![setting a breakpoint on visual studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5m776490840vhazq2m3.png)


## How to set conditional breakpoints?

After setting the breakpoint on the line you want to inspect:

1. Right click on the breakpoint;
![setting a conditional breakpoint on visual studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5rf8824huos8sjp5t7vt.png)

2. Choose 'Conditions' option;

3. Enter your condition 
![entering condition on a conditional breakpoint](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npisrjzbtdij8iuokonx.png)

Then, the program will make an execution stop only if the added condition is met. This significantly reduces debugging time, enabling quicker bug resolution.


In conclusion, conditional breakpoints provide a flexible approach to debugging complex code, enhancing the manageability of debugging challenges. Embrace this powerful new feature to your debugger toolkit to elevate your development skills. 

Happy debugging!🎉


_[Image Designed by Freepik](www.freepik.com)_
🚀 10 Proven strategies to make your resume stand out and shine bright! 🚀
Tags: webdev, beginners, tutorial, react
Published: 2024-05-16 19:47:44

## Hey, job seekers
 and career climbers! 🌟 Ready to transform your resume into a dazzling career magnet? Here are 10 quantifiable strategies to make your resume not just a document, but a dynamic showcase of your professional journey. 💼✨

## Design matters:
 Using sleek, **[modern templates](https://instaresume.io/resume-templates)** can increase your resume visibility by up to 40%. Platforms like Canva and Adobe Spark are game-changers!

## [Action-Packed words:](https://instaresume.io/blog/action-verbs-for-resume)
 Start your bullet points with action verbs. Words like “Led,” “Developed,” and “Innovated” show you’re not just a doer but a leader!

## Show, Don’t just tell:
 [Quantify your achievements](https://instaresume.io/blog/how-many-bullet-points-per-job-on-resume). For example, “Increased sales by 30%,” “Managed a team of 15,” or “Saved $20K annually.” This approach can boost your chances by 50%.

## LinkedIn love:
 Hyperlink your LinkedIn profile to make it easy for recruiters to see your endorsements and connections. Customize your LinkedIn URL for a cleaner look and a 30% increase in profile visits!

## ATS-Friendly:
 Ensure your resume is ATS-compatible by using standard fonts, avoiding fancy graphics, and including keywords from the job description. This can improve your chances of passing the ATS by 70%.

## [Keywords are key:](https://instaresume.io/blog/how-many-skills-to-list-on-resume)
 Tailor each resume to the job you’re applying for by using keywords from the job posting. This can increase your chances of getting noticed by 50%.

## Show your soft skills:
 Highlight your soft skills, such as communication, teamwork, and adaptability. This can improve interview call-backs by 20%.

## Continuous learning:
 Add a section for courses, [certifications](https://instaresume.io/blog/how-to-put-certifications-on-resume), and professional development. Candidates who do this are 40% more likely to land an interview.

## Tell your story:
 Craft a compelling summary at the top. A great summary can increase recruiter engagement by 60%.

## Keep it updated:
 Regularly update your resume with new skills, projects, and achievements. Staying current can increase your job search success by 30%.

Ready to make your resume a beacon for your dream job? 🌟 Let’s elevate your career game! Share your top resume tips below and let’s build a community of job-winning rockstars! 💪🚀

#ResumeTips #CareerGrowth #JobSearch #ProfessionalDevelopment #StandOut
Leading Innovator in Plate and Frame Filter Press Manufacturing
Tags: webdev
Published: 2024-05-16 19:09:34

A [plate and frame filter press](https://yotana.com/product/conventional-filter-press/) is an essential piece of equipment in various industries for separating solids from liquids. This type of filter press is composed of alternating plates and frames, creating a series of chambers that hold the filter media. The mixture to be filtered is pumped into these chambers, and under high pressure, the liquid passes through the filter media, leaving the solid particles behind.

YO-TANA Machine Tools is a renowned [conventional filter press manufacturer](https://yotana.com/product/conventional-filter-press/), known for their high-quality and durable filtration equipment. Their plate and frame filter presses are designed to meet the rigorous demands of industries such as chemical, pharmaceutical, food and beverage, and wastewater treatment. With a commitment to innovation and excellence, YO-TANA ensures that each filter press is built to deliver optimal performance and efficiency.

Conventional filter presses by YO-TANA Machine Tools are engineered to provide maximum filtration efficiency and ease of use. They feature robust construction and advanced technology, ensuring reliable operation and minimal maintenance. These filter presses can handle various applications, from small-scale laboratory use to large industrial processes.

Choosing a YO-TANA plate and frame filter press guarantees superior filtration performance, thanks to their precise engineering and high-quality materials. Their expertise as a conventional filter press manufacturer is evident in their ability to customize equipment to meet specific client requirements, ensuring that each system is perfectly tailored to the needs of the process it supports.

In summary, a plate and frame filter press from YO-TANA Machine Tools represents a reliable and efficient solution for industries requiring effective solid-liquid separation. As a leading conventional filter press manufacturer, YO-TANA is dedicated to providing advanced filtration technology that enhances productivity and ensures clean, clear filtrate.
YO-TANA: Leading Innovators in Filter Press Manufacturing in India
Tags: webdev
Published: 2024-05-16 19:04:55

India boasts a thriving manufacturing sector, with a strong presence of [filter press manufacturers](https://yotana.com/). Among the leading names, YO-TANA Machine Tools stands out as a prominent filter press manufacturer in India. Renowned for their innovative engineering and robust construction, YO-TANA Machine Tools has set a benchmark in the industry.

As a leading filter press supplier, YO-TANA Machine Tools offers a diverse range of products designed to meet the specific needs of various industries. Their filter presses are known for high efficiency, durability, and cost-effectiveness, catering to sectors like chemical, pharmaceutical, food and beverage, and wastewater treatment.

Filter presses are essential for separating solids from liquids in various industrial processes. The technology utilized by YO-TANA Machine Tools ensures optimal performance, reducing operational downtime and enhancing productivity. Their machines are built with precision, ensuring long-lasting service and minimal maintenance.

What sets YO-TANA Machine Tools apart from other filter press manufacturers in India is their commitment to quality and customer satisfaction. They employ cutting-edge technology and adhere to stringent quality control measures to produce top-notch filter presses. Additionally, their team of skilled professionals is dedicated to providing exceptional after-sales support, ensuring that clients receive the best service throughout the product's lifecycle.

Furthermore, YO-TANA Machine Tools continues to innovate, developing new solutions to meet the evolving needs of the industry. Their dedication to research and development enables them to stay ahead of market trends and offer state-of-the-art products.

In summary, for those seeking reliable and high-quality filter press manufacturers in India, YO-TANA Machine Tools is a trusted name. As a leading [filter press supplier](https://yotana.com/), they provide efficient and durable solutions, backed by excellent customer service and technical support. Their commitment to innovation and quality makes them a preferred choice in the market.
Unlocking the Potential: Exploring the Rise of Granny Flats in Queensland
Tags: webdev
Published: 2024-05-16 19:02:26

[Granny Flats Queensland
](https://timbergardencabins.com.au/granny-flats-queensland/)
At Timber Garden Cabins, we understand the importance of creating living spaces that cater to diverse needs and preferences. That's why our Granny Flats are meticulously crafted to offer comfort and a sanctuary where families can thrive, and individuals can find solace.

Each of our Granny Flats is a testament to thoughtful design and quality craftsmanship. From the moment you step inside, you'll be greeted by an atmosphere of warmth and tranquillity, where every detail has been carefully considered to enhance your living experience.

Our range of floor plans ensures that you'll find the perfect fit for your lifestyle, whether you're seeking a cosy retreat or a more expansive dwelling. Need extra space for guests or a home office? Our multiple-bedroom options provide the flexibility to accommodate your evolving needs.

But it's not just about the interior. Our Granny Flats are designed to seamlessly blend with their surroundings, whether nestled in a lush garden or overlooking a scenic landscape. Their timeless charm and classic appeal add character to any property while offering modern amenities for everyday living.

Because we believe in sustainability, our cabins are built with eco-friendly materials and energy-efficient features, ensuring that your Granny Flat is not just a comfortable retreat but also a responsible choice for the planet.

Discover the joy of gracious living with Timber Garden Cabins Granny Flats – where comfort, style, and functionality come together to create the perfect home for you and your loved ones.
How I Got Out of a Knee Deep Git Problem
Published: 2020-02-19 08:02:04

---
title: How I Got Out of a Knee Deep Git Problem
published: true
date: 
tags: 
canonical_url: https://bhavaniravi.com/The-git-problem/
---

# How I Got Out of a Knee Deep Git Problem

### Problem

- I am not used to rebasing or squashing commits, my new project strictly follows this hence I was pushed to do this.
- I started with 4 commits which I had to squash
- `git rebase -i HEAD~4` and squashed all the commits all were good
- But, as I pushed the code there was a conflict with the master
- If you remember you cannot `merge` hence I did a `git rebase -i master`
- Now I ended up having 10 more commits from god knows where
- I cannot push all of them, hence I squashed them all again, in spite of the commits not being mine
- I pushed my code, but the conflict was still there, at the brink of frustration I fixed the conflict in Github and left it there
- As expected, I was asked not to merge from master and revert it
- Now I am knee stuck with a merge, 9 commits squashed within which another 4 commits squashed

### Solution - Git Reflog to the rescue

- `git reflog` has a history of all the commands you ever executed 
- On running it I found the first squash I made
- `git reset --hard <commit_id>` took me to that commit
- One mistake I did last time when I rebased master was I didn't rebase from upstream so this time I ran `git pull upstream master --rebase`
- Now I did a `git add .` to add my changes to rebase
- `git rebase --continue` finishes the rebase successfully
- Finally `git push origin --force <branch-name>` to push the final version with no-conflicts and just my commits squashed into one.
How to properly apply paint protection film to a vehicle.
Published: 2024-05-16 18:42:07

To properly apply paint protection film (PPF) to a vehicle, start by thoroughly cleaning the surface to remove dirt, debris, and wax. Use a mild detergent and water, then rinse and dry the surface completely. Next, prepare the PPF by cutting it to fit the specific area you want to protect, leaving a slight overlap for full coverage. Peel the backing off the PPF and carefully apply it to the surface, starting from one edge and using a squeegee to smooth out any air bubbles. Trim any excess film with a sharp blade for a clean finish. Use a heat gun to gently heat the edges of the PPF to help it conform to the contours of the vehicle and seal it in place. Finally, inspect the surface for imperfections, correct any issues, and allow the PPF to cure for at least 24 hours before exposing it to moisture or extreme temperatures.[More details:-](https://washclubtx.com/paint-protection-film)