Skip to content

Instantly share code, notes, and snippets.

View joydeep-bhowmik's full-sized avatar
💭
Doing a little bit better every day

Joydeep Bhowmik joydeep-bhowmik

💭
Doing a little bit better every day
View GitHub Profile
@joydeep-bhowmik
joydeep-bhowmik / Index.js
Last active January 30, 2023 08:44
Chrome mobile inspector
javascript:(function () {var script=document.createElement('script');script.src="//cdn.jsdelivr.net/npm/eruda";document.body.appendChild(script); script.onload = function () { eruda.init() } })();
@joydeep-bhowmik
joydeep-bhowmik / Run laravel from root directory in your cpanel or xampp.md
Last active May 18, 2024 11:18
Steps for how to run laravel from root directory in your cpanel or xampp

Run laravel from root directory in your cpanel or xampp

Create an .htaccess file in public_html folder of your shared hosting Put this code in the htaccess file. And done

method 1

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
@joydeep-bhowmik
joydeep-bhowmik / Laravel Scout egar loading.md
Last active May 16, 2024 09:56
Laravel Egarloading with scout search

Laravel Egarloading with scout search

Suppose this is your category model

class Category extends Model
{
    use HasFactory, Searchable;

    public function toSearchableArray(): array
 {
@joydeep-bhowmik
joydeep-bhowmik / Datatable.tsx
Last active May 13, 2024 09:39
Laravel react datatabe component
import Section from "@/Components/Section";
import axios from "axios";
import { ReactNode, useState } from "react";
import DataTable from "react-data-table-component";
import { useQuery } from "react-query";
import { debounce } from "lodash";
import TextInput from "@/Components/TextInput";
import { useQueryClient } from "react-query";
import { $on } from "@/lib/utils";
import {
ChangeEvent,
HTMLInputTypeAttribute,
useState,
useRef,
useId,
HTMLProps,
} from "react";
import { mediaUrl } from "@/lib/utils";
@joydeep-bhowmik
joydeep-bhowmik / index.md
Last active June 15, 2024 11:24
composer dump-autoload is slow

composer dump-autoload is slow

View original post

For anybody new coming across this. the fix for me was a combination of things, before which the generating optimised autoload files took over 260s.

First adding : "https://packagist.org" to repositories in composer.json.

"repositories": [ { "type": "composer", "url": "https://packagist.org" } ]
@joydeep-bhowmik
joydeep-bhowmik / index.md
Last active June 25, 2024 08:17
WordPress showing old page even after upated

WordPress showing old page even after upated

This thing happends mainly due to browser or server cache

If this problem is because of browser cache then we can hardreload the browser (ctrl + f5)

if this is because of server cache then you can replace default htaccess with the htaccess provided in wordpress documentation

RewriteEngine On
$updateOrder = function ($items) {
    $ids = collect($items)->pluck('value')->toArray();

    Photo::whereIn('id', $ids)
        ->get()
        ->each(function ($item) use ($ids) {
            $item->update(['ordering' => array_search($item->id, $ids)]);
        });
@joydeep-bhowmik
joydeep-bhowmik / vscode.md
Created November 20, 2024 06:30
vscode settings

fix tailwind css intelisense

"editor.quickSuggestions": {
  "strings": true
},
"tailwindCSS.experimental.classRegex": [
  ["class\\s*[:=]\\s*[\"'`]([^\"'`]*).*", 1]
]
@joydeep-bhowmik
joydeep-bhowmik / index.md
Last active December 15, 2024 17:04
android app cant connect to localhost ?

android app cant connect to localhost ?

use this as you local api serever endpoint http://10.0.2.2:8000 instead of http://127.0.0.1:8000