Skip to content

Instantly share code, notes, and snippets.

View HichemTab-tech's full-sized avatar
🏠
Working from home

HichemTech HichemTab-tech

🏠
Working from home
View GitHub Profile
@HichemTab-tech
HichemTab-tech / script.js
Last active July 29, 2023 19:25
jQuery actionsRelay Plugin - Form Enter Key Navigation : This is a custom jQuery plugin called actionsRelay that enhances the behavior of HTML forms. With this plugin, users can efficiently navigate through form input fields by simply pressing the Enter key. The plugin allows for customization options, such as skipping hidden input fields and sp…
/**
* jQuery actionsRelay Plugin
* Form Enter Key Navigation
*
* Enhance the behavior of HTML forms by enabling Enter key navigation through input fields.
*
* Usage:
* $(selector).actionsRelay({
* okBtn: 'auto', // Set to 'auto' to submit the form upon reaching the last input, or provide a custom button selector.
* ignoreClasses: '', // Add classes to be ignored when navigating through inputs (comma-separated, e.g., 'ignore1,ignore2').
@HichemTab-tech
HichemTab-tech / README.md
Last active July 31, 2023 22:30
ReCaptchaHandler - A PHP class for Google ReCAPTCHA validation.

ReCaptchaHandler - A PHP class to handle Google ReCAPTCHA validation.

This PHP class provides a simple interface to validate Google ReCAPTCHA responses using the Google ReCAPTCHA API. It requires a valid server-side API key to work.

Usage:

  1. Include the 'ReCaptchaHandler.php' file in your PHP project.
  2. Get the ReCAPTCHA response token from the user (e.g., through a form submission).
  3. Use the 'ReCaptchaHandler::isResponseValid($response)' method to validate the token.
  4. The method returns 'true' if the token is valid, 'false' otherwise.
@HichemTab-tech
HichemTab-tech / VerifyPassword.php
Created August 4, 2023 21:06
This middleware is used to verify the current password of the authenticated user before making an action you have to simply add a params to the reqyest named `currentPassword`.
<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
@HichemTab-tech
HichemTab-tech / BaseSetGetClass.php
Last active August 29, 2023 21:57
BaseSetGetClass: Simplify property handling in PHP classes by extending this class. Automatically generates setters and getters, enabling concise property manipulation.
<?php
use BadMethodCallException;
class BaseSetGetClass
{
private static self $instance;
public static function __callStatic($method, $args) {
if (!isset(static::$instance) OR !static::$instance) {
@HichemTab-tech
HichemTab-tech / README.md
Last active June 12, 2024 01:18
Automated Setup Script for NPM jQuery Plugin Projects

Automated Setup Script for NPM jQuery Plugin Projects

This script automates the setup process for NPM jQuery plugin projects. It clones a specified GitHub repository, replaces placeholders in project files, renames files, updates package.json, and executes npm install to install project dependencies.

Usage

  1. Clone this repository to your local machine.
  2. Navigate to the directory containing the scripts.
  3. Run setup_project.bat (for Windows) or setup_project.sh (for Unix-based systems) by double-clicking or executing them in your terminal.
  4. Follow the prompts to provide necessary information such as project name, script names, package name, and descriptions.