Skip to content

Instantly share code, notes, and snippets.

View chiranjit2020's full-sized avatar
๐ŸŽฏ
Focusing

Chiranjit Karmakar chiranjit2020

๐ŸŽฏ
Focusing
View GitHub Profile
@chiranjit2020
chiranjit2020 / php.ini
Created September 28, 2025 10:15
Laravel install process `composer global require laravel/installer`
Good question ๐Ÿ‘ Let me clear this up:
You should **not download the "source code"** unless you want to compile PHP manually (Linux/advanced users).
On Windows, you need the **precompiled binary ZIP package** (Thread Safe or Non-Thread Safe).
---
### โœ… Which PHP version to choose?
* **Go with PHP 8.3 (8.3.26)** โ†’ This is the latest **stable release** and fully supported by Laravel.
@chiranjit2020
chiranjit2020 / README.md
Created September 18, 2025 19:37
Create a comprehensive posts shortcode with extensive customization options. This will be a flexible, robust solution that can handle various display requirements.

Installation Instructions

Where to add this code:

  1. Option 1 - Functions.php (Recommended for themes): Add the entire code to your theme's functions.php file

  2. Option 2 - Plugin file: Create a new file advanced-posts-shortcode.php in /wp-content/plugins/ and wrap with plugin headers:

@chiranjit2020
chiranjit2020 / README.md
Last active September 18, 2025 18:33
Class based WordPress Theme Optimizer.

WordPress theme optimizer class for your functions.php file. This boilerplate includes everything you nedd and more:

Key Features Included:

๐ŸŽฏ Core Functionality

  • Class-based architecture for better organization and maintainability
  • Asset management (CSS, JS, Fonts with proper versioning)
  • Favicon and touch icons for all devices
  • Meta tags for SEO and performance
@chiranjit2020
chiranjit2020 / README.md
Created September 18, 2025 16:34
WordPress posts with pagination

I've created WordPress code for displaying posts with pagination that works on both template-home.php and index.php. This will include comprehensive comments explaining all options and best practices.I've created comprehensive WordPress code for displaying posts with pagination that works on both template-home.php and index.php. Here are the key features included:

Main Features:

  • Universal Compatibility: Works on both template files with proper page detection
  • Comprehensive WP_Query Setup: Extensive customization options with detailed comments
  • Multiple Pagination Options: Three different pagination approaches to choose from
  • SEO-Friendly: Proper markup with semantic HTML and accessibility features
  • Performance Optimized: Includes lazy loading and performance tips

Key Sections:

@chiranjit2020
chiranjit2020 / README.md
Last active September 7, 2025 07:26
Complete ajax add to cart system

๐ŸŽฏ Complete WooCommerce AJAX Cart Solution

I've created a bulletproof WooCommerce AJAX cart system that solves your exact problem! Here's what makes this solution robust:

๐Ÿ”ง The Core Problem & Solution

Your Issue: Cart counter doesn't update when items are removed from cart page.

Root Cause: WooCommerce doesn't automatically trigger AJAX updates when cart changes happen on the cart page.

@chiranjit2020
chiranjit2020 / Readme.md
Created September 5, 2025 16:31
WordPRess Ajax

I'll create a crystal-clear explanation of WordPress AJAX with complete examples and detailed comments to help you understand exactly how it works.## WordPress AJAX Made Crystal Clear! ๐Ÿ”ฎ

I've created a comprehensive guide that breaks down WordPress AJAX into simple, digestible pieces. Here's the mental model you need to understand:

The Simple AJAX Flow:

  1. User does something โ†’ Click button, type, submit form
  2. JavaScript catches it โ†’ Event handler captures the action
  3. JavaScript sends request โ†’ To WordPress via admin-ajax.php
  4. WordPress runs PHP function โ†’ Your custom handler processes it
  5. PHP sends response back โ†’ Success or error with data
@chiranjit2020
chiranjit2020 / README.md
Created September 5, 2025 16:03
Wp Complete Menu

I'll create a comprehensive WordPress navigation menu registration and display code with all available options and detailed explanations.This comprehensive WordPress navigation menu code includes:

Key Features Covered:

  1. Menu Registration - Multiple menu locations with proper internationalization
  2. Custom Walker Class - Bootstrap 5 compatible with dropdown support
  3. Complete wp_nav_menu() Options - Every available parameter explained
  4. Specialized Menu Types - Mobile, footer, social media, and breadcrumb menus
  5. Advanced Customization - Custom CSS classes, attributes, and title modifications
  6. Helper Functions - Programmatic menu access and manipulation
@chiranjit2020
chiranjit2020 / README.md
Last active June 22, 2025 14:34
next js notes

๐ŸŽฏ Who Can and Should Learn Next.js?

โœ… 1. React Developers

If you already know React, Next.js is your next step. It enhances React with routing, server-side features, and full-stack capabilities โ€” all with minimal setup.

โœ… 2. Frontend Developers Wanting Full-Stack Power

Next.js lets frontend devs build APIs, connect databases, and render pages on the server โ€” perfect for becoming a full-stack developer without switching tools.

โœ… 3. Web Developers Focused on SEO & Performance

Next.js helps build websites that rank better on search engines through SSR and SSG. Ideal for blogs, marketing sites, and eCommerce platforms.

@chiranjit2020
chiranjit2020 / loops.md
Last active March 8, 2024 19:53
Essential Loops and Methods of array and objects

Here's a breakdown of must-know array and object methods, along with loops for effective work in Node.js:

Arrays:

  • Array Reverse(Custom):
const arr = [1,2,3];
Array.prototype.myReverse = function(){
   let newArr = [];
   for(let i=this.length-1;i>=0;i--){
    newArr.push(this[i]);
    }