Skip to content

Instantly share code, notes, and snippets.

View engrrajonahmed's full-sized avatar
🚀
Let's launch!

Rajon Ahmed engrrajonahmed

🚀
Let's launch!
View GitHub Profile
@engrrajonahmed
engrrajonahmed / getyt
Last active September 28, 2025 13:01
#!/bin/bash
# ================================================
#
# Author : Rajon Ahmed
# Role : Entrepreneur, Developer, Civil Engineer
# Email : public@rajonahmed.com
# Website : rajonahmed.com
#
# ================================================
@engrrajonahmed
engrrajonahmed / gen-string.php
Created April 8, 2025 04:45
Function to generate random string with predefined arguments.
/**
* Generate a unique random ID based on configurable parameters.
* This function allows you to generate strings with different character sets, length, delimiters, and part-length options.
*
* @param array $args {
* Optional. An array of arguments to customize the generated ID.
*
* @type int $length Length of the generated string. Default is 16.
* @type string $charset Charset to use for generating the string.
* Available options:
@engrrajonahmed
engrrajonahmed / ia-role-1-php.php
Created September 7, 2024 02:58
A frontend role management system(v0.1 beta) for WordPress. Next version with better management system coming soon....
// Shortcode 1: [ia_role id="anything" type="mapped" account="users_of_this_role" main="primary_role" target="role_a,role_b" map="role_a:role_1,role_2,role_3|role_b:role_4,role_5,role_6"]
// Shortcode 2: [ia_role id="anything" type="unmapped" account="users_of_this_role" main="primary_role" target="role_x,role_y,role_z"]
function backendops_ia_role_form($atts) {
// Default attributes
$atts = shortcode_atts(
array(
'id' => '',
'su' => 'administrator',
'type' => '',
'account' => '',
@engrrajonahmed
engrrajonahmed / create-bulk-post.json
Created July 23, 2024 05:09
A list of demo post titles and content.
{
"post_titles": [
"Exploring the Depths of Human Consciousness",
"The Future of AI in Creative Arts",
"Unlocking the Mysteries of Quantum Computing",
"How Space Exploration Influences Modern Technology",
"The Intersection of Philosophy and Science: A Deep Dive into Their Synergy",
"Imagining a World Without Borders",
"Redefining Success in the 21st Century",
"The Impact of Digital Media on Traditional Art Forms",
@engrrajonahmed
engrrajonahmed / generate-image.php
Last active July 19, 2024 18:28
Generate image based on post id supplied by JetFormBuilder form.
function backendops_ia_social_image( $request, $action_handler ) {
// Get $post_id from the post_id field in the request
$post_id = ! empty( $request['post_id'] ) ? $request['post_id'] : false;
// Get the value of the option 'news_social_image_logo' and convert ID to URL
$news_social_image_logo_id = get_option( 'news_social_image_logo' );
$news_social_image_logo = $news_social_image_logo_id ? wp_get_attachment_url( $news_social_image_logo_id ) : '';
// Initialize variables
@engrrajonahmed
engrrajonahmed / select2-init.js
Created July 2, 2024 05:52
Transform a regular select field and use existing options as Select2 options.
jQuery(document).ready(function($) {
// Initialize Select2 with the generated optgroups and options
$('#action_option').select2({
placeholder: 'Action *',
searchInputPlaceholder: 'Search Action...',
selectOnClose: false,
closeOnSelect: true
});
});
@engrrajonahmed
engrrajonahmed / geo-location-data-countries-states.json
Created June 13, 2024 10:10
A JSON file consists of ISO Alpha-2 country code, country name, state code, and state name.
{
"countries": [
{
"country_code": "AF",
"country_name": "Afghanistan"
},
{
"country_code": "AX",
"country_name": "Åland Islands"
},
@engrrajonahmed
engrrajonahmed / geo-location-data-territories-continents-oceans-countries-capitals.json
Created June 13, 2024 10:09
A JSON file consists of territory name, continent name, ocean name, country code, country name, and capital name.
{
"territories": [
{
"territory_name": "World"
}
],
"continents": [
{
"continent_name": "Asia"
},
@engrrajonahmed
engrrajonahmed / geo-location-data-countries-capitals.json
Created June 13, 2024 10:06
A JSON file consists of country ISO Alpha-2 code, country name, and capital name.
{
"countries": [
{
"country_code": "AF",
"country_name": "Afghanistan"
},
{
"country_code": "AX",
"country_name": "Åland Islands"
},
/*
* Project: Password Visibility Toggle
* Description: It works on any form. It's flexible and you can add more fields and cases as per your need. It won't throw any error if the field is not present on the webpage.
* Author: Rajon Ahmed
* Author URI: rajonahmed.me
* Version: 0.0.1
* License: GPL v3.0
* License URL: https://www.gnu.org/licenses/gpl-3.0.en.html
*/