Gaurav Joshi

Google celebrates its 25th birthday with a doodle

Search engine giant Google is celebrating its 25th birthday with a doodle. Google was founded by Sergey Brin and Larry Page in 1998 and now operates all over the world in over 100 languages. Facts You Probably Didn't Know About Google. Facts You Probably Didn't Know About Google The name[...]

By |September 27, 2023|Tags: |

CSRF Protection in Laravel

CSRF stands for Cross-Site Request Forgery. It is a security vulnerability that occurs when an attacker tricks a user into performing actions on a website without the user's knowledge or consent. CSRF attacks are possible when a web application does not properly validate or authenticate requests. How CSRF Attacks Work[...]

By |August 10, 2023|Tags: , |

How to use git stash

When working with Git, you can use the "git stash" feature to save your changes temporarily without committing them. This is helpful when you need to switch to another branch, fix a bug, or perform other tasks. Here's the sequence to follow when using "git stash": Save your changes to[...]

By |August 7, 2023|Tags: , , |

Laravel Notifications

Typically, notifications should be short, informational messages that notify users of something that occurred in your application. For example, if you are writing a billing application, you might send an "Invoice Paid" notification to your users via the email and SMS channels. Generating Notifications php artisan make:notification InvoicePaid Sending Notifications[...]

By |August 3, 2023|Tags: |

Class and Object Example in PHP

<?php class Data { public $data; function setData($data){ $this->data = $data; } function getData(){ return $this->data; } } $data = new Data(); $data->setData( array( "name"=>"John Doe", "age"=>20, "company_name"=> "XYZ" ) ); echo json_encode($data->getData()). "\n"; $dataE1 = new Data(); $dataE1->setData( array( "name"=>"John Doe 1", "age"=>21, "company_name"=> "ABC" ) ); echo json_encode($dataE1->getData()).[...]

By |July 29, 2023|Tags: , , |

Shortcode in WordPress

<?php // Use shortcode in a PHP file (outside the post editor). echo do_shortcode( '[sw_demo_search_form]' ); ?> https://developer.wordpress.org/reference/functions/do_shortcode/  

By |July 12, 2023|

Add Tracking Code in WordPress

Meta Pixel Code The Meta Pixel is a snippet of JavaScript code that allows you to track visitor activity on your website. It works by loading a small library of functions which you can use whenever a site visitor takes an action (called an event) that you want to track[...]

By |July 12, 2023|Tags: |

AWS Basic Commands

Connect to instance 1st approach (For MAC/Linux Laptops) Copy the private key to Desktop Other Steps: cd ~/Desktop chmod 400 ec2-key.pem ssh -i ec2-key.pem ec2-user@PUBLIC-IP-OF-EC2 2nd approach (For Windows but can work for MAC/Linux as well) open . Copy the private key to the folder that opens. Remaining Steps: chmod[...]

By |July 9, 2023|
Go to Top