teleren/devto huggingface dataset:
Web-dev/design template implementation and creation?
Tags: webdev, beginners
Published: 2023-03-27 10:31:09

I've been trying out loads of different way to make the most effecient "template" for my site [https://swishlimohouston.com/](https://swishlimohouston.com/). The site consists of 'Sections', 'Menus' and 'SubMenus'. So to the question; what would be the most efficient and "slick" way of making a "template" for it? I've tried including headers and footers (Making all "head" items in the "header.php" and closing everything in the "footer.php"). I've tried using Case/Switches and includes - But all this gets very inefficient when you have a lot of redirects and pages. So I've been pondering over other sites go about in doing this..

What would you suggest that I start looking into?
Red Boost Reviews: [Results and Opinions] Beware Before Buying!
Published: 2023-03-27 10:26:07

This fix is best done with it. That viewpoint is hard to resist. This is done so that you can see using it because at least you have your options. You should look at what's inside the Red Boost industry. That is how they could help. Read on as I make plain the chances of subordinates using it properly. Categorically, guess what is happening with it? You should do a little research on the data. Using this should be banned. How mesmerizing! 

OFFICIAL WEBSITE: https://www.outlookindia.com/outlook-spotlight/red-boost-legit-or-fake-ingredients-cheap-price-shocking-results-warnings--news-272970

Related Reference

https://www.outlookindia.com/outlook-spotlight/-be-alert-prostadine-drops-2023-scam-complaints-and-fake-ingredients-prostadine-reviews-aus-ca-and-usa-news-256650

https://www.linkedin.com/pulse/red-boost-reviews-does-blood-flow-support-formula-really-ashworth/
10 Must-Have Tools for Every Developer in 2023
Tags: ai, chatgpt, webdev, tooling
Published: 2023-03-27 10:02:27

As the technology landscape continues to evolve, so do the tools that developers rely on to create software. With the start of the new year, it's time to take a look at the top 10 must-have tools for developers in 2023.

1. GitHub Copilot: This AI-powered coding assistant is a game-changer for developers. It uses machine learning to suggest code snippets and autocomplete code, making coding faster and more efficient.
2. Docker: Docker containers allow developers to create and deploy applications quickly and reliably. It's a must-have tool for those who want to streamline their development workflow.
3. VS Code: This lightweight, open-source code editor has become the go-to tool for many developers. It offers a wide range of features, including debugging, syntax highlighting, and Git integration.
4. CircleCI: This cloud-based platform automates the testing and deployment process, making it easier for developers to deliver high-quality code faster.
5. Postman: This API development tool simplifies the process of testing and debugging APIs. It's a must-have for developers who work with APIs regularly.
6. React Native: This JavaScript framework allows developers to build native mobile apps for iOS and Android using a single codebase. It's a great tool for those who want to develop mobile apps quickly.
7. Elasticsearch: This distributed search and analytics engine is a must-have for developers who work with large amounts of data. It offers fast search and indexing capabilities, making it easy to find and analyze data.
8. Sentry: This error tracking tool helps developers quickly identify and fix bugs in their code. It integrates with many popular frameworks and languages, including JavaScript, Python, and Ruby.
9. GitLab: This web-based Git repository management tool offers a wide range of features, including continuous integration and deployment, code review, and issue tracking.
10. Terraform: This infrastructure-as-code tool allows developers to manage their infrastructure as code. It simplifies the process of managing and scaling infrastructure, making it easier to deploy applications to the cloud.

In conclusion, these are the 10 must-have tools for every developer in 2023. Whether you're a beginner or an experienced developer, these tools will help you streamline your workflow, increase your productivity, and deliver high-quality code faster. So, what are you waiting for? Start exploring these tools today and take your development skills to the next level! [Generated by ChatGPT]
The development of fintech businesses and how it has altered current practices
Tags: fintech, business, productivity, javascript
Published: 2023-03-27 09:55:49

Financial technology, or fintech, is the application of technology to enhance and automate financial services. Fintech businesses are upending the conventional financial sector by offering fresh and cutting-edge methods of obtaining financial services. The following are some ways that fintech companies are altering how we now do business:

**1. Banking:** Fintech firms have made it feasible to quickly open a bank account online. Digital wallets have also been launched, enabling users to store and transfer funds without the requirement for a conventional bank account.

