teleren/devto huggingface dataset:
Optimizing CSS for Performance
Published: 2024-07-15 04:18:16

Introduction:

CSS is an essential aspect of web development and plays a crucial role in creating visually appealing websites. However, as websites become more complex, the CSS code also tends to become larger and more complex, affecting the overall performance of the website. Slow loading websites can lead to a negative user experience, resulting in decreased traffic and potential loss of customers. Therefore, optimizing CSS for performance is crucial for a successful website.

Advantages:

1. Improved Loading Time: Optimizing CSS can significantly improve the loading time of a website, making it more user-friendly and reducing bounce rates.

2. Better User Experience: A well-optimized CSS code can enhance the visual appeal of a website and make it more appealing to visitors, leading to higher user engagement.

3. Reduced Bandwidth Usage: Optimizing CSS can also help reduce the amount of data that needs to be transferred, resulting in decreased bandwidth usage and potentially saving costs.

Disadvantages:

1. Tedious Process: Optimizing CSS can be a tedious and time-consuming process, especially for larger and more complex websites.

2. Skill and Knowledge Requirements: Properly optimizing CSS requires a deep understanding of CSS and various optimization techniques, making it a challenging task for beginners.

Features:

1. Code Minification: One of the most common techniques for optimizing CSS includes code minification, which involves removing unnecessary characters, whitespace, and comments from the code.

2. Preprocessors: Using CSS preprocessors such as SASS or LESS can make the optimization process more efficient by allowing for the use of variables, functions, and mixins.

3. Efficient Use of Selectors: Selectors can significantly impact the performance of a website, so it is essential to use them efficiently and avoid repeating them unnecessarily.

Conclusion:

In conclusion, optimizing CSS for performance is critical for creating fast and visually appealing websites. However, it requires a balance between optimizing for performance and maintaining a high-quality code. With the right knowledge and techniques, developers can strike this balance and create websites that are both visually appealing and have excellent performance.
Case Study: Occurrences of Words
Tags: java, programming, learning, beginners
Published: 2024-07-13 15:16:21

This case study writes a program that counts the occurrences of words in a text and displays the words and their occurrences in alphabetical order of the words. The program uses a **TreeMap** to store an entry consisting of a word and its count. For each word, check whether it is already a key in the map. If not, add an entry to the map with the word as the key and value **1**. Otherwise, increase the value for the word (key) by **1** in the map. Assume the words are case insensitive; e.g., **Good** is treated the same as **good**.

The code below gives the solution to the problem.

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

`a      2
class   1
fun     1
good    3
have    3
morning 1
visit   1`


The program creates a **TreeMap** (line 11) to store pairs of words and their occurrence counts. The words serve as the keys. Since all values in the map must be stored as objects, the count is wrapped in an **Integer** object.

