Skip to content

Instantly share code, notes, and snippets.

View Davisonpro's full-sized avatar
🎯
Focusing

Davison Pro Davisonpro

🎯
Focusing
View GitHub Profile
<?php
require dirname(__FILE__) . '/vendor/autoload.php';
require dirname(__FILE__) . '/controllers/TodoController.php';
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Routing\RouteCollectorProxy;
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;
use Slim\Factory\AppFactory;
const path = require('path');
module.exports = (env, argv) => {
return {
mode: argv.mode,
entry: './app/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
// Calculate the time elapsed since a specific date (example: January 1, 2023)
const specificDate = new Date('January 1, 2023');
const timeElapsed = currentDateTime - specificDate;
const daysElapsed = Math.floor(timeElapsed / (1000 * 60 * 60 * 24));
// Display all date and time information in the span element
datetimeDisplayElement.textContent = `Days Elapsed since January 1, 2023: ${daysElapsed}`;
// Get the day of the week
const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const dayOfWeek = daysOfWeek[currentDateTime.getDay()];
// Display all date and time information in the span element
datetimeDisplayElement.textContent = `Day of the Week: ${dayOfWeek}`;
<script>
// Function to display current date and time
function displayDateTime() {
const datetimeDisplayElement = document.getElementById('datetime-display');
// Create a new Date object
const currentDateTime = new Date();
// Extract the date and time components
const date = currentDateTime.toDateString();
<!DOCTYPE html>
<html>
<head>
<title>Display Current Date and Time</title>
</head>
<body>
<span id="datetime-display"></span>
<script>
// Function to display current date and time
<!DOCTYPE html>
<html>
<head>
<title>Display Current Date and Time</title>
</head>
<body>
<span id="datetime-display"></span>
</body>
</html>
<?php
if(isset($_POST['login'])) {
if(!isset($_POST['g-recaptcha-response']) || empty($_POST['g-recaptcha-response'])) {
echo 'reCAPTHCA verification failed, please try again.';
} else {
$secret = 'google_secret_key';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
<?php
if(isset($_POST['login'])) {
if(!isset($_POST['g-recaptcha-response']) || empty($_POST['g-recaptcha-response'])) {
echo 'reCAPTHCA verification failed, please try again.';
} else {
$secret = 'google_secret_key';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
.container {
display: flex;
align-items: center;
background: #ffffff;
height: 100vh;
width: 100%;
}
.card {
position: relative;