**2. Payments:** Fintech businesses are transforming how we send and receive money. Peer-to-peer payments, digital currencies, and mobile payments are just a few instances of how Fintech firms are revolutionizing how we pay for products and services.

**3. Investments:** Thanks to fintech firms, the typical person can now invest more easily. Anyone can invest their money in a diverse portfolio with the aid of robo-advisors without the need for a financial advisor.

**4. Loans:** Fintech firms have made it simpler for customers to apply for loans. Platforms for peer-to-peer lending let users borrow money from other users instead of from traditional financial institutions.

**5. Insurance:** By providing individualized insurance solutions that are suited to specific needs, fintech startups are upending the insurance sector.

Overall, fintech businesses are revolutionizing the way we conduct business by offering quicker, more practical, and more individualized financial services. In the years to come, it's possible that the financial industry will undergo even more changes as these businesses expand and develop.
Actualizar de golpe todos los plugins de una app de cordova desde MacOS
Tags: cordova, script, macos
Published: 2023-03-27 09:51:53

Actualizar los plugins de una app de Cordova, sobre todo si es antigua, es una tortura. Hay varios métodos, pero uno de ellos es quitar y luego volver a instalar cada uno de los pluings.

Con este script, esta tarea se realiza en un momento:

```
#!/bin/bash

PLUGINS=$(cordova plugin list | awk '{print $1}')

for PLUGIN in $PLUGINS; do
    cordova plugin rm $PLUGIN --save && cordova plugin add $PLUGIN --save
done
```
Kill a process using a specific port (MacOS)
Tags: systems
Published: 2023-03-27 08:40:22

Simply do:
`lsof -ti :[port number] | xargs kill


This command is a combination of two commands, `lsof` and `xargs`, that are used together to find and kill a process that is using a specific port. Let's break down each part of the command:

- `lsof`: This is short for "list open files," and it is a Unix/Linux command used to display information about open files and the processes that opened them. In this context, it is used to find processes that have open network connections.
- `-ti`: These are options passed to the `lsof` command.
  - `-t`: This option tells `lsof` to display only the process IDs (PIDs) of the processes that match the specified criteria.
  - `-i`: This option is followed by a specification of the network connection to be matched. In this case, it is `:[port number]`, where `[port number]` should be replaced with the actual port number you want to check.
- `:[port number]`: Replace `[port number]` with the actual port number you want to check for open connections.
- `|`: This is the pipe symbol, which is used to pass the output of one command (in this case, `lsof`) as input to another command (in this case, `xargs`).
- `xargs`: This command reads items from standard input, separated by whitespace or newlines, and executes a specified command with those items as arguments. In this case, it is used to execute the `kill` command with the PIDs obtained from `lsof`.
- `kill`: This is a Unix/Linux command used to send signals to processes, typically to terminate them. In this case, it is used to terminate the process that has an open connection on the specified port.

When you run `lsof -ti :[port number] | xargs kill`, the command will find the process that has an open connection on the specified port, and then kill that process using the `kill` command.

## Further Tips on Similar Commands

1. `lsof -i`: To list all processes with open network connections, use the `lsof -i` command.
2. `kill -9 [PID]`: If the process doesn't terminate with the regular `kill` command, you can use `kill -9 [PID]` to send a stronger signal (SIGKILL) to the process.
3. `netstat -tuln`: To view a list of all listening ports along with the associated programs, use the `netstat -tuln` command.
4. `pgrep [process name]`: To find the PID of a process based on its name, use the `pgrep` command, followed by the process name.
5. `pkill [process name]`: To kill a process based on its name, use the `pkill` command, followed by the process name.
`
How to set X-Robots-Tag in htaccess for any query string
Tags: apache, opensource
Published: 2023-04-05 14:03:56

---
title: How to set X-Robots-Tag in htaccess for any query string
published: true
date: 2023-03-27 09:41:14 UTC
tags: apache,OpenSource
canonical_url: https://daniele.tech/2023/03/how-to-set-x-robots-tag-in-htaccess-for-any-query-string/
---

It is just a note for me to remember this trick: 

```
RewriteCond %{QUERY\_STRING} . RewriteRule .\* - [E=MY\_SET\_HEADER:1] [QSD,R=302,L] 
Header set X-Robots-Tag "noindex, nofollow" env=MY\_SET\_HEADER
```

It is based on the suggestion here but with a change to support if there is any query string in the URL. [...]