The program extracts a word from a text using the **split** method (line 13) in the [**String** class](https://dev.to/paulike/the-string-class-17o7). For each word extracted, the program checks whether it is already stored as a key in the map (line 18). If not, a new pair consisting of the word and its initial count (**1**) is stored in the map (line 19). Otherwise, the count for the word is incremented by **1** (lines 21–23).

The program obtains the entries of the map in a set (line 29), and traverses the set to display the count and the key in each entry (lines 32–33).

Since the map is a tree map, the entries are displayed in increasing order of words. You can display them in ascending order of the occurrence counts as well.

Now sit back and think how you would write this program without using map. Your new program would be longer and more complex. You will find that map is a very efficient and powerful data structure for solving problems such as this.
Cryptomator: end-to-end encrypt files in any cloud
Tags: cryptomator, encryption, cloud, privacy
Published: 2024-07-13 15:35:26

---
title: "Cryptomator: end-to-end encrypt files in any cloud"
published: true
description: "With Cryptomator you can easily encrypt your files before uploading them to the cloud. This way you can be sure that your data is safe and secure even if the cloud provider gets hacked."
tags: cryptomator, encryption, cloud, privacy
cover_image: https://www.andreagrandi.it/posts/cryptomator-end-to-end-encrypt-files-in-cloud/split-screenshots.png
---

If you are using a cloud storage service like **Google Drive**, **Dropbox**, **OneDrive**, etc., you should be aware that **your files are not encrypted by default**. This means that the cloud provider is able to access and, in some cases, even share them with third parties. In case your cloud provider gets hacked, your files could also be exposed to the public.

To prevent this from happening, you can use a tool like [**Cryptomator**](https://cryptomator.org) to automatically encrypt your files before uploading them to the cloud.

## How does it work?

Cryptomator is a **free** and **open-source** software that allows you to create an encrypted vault on your computer where you can store your files. Once you have added your files to the vault, Cryptomator will encrypt them using strong encryption algorithms (256 bit AES).

To be more clear, **Cryptomator doesn't upload your files**. Your cloud provider application does:

You write files to the Cryptomator vault -> Cryptomator encrypts them and writes them in a folder which is synced up to your cloud provider -> Your cloud provider application uploads the encrypted files to the cloud.

When you want to access your files, you simply access them from your mounted vault and Cryptomator will automatically decrypt them for you...

You can find the rest of this post here: https://www.andreagrandi.it/posts/cryptomator-end-to-end-encrypt-files-in-cloud/
Undress AI Tool: An Advanced Guide for Professional Photographers
Published: 2024-07-13 15:36:12

Professional photographers require sophisticated tools to enhance their work, ensuring that each image meets high standards of quality and creativity. The Undress AI Tool offers advanced AI-driven features that cater to the needs of professional photographers, streamlining their workflow and improving the final output. This guide provides an in-depth look at how professional photographers can leverage the Undress AI Tool to achieve outstanding results.

**Introduction**
The [Undress AI Tool](https://www.undressaitool.com/) is designed to provide powerful image editing capabilities, making it an indispensable tool for professional photographers. This guide will help you navigate its advanced features and optimize your photography workflow.

**Setting Up Your Professional Account**
Visit the Website: Go to the Undress AI Tool homepage.
Sign Up: Click on the “Sign Up” button to create a new professional account. Enter your professional details, including name, email address, and business information.
Verification: Verify your email address by clicking on the link sent to your inbox.
Login: Use your credentials to log in to your account.
Navigating the Professional Dashboard
Once logged in, you will be directed to the professional dashboard. Here’s an overview:

Home: Your central hub for accessing all features and recent activities.

Projects: Manage and organize your photography projects with ease.

Settings: Customize your account settings, including profile details, preferences, and business information.

Analytics: Access analytics to track your editing activity and performance.

Help: Get access to advanced tutorials, FAQs, and priority customer support.

**Uploading High-Resolution Images**
Click on “Upload Image”: Located prominently on the dashboard.
Select File: Choose high-resolution image files from your device. Supported formats include JPEG, PNG, TIFF, and RAW.
Upload: Click “Open” to upload your image to the platform. The upload process is optimized for high-resolution files.

**Exploring Advanced Features**
Precision Image Editing
AI Tools: Utilize a range of AI-powered tools for detailed image edits, including fine object removal, intricate background changes, and precision enhancement filters.
Manual Adjustments: Make manual adjustments for finer control over the editing process, allowing for professional-grade results.
Batch Processing
Upload Multiple Images: Upload multiple images at once for batch processing.
Apply Edits: Apply consistent edits across all images in a batch, ensuring uniform quality and saving time.
Interactive Demo for Professionals
Try the Demo: Use the interactive demo to experiment with advanced features before applying them to your projects.
Follow Instructions: Upload an image and follow the guided steps to apply different professional-grade edits and see real-time results.
Caddy: Manual Maintenance Mode
Tags: webdev, devops
Published: 2024-07-13 15:57:10

Coming from NGINX and others the concept of a maintenance mode that can be manually enabled is something I have used many times before.

With Caddy it is equally as easy, just using a less obvious syntax.

It always follows this general pattern:

- Check if a `maintenance.on` file exists at a specified location
- If it does, deliver the maintenance page
- Otherwise, do the normal thing you do

**Notice**:
Doing maintenance pages the way I describe in this post means your webserver is checking a file on disk for every request.

In small deployments this is likely not adding any overhead you need to be concerned with, but keep it in mind.


## nginx

To refresh your memory, this patterns looks like this in nginx.

```nginx
server {
  location / {
    set $maintenance 0;
    if (-f /app/maintenance.on) {
       set $maintenance 1;
    }
    if ($maintenance = 1) {
      rewrite ^(.*)$ /app/static/maintenance.html last;
      return 503;
    }

    proxy_pass http://127.0.0.1:8080;
  }
}
```

## Caddyfile

With Caddy it works exactly the same, just using a different vocabulary.

```
example.marco.ninja {
	@maintenanceModeActive file /app/maintenance.on
	handle @maintenanceModeActive {
		try_files /app/static/maintenance.html
		file_server {
			status 503
		}
	}

	reverse_proxy 127.0.0.1:8080
}
```
Singleton and Unmodifiable Collections and Maps
Tags: java, programming, learning, beginners
Published: 2024-07-13 15:42:07

You can create singleton sets, lists, and maps and unmodifiable sets, lists, and maps using the static methods in the **Collections** class. The **Collections** class contains the static methods for lists and collections. It also contains the methods for creating immutable singleton sets, lists, and maps, and for creating read-only sets, lists, and maps, as shown in Figure below.

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

The **Collections** class defines three constants—**EMPTY_SET**, **EMPTY_LIST**, and **EMPTY_MAP**—for an empty set, an empty list, and an empty map. These collections are immutable. The class also provides the **singleton(Object o)** method for creating an immutable set containing only a single item, the **singletonList(Object o)** method for creating an immutable list containing only a single item, and the **singletonMap(Object key, Object value)** method for creating an immutable map containing only a single entry.

The **Collections** class also provides six static methods for returning _read-only views for collections_: **unmodifiableCollection(Collection c)**, **unmodifiableList(List list)**, **unmodifiableMap(Map m)**, **unmodifiableSet(Set set)**, **unmodifiableSortedMap(SortedMap m)**, and **unmodifiableSortedSet(Sorted Set s)**. This type of view is like a reference to the actual collection. But you cannot modify the collection through a read-only view. Attempting to modify a collection through a read-only view will cause an **UnsupportedOperationException**.
Complete Review of Undress AI Tool's Website and Tools
Published: 2024-07-13 18:05:29

In the realm of digital content creation, having access to powerful image editing tools can significantly elevate the quality and impact of your visuals. The [Undress AI Tool](https://www.undressaitool.com/) emerges as a standout solution in this regard, harnessing advanced artificial intelligence to streamline and enhance the editing process. Whether you're a professional photographer, a marketer, or a content creator, understanding how this tool can transform your creative workflow is essential.

Overview of Undress AI Tool's Capabilities
The Undress AI Tool is designed to simplify complex image editing tasks, particularly focusing on background removal and enhancing overall image quality. Here's a breakdown of its key capabilities:

Advanced Background Removal: One of the standout features of the Undress AI Tool is its ability to accurately and efficiently remove backgrounds from images. Using AI-powered algorithms, it can precisely isolate subjects from their backgrounds, making it ideal for creating clean, professional-looking portraits, product images, and marketing. visuals.
Olá mundo!
Tags: webdev, coding
Published: 2024-07-15 02:16:26

Criei este perfil para compartilhar o que ando estudando, os projetos que estou desenvolvendo e as aventuras técnicas que resultam deles. Espero que os conteúdos que eu poste aqui sejam úteis ou ao menos informativos para quem os ler, e de repente ajude com algum problema similar que esteja enfrentando. Tentarei ser o mais acessível possível, é minha intenção fazer parte dessa rede/bolha de desenvolvedores brasileiros que se esforçam para produzir um conteúdo muito bom e que diversas vezes já me ajudou a aprender e resolver problemas, tanto em projetos pessoais quanto em produtos profissionais das firmas onde já trabalhei.

Os posts serão escritos em pt-BR e pretendo abordar assuntos mais relacionados a projetos que estou construindo. Dessa forma, não vou produzir posts sobre assuntos mais básicos ou iniciantes das stacks/langs que uso ou vou usar, ao menos não inicialmente.

Espero conseguir manter uma frequência semanal de posts, mas não sou de ferro e trabalho muito na semana. De qualquer maneira, uma calorosa recepção da pessoinha aqui do outro lado da tela!
sed: Delimiter Issues
Tags: bash, linux
Published: 2024-07-13 16:08:16

---
title: sed: Delimiter Issues
published: true
date: 2024-05-16 00:00:00 UTC
tags: 
  - bash
  - linux
canonical_url: https://blog.marco.ninja/notes/technology/sed/sed-delimiter-issues/
---

When doing variable substitution with sed things break if the value contains the delimiter used by sed.

For example:

```bash
MY_VAR="This works"
echo "My value is MY_VALUE" | sed "s/MY_VALUE/$MY_VAR/g"

MY_VAR="This/breaks"
echo "My value is MY_VALUE" | sed "s/MY_VALUE/$MY_VAR/g"
```

## Solution: Known Input

If the input is well understood you can just change the delimiter used to resolve the issue:

```bash
MY_VAR="This still works"
echo "My value is MY_VALUE" | sed "s|MY_VALUE|$MY_VAR|g"

MY_VAR="This/now/works"
echo "My value is MY_VALUE" | sed "s|MY_VALUE|$MY_VAR|g"
```

In this example I used `|` but you can basically use any character, as long as it is not part of the strings being operated on.

## Solution: Unknown Input

If the input is completely unknowable it might be best just to escape the control character used by sed in the input.

```bash
MY_VAR="This still works"
MY_VAR=$(echo ${MY_VAR} | sed -e "s#/#\\\/#g")
echo "My value is MY_VALUE" | sed "s/MY_VALUE/$MY_VAR/g"

MY_VAR="This/now/works"
MY_VAR=$(echo ${MY_VAR} | sed -e "s#/#\\\/#g")
echo "My value is MY_VALUE" | sed "s/MY_VALUE/$MY_VAR/g"
```
HaProxy: Think About DNS Resolution
Tags: devops
Published: 2024-07-13 16:05:31

---
title: HaProxy: Think About DNS Resolution
published: true
date: 2024-06-04 00:00:00 UTC
tags: 
  - devops
canonical_url: https://blog.marco.ninja/notes/technology/haproxy/haproxy-think-about-dns-resolution/
---

By default HAProxy resolves all DNS names in it’s config on startup and then never again.

This might cause issues down the road if DNS records, for example the ones for backends, change.

This section of the documentation is a good starting point as it describes IP address resolution using DNS in HAProy really well:[https://docs.haproxy.org/3.0/configuration.html#5.3](https://docs.haproxy.org/3.0/configuration.html#5.3)

Additionally this guide can also be helpful:[https://www.haproxy.com/documentation/haproxy-configuration-tutorials/dns-resolution/](https://www.haproxy.com/documentation/haproxy-configuration-tutorials/dns-resolution/)
PicoCSS Sticky Footer
Tags: webdev, css
Published: 2024-07-13 16:04:19

---
title: PicoCSS Sticky Footer
published: true
date: 2024-06-10 00:00:00 UTC
tags:
  - webdev
  - css
canonical_url: https://blog.marco.ninja/notes/technology/css/picocss-sticky-footer/
---

A sticky footer using [PicoCSS](https://picocss.com)

```
html,
body {
  height: 100vh;
}

body > footer {
  position: sticky;
  top: 100vh;
}

```
Operational System the concept for dummies
Tags: os
Published: 2024-07-13 16:00:00

---
title: Operational System the concept for dummies
published: true
description: the operational system concepts for dummies
tags: #os
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2024-07-13 16:00 +0000
---

An operating system (OS) is the software that manages all the hardware and other software on a computer. It acts as an intermediary between the user and the computer hardware, allowing you to run applications and programs. Think of it as the master controller of your computer, ensuring everything runs smoothly and efficiently.

Key Functions of an Operating System:
Resource Management: Manages the computer’s hardware, including the CPU, memory, and storage.

File System Management: Organizes and controls how data is stored and retrieved on disks.
Process Management: Handles the execution of multiple programs at once.

User Interface: Provides a way for users to interact with the computer, typically through a graphical user interface (GUI).
Most Popular Operating Systems:
Windows: Developed by Microsoft, it’s the most widely used OS for personal computers. Known for its user-friendly interface and broad software compatibility.

**macOS**: Created by Apple, it’s used on Mac computers. Known for its sleek design and strong integration with other Apple products.
Linux: An open-source OS that’s popular for servers and also has distributions (distros) for personal use, such as Ubuntu, Fedora, and Debian. Known for its stability and security.
Android: Developed by Google, it’s the most popular OS for smartphones and tablets. Built on a modified version of the Linux kernel.

iOS: Apple’s mobile operating system used on iPhones and iPads. Known for its smooth performance and strong ecosystem.
In summary, an operating system is essential software that makes your computer usable, managing everything from basic tasks to running complex applications. The most popular ones include Windows, macOS, Linux, Android, and iOS.
Creating and Using a Personal Homebrew Tap
Published: 2024-07-13 16:07:47

Creating and Using a Personal Homebrew Tap
==========================================

Follow these steps to create a personal Homebrew tap and use it:

1\. Create a new GitHub repository
----------------------------------

-   The repository name should follow the format `homebrew-<tap>`.
-   For example, if you want to create a tap named `mytap`, the repository name should be `homebrew-mytap`.

2\. Add formulae to the tap
---------------------------

-   In the repository, create a new file for each formula you want to add.
-   The file should be named `<formula>.rb` and contain the Ruby code for the formula.
-   For example, to add a formula named `myformula`, create a file named `myformula.rb`.

3\. Tap the repository
----------------------

-   On your local machine, use the `brew tap` command followed by your GitHub username and the tap name:

    ```
    brew tap <username>/mytap

    ```

Replace `<username>` with your GitHub username.

4\. Install formulae from the tap
---------------------------------

You can now install formulae from your tap using the `brew install` command followed by the formula name: `myformula`

Replace `myformula` with the name of the formula you want to install.

Please replace `<username>`, `mytap`, and `myformula` with your actual GitHub username, tap name, and formula name respectively. Also, this is a very basic example. Depending on your needs, you might want to add more complex formulae to your tap.
Tijoladas Digitais Ep 3
Published: 2024-07-13 16:11:36

Bem vindos ao recap semanal do canal!! (https://www.youtube.com/@TheDigitalBrickLayer).

 2 vídeos no canal:

Como hospedar sites estáticos através de s3 buckets na aws

Vídeo: https://youtu.be/y8njwwVqa6M

A jornada de pedreiro a arquiteto de soluções aws, falando um cadinho da minha jornada de aprendizado para retirar essa certificação ep: DNS, s3 e healthchecks

Vídeo: https://youtu.be/mXKlqzLKI10

Fizemos duas lives também:

Desafios de programação:

https://www.youtube.com/watch?v=NdSaq6avnvQ

https://www.youtube.com/watch?v=wfCbyOHjXd4

System Design:

https://www.youtube.com/watch?v=dw1oKlFZt18

https://www.youtube.com/watch?v=Ue-h4zNIKz0

https://www.youtube.com/watch?v=yuP6LtWBBi8

Artigos Postados:

https://dev.to/thedigitalbricklayer/automacoes-editando-shorts-com-programacao-27de

https://www.linkedin.com/pulse/automa%C3%A7%C3%B5es-editando-shorts-com-programa%C3%A7%C3%A3o-vitor-hugo-de-castro-silva-ugrlf/?trackingId=tsDkooMSm%2FdeAT59EIUNLQ%3D%3D
Creating and Using a Personal Homebrew Tap
Published: 2024-07-13 16:15:28

Creating and Using a Personal Homebrew Tap
==========================================

Follow these steps to create a personal Homebrew tap and use it:

1\. Create a new GitHub repository
----------------------------------

-   The repository name should follow the format `homebrew-<tap>`.
-   For example, if you want to create a tap named `mytap`, the repository name should be `homebrew-mytap`.

2\. Add formulae to the tap
---------------------------

-   In the repository, create a new file for each formula you want to add.
-   The file should be named `<formula>.rb` and contain the Ruby code for the formula.
-   For example, to add a formula named `myformula`, create a file named `myformula.rb`.

3\. Tap the repository
----------------------

-   On your local machine, use the `brew tap` command followed by your GitHub username and the tap name:

    ```
    brew tap <username>/mytap
    ```

Replace `<username>` with your GitHub username.

4\. Install formulae from the tap
---------------------------------

You can now install formulae from your tap using the `brew install` command followed by the formula name: `myformula`

Replace `myformula` with the name of the formula you want to install.

Please replace `<username>`, `mytap`, and `myformula` with your actual GitHub username, tap name, and formula name respectively. Also, this is a very basic example. Depending on your needs, you might want to add more complex formulae to your tap.