teleren/devto huggingface dataset:
How to make Post views count unique in Laravel
Tags: webdev, laravel, php
Published: 2023-12-14 12:28:50

Sometimes we need to create count views for Post, Page or Others,
But how to prevent mass views count from one user? And how could this counter be as unique as possible?

In this article, I will show you how you can make views count with solutions to make it as unique as possible,

Here's where we start, here's just an example of our Post migration, to imagine what our database looks like,

```php
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->id();
            $table->string('title');
            $table->text('content');
            $table->string('slug');
            $table->boolean('status');
            $table->integer('views')->default(0);
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('posts');
    }
};
```

We will discuss in this article two ways to solve mass views as practices:

- Cookies [ In case of if you have a full stack project Laravel ]
- Cache

**Solution1 (Cookies) -> PostController**

```php
class PostController extends Controller
{
    // Get post by it's slug
    public function getPostBySlug($slug)
    {
        $post = Post::whereStatus(true)->whereSlug($slug)->firstOrFail();

        if (!Cookie::get('post_viewed_' . $post->id)) {
            // Update view counter of post
            $post->increment('views');
            // Create a cookie and set it for 1 day
            Cookie::queue('post_viewed_' . $post->id, true, 60 * 24);
        }

        return view('front.post', compact('post'));
    }

}
```

**Solution2 (Cache) -> PostController**

```php
class PostController extends Controller
{
    // Get post by it's slug
    public function getPostBySlug($slug)
    {
        $post = Post::whereStatus(true)->whereSlug($slug)->firstOrFail();

    $cacheKey = 'post_viewed_' . $post->id . '_' . request()->ip();
    if (!Cache::has($cacheKey)) {
        // Increment the view count
        $post->increment('views');

        // Set a cache entry to mark that the view has been counted for this visitor
        Cache::put($cacheKey, true, 60 * 24); // Cache for 1 day

        return response()->json(['post' => $post]);
    }

}
```

**Please note:** These solutions couldn't completely make views unique, but they help much more to save you from mass views.

Thank you for reading.
vigorblog
Tags: webdev, javascript, tutorial, beginners
Published: 2023-12-14 12:16:13