[Read More...](https://daniele.tech/2023/03/how-to-set-x-robots-tag-in-htaccess-for-any-query-string/)

The post [How to set X-Robots-Tag in htaccess for any query string](https://daniele.tech/2023/03/how-to-set-x-robots-tag-in-htaccess-for-any-query-string/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
Try Alpaca-LoRA on my laptop
Tags: python, c, machinelearning
Published: 2023-03-27 09:22:21

[Alpaca-LoRA](https://github.com/tloen/alpaca-lora) is an open-source project that reproduces results from Stanford Alpaca using Low-Rank Adaptation (LoRA) techniques. It provides an Instruct model of similar quality to [text-davinci-003](https://platform.openai.com/docs/models/gpt-3-5), runs on a Raspberry Pi (for research), and the code is easily extended to 13b, 30b and 65b models.

It is impressive that Alpaca-LoRA can scale down the model to run on personal computers without relying on GPU, which I found very intriguing. As a result, I tried the model myself and leaved some screenshots. The whole process is on i7-10750H CPU, 32 GB RAM. The OS is Ubuntu 22.04.

## Alpaca-LoRA
Source: https://github.com/tloen/alpaca-lora

Run the program
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvmrkgzjtmblxwu0jka2.png)
Resource usage
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vu56dx6wijittgwhl1vy.png)
Screenshots of inputs and responses, each response takes 330 to 420 seconds (Maybe the memory is exhausted and swap is used, so it is very slow?)
Ask it a sample question:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlv0i6pjo8n3g42mck8z.png)
Ask it to write me a BMI calculator:
The BMI program is correct, it also provides parameter annotations.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zs5ebyfgsemc4trcjwg.png)
Ask it to write me Tower of Hanoi:
The program seems wrong.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxd9an9lj5amqobuuan4.png)
Ask it "what is machine learning?" in Chinese and have it answer in Chinese:
It can understand Chinese but can only answer in English.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvlo2v04bbh0kkhn0npz.png)

