Skip to content

Instantly share code, notes, and snippets.

View Shaz3e's full-sized avatar

Shahrukh A. Khan Shaz3e

View GitHub Profile
@Shaz3e
Shaz3e / AppServiceProvider.php
Last active July 14, 2024 21:06
Rate Limit in Laravel
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@Shaz3e
Shaz3e / readme.md
Last active November 2, 2023 13:19
How to Remove Foreign Key and Index from Database

instructions

  • Go to PHPMyAdmin
  • Select Database
  • Click Query Tab

Insert the following commands one by one make sure to change table_name with actual table name and column name with actual column name

First you need to remove foreign key from table.column

@Shaz3e
Shaz3e / WordPress Migration Update DB
Created October 29, 2023 21:22
After WordPress Migration you need to update wp.config.php and Database
#### Update the following commands in wp-config.php
```
define( 'WP_HOME', 'http://www.yoursitename.com' );
define( 'WP_SITEURL', 'http://www.yoursitename.com' );
```
#### PHPMyAdmin SQL Query
```
@Shaz3e
Shaz3e / Install Composer using MAMP's PHP.md
Created August 17, 2023 21:13 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@Shaz3e
Shaz3e / readme.md
Last active April 30, 2023 15:01
5 Commands to add an existing project to GitHub

Use the following command to initialize the repository

> git init

Use the following command to index repository

> git add .
@Shaz3e
Shaz3e / loader.css
Created August 29, 2021 19:32
Loading Effect
#overlay{
position:fixed;
z-index:99999;
top:0;
left:0;
bottom:0;
right:0;
background:rgba(255,255,255,1);
transition: 1s 0.4s;
}
@Shaz3e
Shaz3e / scroller-bottom.js
Created March 22, 2016 20:18
Detect Bottom on Scroll
```
$(window).scroll(function(){
if($(window).scrollTop() + $(window).height() > $(document).height() - <?php echo( s3_option('s3cc_fixed_trigger') == '' ? 100 : s3_option('s3cc_fixed_trigger') );?>) {
$('.s3cc-fixed').css('position','static');
}else{
$('.s3cc-fixed').css('position','fixed');
}
});
```
@Shaz3e
Shaz3e / Display number of Facebook fans in full text
Created July 4, 2015 22:18
Display number of Facebook fans in full text
If you have a Facebook page for your website or blog, you might want to display how many fans you have. This snippet will help you to get your Facebook fan count, in full text. Don’t forget to add your page ID on line 2.
@Shaz3e
Shaz3e / Detect browser language.md
Created July 4, 2015 22:17
Detect browser language

If your website is multilingual, it can be useful to detect the browser language to use this language as the default. The code below will return the language used by the client’s browser.

@Shaz3e
Shaz3e / Remove Microsoft Word HTML tags
Created July 4, 2015 22:17
Remove Microsoft Word HTML tags
When used, Microsoft Word creates lots of tags: font, span, style, class… These tags are useful inside Word itself, but when you paste a text from Word into a webpage, you’ll end up with lots of useless tags. Here’s a very handy function to remove all Word HTML tags.