Skip to content

Instantly share code, notes, and snippets.

View mahdyar's full-sized avatar
🌱

Mahdyar Hasanpour mahdyar

🌱
View GitHub Profile
@mahdyar
mahdyar / cPanel.yml
Created September 8, 2021 20:56
Deploy to cPanel with GitHub Actions (FTP)
name: Deploy to cPanel
on:
push:
branches:
- master
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
@mahdyar
mahdyar / creditcardverification.php
Created May 9, 2022 17:02
بررسی صحت شماره کارت ایرانی در PHP
<?php
function validateCardNumber($cardNumber)
{
if (empty($cardNumber) || strlen($cardNumber) !== 16) {
return false;
}
$cardToArr = str_split($cardNumber);
$cardTotal = 0;
for ($i = 0; $i < 16; $i++) {
@mahdyar
mahdyar / vo-asiatech.php
Created August 21, 2022 12:04
سرویس سامانه پیامکی آسیاتک برای افزونه پیام کوتاه WHMCS وهاب آنلاین
<?php
/*
*
*
*
* Developed by Mahdyar.me
* Contact: hi@mahdyar.me
*
@mahdyar
mahdyar / functions.php
Created September 2, 2022 20:26
Hide the default "Add to cart" button and show a customized "Add to cart" button in WooCommerce
<?php
/*
*
* Customized add to cart button for WooCommerce
* © mahdyar.me (hasanpour@mahdyar.me)
*
* Add this to the end of your template's "functions.php" file (without "<?php" at the begining of this file)
*
*/
@mahdyar
mahdyar / bustan.js
Last active January 19, 2024 12:14
پرکردن نظرسنجی‌های بوستان به صورت خودکار | Select Bustan survey checkboxes
var allInputs = document.getElementsByTagName("input");
for (var i = 0, max = allInputs.length; i < max; i++){
if (allInputs[i].type === 'checkbox' && allInputs[i].id.endsWith('_8'))
allInputs[i].checked = true;
}