## llama.cpp
Source: https://github.com/ggerganov/llama.cpp
The github user ggerganov writes an tensor library for machine learning in C called ggml. Then he ports ggml to LLaMA model, change 16-bit float into smaller value type, and use AVX2 or NEON to accelerate on CPU. See his [comment](https://github.com/ggerganov/llama.cpp/issues/33#issuecomment-1465108022) for more information.

The smallest model alpaca-lora-7B-ggml only weights 4GB and can run on a raspberry pi. See the [video](https://www.youtube.com/watch?v=eZQTYTst53o). I wanted to try this as well, but there's a breaking change recently, not sure if this model works now. So I tried alpaca-lora-30B-ggml. It still executes very slowly, and there seems to be a small bug in the interactive command line. Hope it will be improved to be usable in the future.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ku5a3c2ibs4dmc4le8zz.png)
See: https://www.youtube.com/watch?v=RgSAe8tDfew
Como obtener el tamaño de las todas las tablas de una base de datos SQL Server
Tags: sql
Published: 2023-03-27 09:18:43

Muchas veces, el tamaño de una base de datos se nos dispara y no sabemos muy bien porqué. Suele ocurrir por tablas de traza principalmente, pero a veces es difícil saber exactamente donde está el "problema".

Hay varias opciones para obtener el tamaño de las tablas de una base de datos SQL Server, pero aquí os voy a poner el que más me gusta a mi, porque es un script que se ejecuta en la base de datos que queremos analizar:

```
SELECT a3.name + '.' + a2.name AS [name], 
   a1.rows AS [rows], 
   (a1.reserved + ISNULL(a4.reserved, 0)) * 8 AS [Reserved KB], 
   a1.data * 8 AS [Data KB], 
   (CASE
        WHEN(a1.used + ISNULL(a4.used, 0)) > a1.data
        THEN(a1.used + ISNULL(a4.used, 0)) - a1.data
        ELSE 0
    END) * 8 AS [Index_size KB], 
   (CASE
        WHEN(a1.reserved + ISNULL(a4.reserved, 0)) > a1.used
        THEN(a1.reserved + ISNULL(a4.reserved, 0)) - a1.used
        ELSE 0
    END) * 8 AS [unused KB], 
   CONVERT(DECIMAL(18, 2), (((a1.reserved + ISNULL(a4.reserved, 0)) * 8) - ((CASE
                                                                                 WHEN(a1.reserved + ISNULL(a4.reserved, 0)) > a1.used
                                                                                 THEN(a1.reserved + ISNULL(a4.reserved, 0)) - a1.used
                                                                                 ELSE 0
                                                                             END) * 8)) / 1024.0 / 1024.0) AS [Table_used_Space GB]
FROM
(
SELECT ps.object_id, 
       SUM(CASE
               WHEN(ps.index_id < 2)
               THEN row_count
               ELSE 0
           END) AS [rows], 
       SUM(ps.reserved_page_count) AS reserved, 
       SUM(CASE
               WHEN(ps.index_id < 2)
               THEN(ps.in_row_data_page_count + ps.lob_used_page_count + ps.row_overflow_used_page_count)
               ELSE(ps.lob_used_page_count + ps.row_overflow_used_page_count)
           END) AS data, 
       SUM(ps.used_page_count) AS used
FROM sys.dm_db_partition_stats ps
GROUP BY ps.object_id
) AS a1
LEFT OUTER JOIN
(
SELECT it.parent_id, 
       SUM(ps.reserved_page_count) AS reserved, 
       SUM(ps.used_page_count) AS used
FROM sys.dm_db_partition_stats ps
     INNER JOIN sys.internal_tables it ON(it.object_id = ps.object_id)
WHERE it.internal_type IN(202, 204)
GROUP BY it.parent_id
) AS a4 ON(a4.parent_id = a1.object_id)
INNER JOIN sys.all_objects a2 ON(a1.object_id = a2.object_id)
INNER JOIN sys.schemas a3 ON(a2.schema_id = a3.schema_id)
WHERE a2.type != N'S'
  AND a2.type != N'IT'

ORDER BY [Table_used_Space GB] DESC, [rows] desc ;
```

El resultado es este:


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



Este script no es mío. Es de Vivek Janakiraman que lo publicó en las galerías Technet de Microsoft.
Migration Sencha ExtJS to React JS - any experience?
Tags: react
Published: 2023-03-27 09:06:38

We are currently planning to migrate our complete web application UI from Sencha ExtJS to React JS. I am wondering if anybody has experience doing so? Is there any tool support to make the migration easier?

If you have any experience I would be really grateful if you could share it with me.

Thanks in adcance.

Constance
Schedule / Timeline for React with Planby 2.3.0 🚀
Tags: webdev, javascript, opensource, react
Published: 2023-03-27 08:35:43

## Hello readers!
[Planby](https://planby.netlify.app/) is a component for a quick implementation of Schedules, Timelines, Electronic Program Guide, Conference / Calendar Planner, Music Events and many more ideas. It uses a custom virtual view which allows you to operate on a really big amount of data.
The component has a simple API that you can easily integrate with other third-party UI libraries.
The component theme is customized to the needs of the application design.
Planby is a complex and multi-functional component which meets all the project requirements.

![Alt Text](https://media.giphy.com/media/rVVFWyTINqG7C/giphy.gif)

## Planby 2.2.3 has been released! 🚀
The current version includes a number of key functionalities that makes Planby a fully multifunctional component that meets all project requirements.



### Major new feature connected with endless scroll for multiple days 🥳 🥳

### Below is a list of new functionalities:
- endless scroll through multiple days
- new virtual Timeline component and custom render function
- visibility of the current time
- custom render function for visibility of the current time
- custom render function for time tracking line
- live time refresh option
- global styles - you can easily overwrite fonts, component styles without need to use custom render function 🥳

![Alt Text](https://media.giphy.com/media/vKHKDIdvxvN7vTAEOM/giphy.gif)

Check out [Planby](https://planby.netlify.app/) with a control panel 🚀
Rate Limiting in Distributed Systems
Tags: distributedsystems, systems, beginners, tutorial
Published: 2023-03-27 08:05:04

Rate limiting is great with [distributed systems](https://dev.to/pragyasapkota/distributed-system-the-definition-nkh) but not without some complications. We already read about [rate limiting](https://dev.to/pragyasapkota/rate-limiting-3306) and distributed systems before and now we will discuss the problems with them coming together.

### 1. Inconsistencies

When you have a distributed system with [clusters](https://dev.to/pragyasapkota/clustering-how-much-does-it-differ-from-load-balancing-3i1e) of multiple nodes, a global rate limit policy is preferred since tracking of rate limit by each node might lead a consumer to exceed the global limit of sending requests to different nodes altogether. This is even riskier when there are even more nodes.

To solve this, we can use sticky sessions in load balancers which will result in each user being sent to exactly one node. However, this means there will be no fault tolerance and more scaling problems. Likewise, we can use a centralized data store like [Redis](https://redis.io/) as well. Then, it has more latency and causes race conditions.

### 2. Race Conditions

Further, race conditions occur when a naïve “get-then-set” approach is used. Under the operation, the current rate limit counter is retrieved, followed by an increment and push to the data store. The issue here is that the new requests can come through in the time it takes to perform a full cycle of read-increment-store, each trying to store the increment counter with an invalid (lower) counter value. This way, the user can send more requests to bypass the rate-limiting controls.

To solve this problem, implementing distributed locking mechanism around the key might be a good way. It prevents other processes from gaining the access to the operations to write on the counter. However, the lock here transforms into a bottleneck and doesn’t scale well.

In addition, you can also use the alternative “set-then-get” approach that increments and checks the counter values quickly without letting the atomic operations get in the way.

## Conclusion

Rate limiting can be a great deal with [distributed systems](https://dev.to/pragyasapkota/distributed-system-the-definition-nkh) if the complications can be handled. However, it might be difficult if those complications increase repeatedly.

**_I hope this article was helpful to you._**

**_Please don’t forget to follow me!!!_**

**_Any kind of feedback or comment is welcome!!!_**

**_Thank you for your time and support!!!!_**

**_Keep Reading!! Keep Learning!!!_**
Most Developers Can't Answer This Question About Anonymous Functions 🤯
Tags: javascript, webdev, beginners, programming
Published: 2023-03-27 07:49:24

Given the following code:
```js
function add(a, b) {
  return a + b
}
const add1 = function(a, b) {
  return a + b
}
const add2 = function add(a, b) {
  return a + b
}
const add3 = (a, b) => a + b
const addFunctions = []
addFunctions.push( (a, b) => a + b )
addFunctions.push(add3)
addFunctions[2] = (a, b) => a + b
```
Which of the following expressions evaluate to anonymous functions:
* a) `addFunctions[2]`
* b) `(a, b) => a + b`
* c) `add`
* d) `addFunctions[0]`
* e) `add1`
* f) `add2`
* g) `addFunctions[1]`
* h) `add3`
* i) `(function (a,b) { return a + b })`

Give it your best shot in the comments! 🙂

---

Since this post is now quite old, I've added the solution:
{% spoiler CLICK FOR ANSWER%}<br/>The correct answer is: **a, b, d, i**{% endspoiler %}
Why i use a smaller docker image
Tags: dockerfile, docker, trivy, snyk
Published: 2023-03-27 07:44:00


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


**What is Docker?** Docker is a famous platform for building, shipping, and running container applications. What are containers? Containers are a way to package software in a portable and isolated environment, this allows developers to package their application with all the dependencies it needs to run together, regardless of the host operating system.

_Using Docker, developers can create container images containing everything needed to run an application, including the operating system, libraries, and runtime environment. These container images can be easily shared and deployed across different environments with docker software installed without requiring any modification._

There are cases whereby developers end up using big images which can be very harmful and contains vulnerabilities. Using containers makes things very easier, we can simply get an OS and install all the dependencies required.

There are several ways to ensure that the docker images developers are using are as small as possible. There is a big advantage, imagine running an application serving billions of users and the size is in kilobytes or megabytes.

The following are suggestions while writing a Dockerfile 

1. Implement docker layering and docker multi-build stage
2. Use [alpine](https://hub.docker.com/_/alpine) or [distroless](https://github.com/GoogleContainerTools/distroless) or any other smaller OS as your base image or build your own OS
3. Use .dockerignore which is similar to `.gitignore` you can use a .dockerignore file to exclude files and directories from being included in the Docker build context. This can significantly reduce the size of the build context and the resulting image.

In conclusion, in my next article, I will show an example of a Dockerfile in golang with the above suggestion. We will be able to compare the size of the docker image with and without optimizing the Dockerfile. We will also use tools like [trivy](https://github.com/aquasecurity/trivy) or [synk](https://snyk.io/) to check if there is a vulnerability or exploit in the docker image with or without optimization of the Dockerfile.