Skip to content

Instantly share code, notes, and snippets.

View kidino's full-sized avatar

Iszuddin Ismail kidino

View GitHub Profile
@kidino
kidino / user-payment.js
Created May 3, 2024 14:24
JavaScript for User Payment
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('payment_plan_id').addEventListener('change', (e) => {
let today = new Date();
let isoDate = today.toISOString().slice(0, 10); // Get ISO formatted date (YYYY-MM-DD)
let amount_input = document.getElementById('amount')
let new_expiry_input = document.getElementById('new_expiry')
let expiry_input = document.getElementById('expire_on')
@kidino
kidino / .htaccess
Last active September 26, 2024 04:48
Github Webhook Deploy Script
# taruk .htaccess untuk protect webhook.php agar hanya terima
# trafik daripada Github sahaja. Ini IP address Github yang
# akan hantar webhook.
# lepas tu sebab webhook.php akan pakai fungsi exec(), lagilah
# kita kena protect
<Files "webhook.php">
Order Deny,Allow
Deny from all
@kidino
kidino / CheckoutController.php
Created November 21, 2024 08:18
SecurePay on Laravel
<?php
namespace App\Http\Controllers;
use Carbon\Carbon;
use App\Models\Plan;
use App\Models\User;
use App\Models\Payment;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
@kidino
kidino / add-user-role.php
Created March 30, 2025 03:11
CLI tool to bulk add users through CSV file into WordPress with a role
<?php
// Ensure the script is run from CLI
if (php_sapi_name() !== 'cli') {
die("This script can only be run from the command line.\n");
}
// Check for required CLI arguments
if ($argc < 3) {
die("Usage: php import_users.php <csv_file> <role>\n");
}
@kidino
kidino / functions.php
Created April 15, 2025 12:16
WooCommerce Add-to-Cart & Empty-Cart from URL
<?php
// empties the shopping cart
add_action( 'wp_loaded', 'custom_woocommerce_empty_cart_action', 20 );
function custom_woocommerce_empty_cart_action() {
if ( isset( $_GET['empty-cart'] ) && 'yes' === esc_html( $_GET['empty-cart'] ) ) {
WC()->cart->empty_cart();
}
}
@kidino
kidino / gitlab-ci.yml
Created August 7, 2025 08:15
gitlab-ci.yml for Laravel
stages:
- build
- deploy
build_laravel:
stage: build
image: lorisleiva/laravel-docker:8.2
only:
- master
script:
@kidino
kidino / gist:5215f1b29b7ab40f20530fdffaafde74
Created August 7, 2025 08:44
gitlab-ci.yml -- no delete
stages:
- build
- deploy
build_laravel:
stage: build
image: lorisleiva/laravel-docker:8.2
only:
- master
script:
{
"definitions": {
"Office": {
"description": "Office creation schema",
"type": "struct",
"properties": {
"name": {
"description": "The name of the office",
"type": "string",
"minLength": 1,