I am Jhon Clay, vigorblog seasoned PR consultant, boasts over 6 years of expertise in the dynamic realms of PR and Digital Industry. With a proven track record, he excels in streamlining processes, ensuring teams achieve their goals seamlessly. Explore more about his impactful journey at [vigorblog](https://www.vigorblog.com/).
On-Demand Transportation A Closer Look at Taxi Cab Booking Platforms
Tags: taxicabbooking, taxiinairport, sauditaxiservic
Published: 2023-12-14 12:15:56


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssrzladoraxupshuv64u.JPG)
In the ever-evolving landscape of transportation, on-demand taxi services have become a cornerstone of convenience for urban dwellers. This article explores the dynamics of on-demand transportation, focusing on the intricate workings of [taxi cab booking](https://umrah.taxi/) platforms that have revolutionized the way we commute.

## The Rise of On-Demand Transportation 
The advent of on-demand transportation marked a paradigm shift in the traditional taxi industry. The rise of companies like Uber, Lyft, and others introduced a novel approach to commuting, allowing users to request a ride with just a few taps on their smartphones. This section delves into the factors that fueled the surge in on-demand transportation services, reshaping urban mobility.

## The Technology Behind Taxi Cab Booking Platforms
At the heart of on-demand transportation lies cutting-edge technology. Cab booking platforms leverage sophisticated algorithms, GPS tracking, and real-time data analysis to optimize route planning, estimate fares, and match riders with drivers efficiently. This section provides a detailed look into the technological infrastructure that powers these platforms and enhances user experience.

## User Experience and Convenience 
One of the primary reasons for the success of [taxi in airport](https://umrah.taxi/) platforms is the seamless user experience they offer. Users can effortlessly book a ride, track their driver's location, and make cashless payments—all through a user-friendly app. This section explores the various features that contribute to the convenience and accessibility of on-demand transportation services.

## Challenges and Controversies 
Despite the convenience they bring, on-demand transportation services have faced challenges and controversies. Issues related to regulatory compliance, driver working conditions, and safety concerns have sparked debates worldwide. This section takes a critical look at the challenges these platforms have encountered and the measures taken to address them.

## The Future of On-Demand Transportation 
As technology continues to advance, the future of on-demand transportation holds exciting possibilities. This section briefly discusses emerging trends such as electric and autonomous vehicles, as well as potential innovations that could shape the next phase of on-demand [Saudi taxi service](https://umrah.taxi/).

## Conclusion 
on-demand transportation has transformed the way we move around cities, with taxi cab booking platforms at the forefront of this revolution. Despite challenges, these platforms have become integral to modern urban living, offering unparalleled convenience and efficiency. As technology evolves, the landscape of on-demand transportation is poised for further innovation and growth.
I was once lured into a crypto currency investment platform
Published: 2023-12-14 12:11:24

I was once lured into a crypto currency investment platform that I came across on Instagram. I lost about $508,000 to this evil scheme after I invested and accumulated profits, I was denied withdrawals on the specified date. I wrote to the customer support but I was given no feedback, I knew I had been scammed and I started to search for a way to recover my crypto.. I considered myself fortunate that I stumbled upon a post on the internet web about a Recovery Expert Jeanson James Ancheta wizard. I would highly recommend Jeanson James Ancheta wizard agent to anyone who wants to recover their lost funds from any scam. He is the best in the business and will do anything possible to help you get your money back. I never thought it would be possible to get back crypto once it is sent but I'm super happy and grateful for the services of Jeanson James Ancheta wizard. Kindly reach out to him if you need any help.(jeansonjamesanchetawizard62@gmail.com) or  WhatsApp number: +447529524472.
React Interview Questions Exp 2-3 yrs
Published: 2023-12-14 12:07:53

Remove duplicate elements from an array 
arr=[1,2,1,1,3,4,5,5]
arr.reduce(function(accumulator,currentValue){
if(accumulator.indexOf(currentValue)===-1){
accumulator.push(currentValue)
}
return accumulator
},[])

**What are the main features/advantages of using React?**
1. Uses Virtual DOM whenever a React application gets changes in state/prop it will re-render itself during re-render React uses Virtual DOM, Virtual DOM is an in memory representation of Real DOM whenever the application re-renders React will create a new Virtual DOM and will compare it with already existing Virtual DOM uses diffing algorithm and will update only those nodes which have changed only .

2. React uses JSX which is JavaScript XML it is a syntactic sugar which makes us be able to develop a component and write its HTML and JavaScript together

3.React has unidirectional data flow where data can only flow from Parent to child or top to bottom .

4.React follows a component based architechture where single reusable pieces of codes are classified into components and are further assembled together to develop User interface

**What are problems like prop drilling in react?**

So basically as we know in React the data flows from top to bottom like from parent to child then suppose we have a 5 level of component based application data flows from A->B->C->D->E
now you want to transfer data from A to E this will make your code less maintainable and suppose B,C,D do not want to use your data then its code duplication also so to avoid this we use global state management features in React like 
Context API and Redux

4.What are useMemo() and useCallBack() hooks in react used for?

So sometimes when we are doing some expensive calculation during re-rendering of our application this expensive calculation will happen again and again on any state/prop change even if suppose this is sum of thousand numbers so even if only THEME of application is changed and it has no relation to sum of 1000 nos still this calculation will be done again 

THAT IS WHERE THE PROBLEM IS!!!!
Doing expensive calculation again and again when not needed !!
So making the performance of application SLOWWWWWWWW!!!
SOLUTION 

useMemo() hook will cache or memoize the result of these expensive calculation it accepts a value to be remembered and a dependency 
useMemo(Value to be memoized,dependecy)
useMemo(sumofThousandNumbersResult,inputNum)

Sameway works useCallBack() except that it will cache whole function and will only re-run this functn when actually needed

useCallback(callback function,dep)
Onde pesquisar materiais científicos?
Tags: science, braziliandevs, beginners
Published: 2023-12-14 12:06:59

Pesquisar artigos, livros e materiais científicos é uma atividade comum na vida de um estudante ou pesquisador em Ciência da Computação. Praticar a leitura constante de periódicos científicos pode ajudar a conhecer mais sobre sua área de interesse na computação, bem como os diferentes métodos que envolvem a pesquisa científica. Pensando nisso, 
selecionei as bases de dados que mais utilizo nas minhas pesquisas. Fique a vontade para adicionar sugestões nos comentários.

## 1️⃣ SBC OpenLib

A [SBC OpenLib (SOL)](https://sol.sbc.org.br/) é uma biblioteca digital mantida pela Sociedade Brasileira de Computação (SBC), cujo objetivo principal é viabilizar o acesso à informação especializada em Ciência da Computação, atendendo à comunidade de pesquisadores e profissionais da área.

## 2️⃣ IEEE Explore Digital Library

A Biblioteca Digital [IEEE Xplore](http://ieeexplore.ieee.org/) é sua porta de entrada para pesquisas confiáveis, incluindo revistas, conferências, eBooks e cursos educacionais, com mais de 6 milhões de documentos para ajudá-lo a alimentar a imaginação, construir a partir de pesquisas anteriores e inspirar novas ideias.

## 3️⃣ ACM Digital Library

A [Biblioteca Digital da ACM](https://dl.acm.org/) é uma das principais bases de dados de Ciência da Computação para acessar artigos de revistas, atas de conferências, vídeos e outros materiais científicos.

## 4️⃣ Portal de Periódicos da CAPES

O [Portal de Periódicos da CAPES](https://www.periodicos.capes.gov.br) é um dos maiores acervos científicos virtuais do país, que reúne e disponibiliza conteúdos produzidos nacionalmente e outros assinados com editoras internacionais a instituições de ensino e pesquisa no Brasil.

## 5️⃣ SciELO

O [SciELO](https://www.scielo.br/) é uma biblioteca eletrônica que abrange uma coleção selecionada de periódicos científicos brasileiros, tendo por objetivo o desenvolvimento de uma metodologia comum para a preparação, o armazenamento, a disseminação e a avaliação da produção científica em formato eletrônico.

## 6️⃣ Web of Science

A [Web of Science](https://www.webofknowledge.com) é uma base de dados bibliográfica de artigos acadêmicos de 22.000 periódicos revisados por pares em todo o mundo.
Automated Roblox Limited Items Sniping with Python: Introducing AMP UGC Sniper
Tags: python, roblox, github
Published: 2023-12-14 12:02:05

Automated Roblox Limited Items Sniping with Python: Introducing [AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper).

## Introduction
Are you tired of missing out on limited items in Roblox due to the intense competition? Look no further! With my latest Python project, [AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper), you can now automate the process of claiming limited Roblox items, giving you an edge in the race to acquire these coveted virtual assets.

## Project Overview
[AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper) is a powerful Python tool designed to automate the sniping of limited items on Roblox. It boasts a range of features, including different sniping modes (such as no ratelimits, speed, quick, casual, afk, time, and specific time), multi-cookie and multi-ID support, incredible speed, proxy support, and even a Discord bot. Whether you're on Windows, Mobile, Unix, or Linux, this versatile tool has you covered.

## Usage and Contribution: 
To get started with [AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper), simply follow the instructions in the documentation to set up and customize the sniping process. Additionally, I welcome contributions from the developer community to further enhance and refine the project. Whether it's through code improvements, bug fixes, or feature additions, your contributions are valued and encouraged.

Code Example:

# Example code demonstrating the usage of [AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper)

```
# Initialize the Sniper
import pick
import os
import shutil
import json
import Sniper

# Get themes folder and the base theme
themes_dir = os.path.abspath("../themes/")
base_theme = themes_dir+"/baseTheme/"

print("Creating a theme.")
theme_name = input("What is the name of your theme: ")

# Set possible options
options = [
    "py",
    "txt"
]
option_files = [
    ["theme.py"],
    ["logo.txt", "printText.txt"]
]
```
Future Plans: In the pipeline for [AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper) are plans for additional features such as themes, extensions, and further customization options. I'm excited to continue developing and expanding the capabilities of this project. Your feedback and suggestions are pivotal in shaping the future of [AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper), so I look forward to hearing from the community.

Closing: I'm thrilled to share [AMP-UGC-Sniper](https://github.com/IncasedDevelopment/AMP-UGC-Sniper) with the developer community and hope it proves to be a valuable asset in automating the sniping of limited Roblox items. Give it a try, contribute to its development, and let's collaborate to make this project even more remarkable.

Feel free to personalize and modify the content as needed. If there are specific details or adjustments you'd like to make, please let me know!
Restroom Trailer Colorado
Published: 2023-12-14 11:56:36

Our team is dedicated to making your rental process smooth and easy. We are committed to renting out only the highest quality restroom and shower trailers. Experience top-tier hygiene in Colorado. Our restroom trailers promise cleanliness, luxury, and convenience at any event. Book today! 

[Restroom Trailer Rentals Pueblo-Canon City](https://restroomtrailercolorado.com/two-stall-restroom-trailer-fort-collins-co/)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5c4d8r9xwizujec21nln.jpg)
CI/CD Pipeline on Brainboard
Tags: cicd, devops, design, deploy
Published: 2023-12-14 11:54:00

Designing a CI/CD pipeline using [Brainboard's CI/CD designer](https://www.brainboard.co/marketplace/features/cicd-engine) involves several key steps and best practices:

- **Understanding the CI/CD Designer:** Brainboard's CI/CD designer is a visual editor that simplifies pipeline creation without requiring YAML knowledge. This tool focuses on building the logic and process of the pipeline efficiently​​.
- **Workflow Creation:** A workflow in Brainboard is a set of orchestrated stages containing tasks that run in parallel or sequentially. It's essentially a sequence of steps your infrastructure goes through before, during, and after provisioning​​.
- **Defining Tasks:** Tasks are individual actions within a workflow, like applying Terraform configurations, sending Slack notifications, or updating ticketing systems. Tasks are created from available plugins, and each task can include an approval option, delaying execution until approved by designated individuals or teams​​.
- **Staging Tasks:** Stages are logical groupings of tasks that execute simultaneously. In Brainboard's CI/CD designer, stages are represented vertically and are dependent on the completion of tasks in the preceding stage​​.
- **Workflow Templates:** After finalizing a workflow, you can create a template from it for use in other architectures. This feature enhances reusability and consistency across different projects​​.
- **Running the Pipeline:** Once the workflow is configured, you can trigger the pipeline execution. The Pipelines page displays the real-time output of the execution, allowing you to monitor the process​​.
- **Best Practices:** Ensure hygiene in infrastructure building by using pipelines to analyze architecture before pushing it to a Git repository. Avoid using generic emails for task approvals unless the email is a Brainboard user​​.

This structured approach helps in designing effective and efficient CI/CD pipelines on [Brainboard](https://www.brainboard.co/marketplace/features/cicd-engine), ensuring smooth automation and deployment processes in cloud infrastructure management.
Enlaces interesantes :)
Published: 2023-12-14 11:53:23

[Intranet a medida](https://www.illusionstudio.es/servicios/desarrollo-intranet-a-medida)

[Extranet a medida](https://www.illusionstudio.es/servicios/desarrollo-extranet-a-medida)

[Agencia SEO Valencia](https://www.illusionstudio.es/servicios/agencia-seo-valencia)

[Material entrenamiento funcional](https://keniafitness.es/)

[Tienda de moda de mujer](https://lima-limon.net/)

[Papelerias online valencia](https://www.ofitake.com/)
Instagram Automation Tools
Tags: instagram, automation, node, react
Published: 2023-12-14 11:41:39

You can gather tens of thousands of users from one user with the features you are looking for on Instagram, collect phone numbers or e-mail addresses from their bios, contacts, and then send them a message with the text/HTML you want.
[https://github.com/suphiyasin/Instagram-Automation-Tools](https://github.com/suphiyasin/Instagram-Automation-Tools)
Screenshots (Realtime for Dev.to)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0j4ko7xl8hd3dytyxj4f.png)
Fitness Club Gym
Published: 2023-12-14 11:37:24

Fitness Club Gym is a premier fitness destination in Nagpur, offering cutting-edge
gym services at two convenient locations: Ambazari and Manish Nagar. We provide a dynamic
and motivating environment for individuals of all fitness levels, equipped with state-of-the-art
facilities and expert trainers. Join us on your fitness journey and experience unparalleled
wellness tailored to your goals.
UPDATE AND REDEPLOY THE APP IN AZURE
Tags: beginners, azure, devops, cloudcomputing
Published: 2023-12-14 11:30:53

* In cloud shell type **vim index.html** to open text editor and click enter


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

* Locate ***hi*** heading tag and remove everything after the **Azure App Service**


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

* Remember you have to be in **insert** mode to edit text in vim. So click **I** on the keyboard and delete everything after **Azure App Service**. To exit vim text editor, press **ESC key + shift:wq**


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

* Use the up arrow key to get your commands back.
In my case this is my command **az webapp up --location centralus --name nifemi --html** and hit enter.

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

* Copy your URL and test it.


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/79l0sz7849xl6ir8dt58.png)
Calling All Web3 Developers! "Build With $SCAI Network"
Published: 2023-12-14 11:26:45

**First 5 projects:**

⚙️ Soar with full product support and an exclusive 90-day #SCAI Incubation for an immersive experience.

**Next 1️5 projects:**

💼 Enjoy personalized consultation, cutting-edge smart contract development, a robust security audit, seamless #KYC integration, and a strategic promotional push.

**Following 30 projects:**

🚀 Accelerate with streamlined KYC, a thorough security audit, and a tailored promotion plan to enhance visibility.📑

**Next 50 projects:**

🔥 Fuel momentum with a simplified KYC process and a dynamic promotion strategy.⚙️

🥷 The top 100 developers selected will benefit from these support segments. Take advantage of this opportunity to skyrocket your project! ⚡️🏆

🔗 **Reach out to us today!**

📥 [https://t.me/SecureChainAI/144656](https://t.me/SecureChainAI/144656)
Build tiny docker container for go app using multi-stage Dockerfile
Tags: docker, go, beginners, learning
Published: 2023-12-14 11:18:50

Use latest version of golang as builder container
```bash
FROM golang:1.21-alpine as builder
```

Set workdir to /app
```bash
WORKDIR /app
```

Copy files from current dir to /app/*
```bash
COPY . .
```

Download mods 
```bash
RUN go mod download
```

Build go app in build container
```bash
RUN CGO_ENABLED=0 go build -o /my-app
```


Use as small container as possible
```bash
FROM scratch
```

Copy root SSL sertificates to production container
```bash
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
```

Copy our app from build container to production container
```bash
COPY --from=builder /my-app /my-app
```

Set entrypoint
```bash
ENTRYPOINT ["/my-app"]
```



to build our app run
```bash
docker build -t goapp .
```

and run it
```bash
docker run --rm -it goapp
```
Your Ultimate AR & VR App Development Choice - TechnBrains
Published: 2023-12-14 11:11:59

Unlock new dimensions with TechnBrains! Experience the world through our cutting-edge AR/VR mobile apps. Our expert team crafts immersive applications that redefine practicality with a touch of modern technology. As a full-service AR/VR app development company, we cater to diverse needs, ensuring our clients stay ahead in any industry.

**Why Choose TechnBrains?**

•Unmatched Ease: Seamless onboarding and development process.
•Varied Expertise: From simple apps to full-fledged, feature-rich solutions.
•Comprehensive Services: Beyond AR/VR app development, we provide complementary services.
•Cross-Platform Excellence: Delivering on Android or iOS, wherever your audience is.

Unlock new dimensions today with TechnBrains—the top choice for cutting-edge [AR VR app development services](https://www.technbrains.com/mobile-application/ar-vr-app-development/). Choose us for a seamless, client-focused experience and stay ahead in the digital age