teleren/devto huggingface dataset:
A KEYBOARD USING JUST HTML AND CSS
Tags: webdev, javascript, beginners, programming
Published: 2024-04-21 11:18:36

## IDEA
WHEN I WAS USING MY COMPUTER ONE OF MY KEYS CAME OUT AND I WAS IN A SHOCK AND BOUGHT A NEW KEYBOARD .I THOUGHT I FOUND A SOLUTION TO THIS PROBLEM BUT NO CHANCE I AM NOT A TECHNICIAN .SO I DECIDED TO MAKE ONE USING MY CODING SKILLS BUT I DECIDED TO USE ONLY HTML AND CSS AND NO GRAPHICS

## HTML
I FIRST PUT A CONTAINER AND NEXT I DIVIDED THE KEYBOARD INTO DIFFERENT DIV'S THE FIRST ROW AS ONE DIV THE SECOND ROW AS ONE DIV AND SO ON...IN THE LAST I HAD LEFT 40VW FOR THE TOUCH PAD AND THATS ALL..

## CSS
THE LAST IS CSS AND WE CAN'T TALK MUCH ABOUT IT BECAUSE I WENT MAD
The Rule of Threes: A Novella.Jeffery Deaver
Published: 2024-04-21 11:17:18

The Rule of Threes: A Novella.Jeffery Deaver                                                                                                                                              Constant Marlowe follows a serial killer deep into the dark heart of a small town in this riveting novella by Jeffery Deaver, the New York Times bestselling author of The Broken Doll collection and the Colter Shaw series.   **[click](https://youtu.be/afZpNo9X6-I?si=hoVF8AUZ4BXNVCTh)**
Friends in Napa: A Novel Sheila Yasmin Marikar
Published: 2024-04-21 11:14:12

Friends in Napa: A Novel   Sheila Yasmin Marikar                                                                                                                                                     “Smart and wildly entertaining…like drinking a glass of wine with an endlessly witty, scandalous friend.” –Mindy Kaling
Six old friends descend on Napa Valley for a luxurious weekend of fine wine and good times…until old tensions simmer to the surface. So much can go wrong in this dark comedy by the author of The Goddess Effect.
Just get yourselves here, everything else is on us.       **[ https://youtu.be/trVGPIriGtA?si=_wGsdTt_k2iHMb42click](url)**
Tides of Change: The Americans are joining the war... (Spitfire Mavericks Thrillers Book 5) ,
Published: 2024-04-21 11:11:59

Tides of Change: The Americans are joining the war... (Spitfire Mavericks Thrillers Book 5) , D. R. Bailey
An exciting war thriller set in the aftermath of Pearl Harbor! For fans of Derek Robinson, James Holland, Frank Barnard and Jack Higgins.

Everything changes when US soldiers join the ranks…

December, 1941

After a tense encounter with attacking Focke-Wulfs, Flying Officer Angus Mackennelly returns to base to find Squadron Leader Bentley announcing the bombing of Pearl Harbor.

US forces are being drafted in as war is declared on Japan and an American airbase is to be established next to the RAF Banley base used by the Maverick Squadron.   **[ click](https://youtu.be/9238O1IqD4A?si=1_QY0e2nKK7i4Pyx)**
can not fetch data from asp.net core web api in flutter
Published: 2024-04-21 11:11:48

i am trying to develop mobile app in flutter as fronted and asp.net core web api for  rest api  development in ms sql server data base . 
i create web api in 
asp.net core web api  visual studio 2002 and host in my server panel after publishing the api (entity frame work )
https://app.smartdriveservice.com/api/Users
https://app.smartdriveservice.com/api/Users/2

without entities frame work 
https://mobile.smartdriveservice.com/api/CRUD/GetAllRegistration

https://mobile.smartdriveservice.com/api/CRUD/GetAllRegistrationById/1

https://mobile.smartdriveservice.com/api/CRUD/UpdateRegistration

https://mobile.smartdriveservice.com/api/CRUD/AddNewRegistration

https://mobile.smartdriveservice.com/api/CRUD/DeleteRegistration/1


all are working properly in post man .. but when I want to run and fetch in flutter for ui design that data can not retrieve .. ..

any one help me to solve my problem  sradhanjali.sradha@gmail.com +91-7008182025
regarding php script is not getting executed
Published: 2024-04-21 11:07:54

Hi,

When I am trying to execute below php script using a html webpage but it's not getting executed instead of this it points to the script itself.

here is that php script:- 

``
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'E:/SW/XAMPP Installation/htdocs/fl1/PHPMailer-6.9.1/PHPMailer-6.9.1/src/Exception.php';
require 'E:/SW/XAMPP Installation/htdocs/fl1/PHPMailer-6.9.1/PHPMailer-6.9.1/src/PHPMailer.php';
require 'E:/SW/XAMPP Installation/htdocs/fl1/PHPMailer-6.9.1/PHPMailer-6.9.1/src/SMTP.php';

// Enable error reporting for debugging
error_reporting(E_ALL);
ini_set('display_errors', 1);

// Check if the form was submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Form data
    $name = $_POST['name'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $message = $_POST['message'];

    // Initialize PHPMailer
    $mail = new PHPMailer(true);

    try {
        // Server settings
        $mail->isSMTP();
        $mail->Host = 'smtp.gmail.com'; // Change this to your SMTP server hostname
        $mail->SMTPAuth = true;
        $mail->Username = 'my gmail email id'; // Change this to your email address
        $mail->Password = 'mypassword'; // Change this to your email password
        $mail->SMTPSecure = 'tls';
        $mail->Port = 587;

        // Sender and recipient
        $mail->setFrom($email, $name); // Use client's email and name as sender
        $mail->addAddress('receipient gmail id'); // Change this to the recipient email address

        // Content
        $mail->isHTML(true);
        $mail->Subject = "Message from $name";
        $mail->Body = "Name: $name<br>Phone: $phone<br>Email: $email<br>Message: $message";

        // Send email
        $mail->send();
        echo "Thank you! Your message has been sent.";
    } catch (Exception $e) {
        echo "Oops! Something went wrong: {$mail->ErrorInfo}";
    }
} else {
    // Redirect back to the contact form if accessed directly
    header("Location: index.html");
}
?>
HTML Counter
Tags: codepen, html, counter
Published: 2024-04-21 11:06:50

Check out this counter for webs that I made!

```
<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Contador de Clicks</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      text-align: center;
    }
    #contenedor {
      margin-top: 50px;
    }
    #contador {
      font-size: 64px;
      color: #333;
      background-color: #f0f0f0;
      border: 2px solid #ccc;
      border-radius: 6px;
      padding: 20px 136px;
      display: inline-block;
    }
    #botonContenedor {
      margin-top: 20px;
    }
    button {
      padding: 10px 20px;
      background-color: #007bff;
      color: #fff;
      border: none;
      cursor: pointer;
      border-radius: 5px;
      margin: 0 10px;
      font-size: 16px;
    }
  </style>
</head>
<body>
  <div id="contenedor">
    <span id="contador">0</span>
    <div id="botonContenedor">
      <button id="botonContador" onclick="sumarClick()">Haz clic para sumar</button>
      <button onclick="resetearContador()">Resetear</button>
    </div>
  </div>

  <script>
    var contador = 0;

    function sumarClick() {
      contador++;
      document.getElementById("contador").innerText = contador;
    }

    function resetearContador() {
      contador = 0;
      document.getElementById("contador").innerText = contador;
    }
  </script>
</body>
</html>

```
can not fetch asp.net core web api data in flutter
Published: 2024-04-21 10:58:10

i am freelancer in asp.net . now I want to develop mobile app in flutter and create web api in (asp.net core web api  in visual studio 2022)
all api work properly in post man locally also in web hosting 

using entity framework 
https://app.smartdriveservice.com/api/Users
https://app.smartdriveservice.com/api/Users/1

without entity frame work 

https://mobile.smartdriveservice.com/api/CRUD/GetAllRegistration

https://mobile.smartdriveservice.com/api/CRUD/GetAllRegistrationById/1

https://mobile.smartdriveservice.com/api/CRUD/UpdateRegistration

https://mobile.smartdriveservice.com/api/CRUD/AddNewRegistration

https://mobile.smartdriveservice.com/api/CRUD/DeleteRegistration/1

data base is ms sql server 2018 

but when i try to fetch in flutter that data can fetch only blank screen show in flutter window please help me to solve the problem where is the error 

sradhanjali.sradha@gmail.com +91- 7008182025
Set up an Automation script with Ansible
Tags: ansible, linux, devops
Published: 2024-04-21 10:53:30

[Ansible](https://www.ansible.com/) is a tool used to help manage software automation processes, configuration management across machines, deployment as well as remote execution of commands and scripts. In sports, Ansible operates as the coach of your team by providing strategies (playbooks), and actions, and ensuring the smooth execution of tasks across your infrastructure, just like a coach guides and directs players (Servers)during a game.

In Ansible, a playbook is a file containing a series of instructions that specify the tasks to be performed on remote systems. These tasks are typically related to configuration management, application deployment, system orchestration, and other automation processes. Playbooks are written in YAML format.

In Ansible, a server is a remote computer system that Ansible manages and interacts with using SSH (Secure Shell) or other connection methods. The servers can be virtual machines or cloud instances accessible within a network.

#### Prerequisites

1. Ansible is installed on your device.


#### Step 1: After installing Ansible, we create a directory where we store all the files needed.


#### Step 2: Create an inventory file (inventory.ini)in the directory and define our service. We add localhost as the testing environment.


![Inventory file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdhgye4oav2tgak7uj7c.png)




#### Step 3: Create an Ansible playbook which is a yaml file. The Yaml file will define the tasks you would like to automate. In this scenario, we install and start an Apache Web server to localhost.

![Yaml file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/638psw88w10uru6zxb96.png)


#### Step 4: We run the playbook using the ansible-playbook -i (inventory file)  nameofyourplaybook.yaml.
 _Note : make sure to have enabled <u>execute</u> privileges in the playbook. I.e chmod +x [yourplaybook.yaml]._


#### Step 5:Your playbook should run successfully with the following output.

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

#### Conclusion
In conclusion, we were able to create an automation script for installing Apache locally using Ansible. Although we explored on how to achieve load balancing with Ansible, there are other benefits and services Ansible offers like Infrastructure automation, configuration management, and deployment of applications across different servers.
Help needed with subrouting in Go
Tags: help, go, restapi, webdev
Published: 2024-04-21 10:41:05

## Hello 👋 

I've started learning Go a couple days ago. Currently, I'm building Rest APIs using `net/http` package.

I have figured out most of the basic stuff, but struggling a bit with subrouting. When I add a subrouter using like this

```go
var mux1 = http.NewServeMux()
mux1.HandleFunc(...)

var mux2 = http.NewServeMux()
mux2.HandleFunc(...)
mux1.Handle("/", middleware.IsAuthenticated(mux2))
```

I'm trying to add a protected set of routes to a router using a middleware. But, the routes defined in the subrouter are not accessible without adding a trailing slash in the URL when making the request. eg:

![Screenshot of curl outputs with and without trailing slash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qln6w6l717hazl3gvp8i.png)



## My Code

```go
// cmd/main/main.go
package main

import (
	"fmt"
	"net/http"

	"rest-api/internal/middleware"
	"rest-api/internal/routes"
	"rest-api/internal/utils"
)

func main() {
	var middlewareStack = utils.CreateStack(middleware.LogRequest)

	var v1Router = http.NewServeMux()
	v1Router.Handle("/v1/", http.StripPrefix("/v1", routes.EchoRouter()))

	var usersRouter = routes.UsersRouter()
	v1Router.Handle("/users/", http.StripPrefix("/users", usersRouter))

	var server = &http.Server{
		Addr:    ":8080",
		Handler: middlewareStack(v1Router),
	}

	fmt.Println("starting server on port 8080")
	server.ListenAndServe()
}

// internal/routes/users.go
package routes

import (
	"encoding/json"
	"net/http"

	"rest-api/internal/middleware"
)

type User struct {
	Name  string
	Email string
}

func UsersRouter() http.Handler {
	var usersMux = http.NewServeMux()
	usersMux.HandleFunc("GET /", getUsers)

	var protectedMux = http.NewServeMux()
	protectedMux.HandleFunc("POST /", createUser)
	usersMux.Handle("/", middleware.IsAuthenticated(protectedMux))

	return usersMux
}

func getUsers(res http.ResponseWriter, _ *http.Request) {
	res.Write([]byte("users list"))
}

func createUser(res http.ResponseWriter, req *http.Request) {
	var newUser User
	var err = json.NewDecoder(req.Body).Decode(&newUser)

	if err != nil {
		res.WriteHeader(http.StatusBadRequest)
		res.Write([]byte(err.Error()))
		return
	}
	res.WriteHeader(http.StatusCreated)
	res.Write([]byte("new user created, name: " + newUser.Name + ", email: " + newUser.Email))
}
```

## PS
I can achieve the desired behaviour by using the `/users` prefix in the `users.go` file instead of the `main.go` file, but I was wondering if it can be done this way too 🤔 

Thanks!
Simplifying Your Terminal Experience with Go: Clearing the Screen
Tags: go, programming, beginners
Published: 2024-04-21 10:22:38

Do you ever find your terminal cluttered with too much output? Fear not! In this post, we'll explore a simple Go function that clears the terminal screen, making your coding experience cleaner and more focused.

Let's take a look at the code:

```go
package main

import (
    "os"
    "os/exec"
    "runtime"
)

// This function clears the terminal screen.
func ClearScreen() {
    if runtime.GOOS == "windows" {
        cmd := exec.Command("cmd", "/c", "cls")
        cmd.Stdout = os.Stdout
        cmd.Run()
    } else {
        cmd := exec.Command("clear")
        cmd.Stdout = os.Stdout
        cmd.Run()
    }
}

func main() {
    // Call the ClearScreen function to clear the terminal screen.
    ClearScreen()
}
```

### Function Overview

The `ClearScreen` function is designed to clear the terminal screen, providing a clean slate for your next commands or output. Here's how it works:

1. **Checking the Operating System**: First, the function checks the operating system using `runtime.GOOS`. On Windows systems, it uses the `cls` command to clear the screen, while on other systems, it uses the `clear` command.

2. **Executing the Command**: The function then creates an `exec.Command` with the appropriate command to clear the screen. It sets the standard output to the terminal and executes the command using `cmd.Run()`.

### Simplify Your Terminal Experience

By integrating this function into your Go programs, you can easily clear the terminal screen whenever needed, keeping your workspace tidy and focused. Whether you're debugging code, running tests, or just exploring, a clean terminal screen can enhance your productivity and clarity.

Feel free to use and adapt this function in your own Go projects to streamline your terminal experience!
Unlock Your Digital Potential with YRShivDigital
Published: 2024-04-21 10:22:28

 Your Gateway to [**Effective Digital Marketing Solutions**](https://yrshivdigital.com/). Elevate your online presence, engage your audience, and drive results with our tailored strategies. From SEO optimization to social media management, we craft innovative campaigns designed to amplify your brand's visibility and impact. Let us navigate the digital landscape for you, ensuring maximum ROI and sustainable growth. Harness the power of YRShivDigital today and conquer the online realm like never before.
Enhancing Data Queries with Firebase: Using Compound Queries to Filter Results
Tags: firebase, javascript, webdev, datafiltering
Published: 2024-04-21 10:00:34


In the evolving landscape of web development, efficient data handling stands as a cornerstone of responsive and reliable applications. At [itselftools.com](https://itselftools.com), through our journey developing over 30 dynamic projects using technologies like Next.js and Firebase, we've honed techniques that leverage Firebase to its fullest. Today, we'll dive into one such technique—using compound queries for nuanced data filtering in Firebase.

## Understanding Compound Queries in Firestore

Firestore, a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud Platform, supports compound queries. These queries allow you to perform complex data filtering by combining multiple conditions. 

### The Code Snippet: A Deep Dive

```javascript
// 9. Using compound queries for deeper filtering
db.collection('orders').where('status', '==', 'shipped').where('amount', '>=', 150)
  .get()
  .then(snapshot => {
    snapshot.forEach(doc => console.log(doc.data()));
});
```

This snippet queries a collection named `orders`. It initiates a compound query with two `where` filters. The first filter retrieves documents where the `status` field equals 'shipped'. The second filter further narrows down the documents to those where the `amount` is at least 150. The final call to `get()` fetches the documents that satisfy both conditions.

### What Does This Mean for Your Project?

By combining filters, you can precisely control the data your application retrieves. This not only improves performance by reducing the load of unnecessary data retrieval but also enhances user experience by presenting only relevant data. For instance, in an e-commerce system, such granular control could be used to generate reports on high-value transactions, track shipped orders, or implement custom alerts and displays.

## Benefits of Compound Queries

1. **Precision**: Narrow down to precise data sets.
2. **Performance**: Fetch only what you need, improving response times and reducing resource usage.
3. **Customization**: Tailor data retrieval to specific application needs or user preferences.

## Conclusion

Leveraging compound queries in Firebase is a powerful way to refine data access and manipulation. As you've seen, it's not just about retrieving data but retrieving it smartly. If you're interested in seeing this code in action, explore some of our applications like [Temp Mail](https://tempmailmax.com), [Online Video Recorder](https://record-video-online.com), and [Online Archive Extractor](https://online-archive-extractor.com). Each app utilizes advanced web technologies to deliver rich and interactive user experiences, showcasing practical implementations of complex data handling techniques.

Embrace these advanced querying capabilities in your next project and watch your applications become more efficient, responsive, and user-centered.
Date Function in Javascript
Tags: javascrtip, date, new, code
Published: 2024-04-21 09:45:20

---
title: Date Function in Javascript
published: true
description: Using the Date function without the 'new' keyword will give you a string showing the current date and time. but it does not have all the features of a complete Date object. using it with the 'new' keyword. The Date object instance is created with all functionalities.
tags: #javascrtip #date #new #code
# Use a ratio of 100:42 for best results.
# published_at: 2024-03-31 01:11 +0000
---

Using the Date function without the 'new' keyword will give you a string showing the current date and time. but it does not have all the features of a complete Date object. using it with the 'new' keyword. The Date object instance is created with all functionalities.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbyh7p5roymguwkwd7k8.png)
Számlázz.hu - Számla Agent PHP API - Composer csomag
Tags: php, composer
Published: 2024-04-21 09:02:32

Az egyik projektben a Számlázz.hu-t használjuk majd a számlázásra, ennek az első lépése a projektbe bekötés, Sandbox környezet létrehozása, néhány teszt számla beküldése.

## Számlázz.hu

A Számlázz.hu-nál "Tesztüzemnek" hívják, van róla külön bejegyzés: [teszt api hozzáférés](https://tudastar.szamlazz.hu/gyik/teszt-api-hozzaferes). Én ezt választottam, hogy ne az éles rendszerben kelljen sztornózni, hanem legyen egy bármikor elérhető játszós környezet. Szükségünk lesz még egy "Számla Agent kulcs" létrehozására is. Ezt belépés után a Számlázz.hu főoldal alján (a számlák és a fiókhozzáférések) "Számla Agent kulcsok" alatt találjuk meg.

## Számla Agent API

A hivatalos dokumentáció ([Szamla Agent API](https://docs.szamlazz.hu/#php-api)) csak egy letölthető .zip csomag linkjére mutat, jelenleg ez a `PHPApiAgent-2.10.18.zip`.

Frissítési információk itt: [changelog](https://docs.szamlazz.hu/changelog.html) (néhány napja jött ki a legfrissebb verzió: `[2.10.18] - 2024.04.18`)

Kicsit meglepett, hogy nincs hivatalos csomag kiadva amit egyszerűen be lehetne húzni composerrel.

## Composer

Van néhány Composeres csomag, de számlázó kódját nem szeretném használni "ismeretlen forrásból". Főleg úgy, hogy, az eredeti kódhoz képest több-kevesebb módosítást is tartalmaznak.

Megnéztem, kipróbáltam, hogy összeállítható-e úgy a csomag, hogy nem kell belenyúlni kézzel és kódot szerkeszteni. Ehhez készült egy PHP script ami mindent megcsinál: [szamla-agent-update.php](https://github.com/Benjaminhu/szamlazz-php-api/blob/main/szamla-agent-update.php). A `PSR-4` kompatibilitás miatt át kellett nevezni néhány könyvtárat és kész működik.

A frissítő script is a repository része, a kiadott verziót a hivatalos verzióhoz igazítottam: [v2.10.18](https://github.com/Benjaminhu/szamlazz-php-api/releases/tag/2.10.18)

Mivel más is ugyanígy bizonytalan lehet a fenti csomagommal, megpróbálom felvenni a kapcsolatot a Számlázz.hu fejlesztőivel és jelezni, hogy érdemes lenne ezt átaluk hivatalos karbantartott csomagként githubon publikálni.