Skip to content

Instantly share code, notes, and snippets.

View vidux's full-sized avatar

viduranga vidux

View GitHub Profile
vidux / react native sample folder
Created April 14, 2023 11:40
react native sample folder structure with redux
View react native sample folder
  • src/
    • actions/
      • actionTypes.js
      • authActions.js
      • cartActions.js
      • ...
    • components/
      • common/
        • Button/
  • Button.js
vidux / watermark.php
Created December 23, 2022 13:55
add watermark to images in php
View watermark.php
// Set the directory containing the images
$dir = realpath(dirname(__FILE__)) . "/";
// Scan the directory for image files
$files = scandir($dir);
vidux / PermissionSeeder.php
Created September 13, 2022 07:07
Laravel Permission Seeder Improved
View PermissionSeeder.php
//check more at
namespace Database\Seeders;
use Spatie\Permission\Models\Permission;
use Illuminate\Database\Seeder;
vidux / jquary_snip1.js
Last active August 18, 2022 04:07
jquery code snippets
View jquary_snip1.js
//run after juqary loaded
// other codes
//ajax setup csrf token
headers: {
vidux /
Last active October 1, 2022 13:57
Common things to do for your future

Common things to do for your future

Hi! This was created with the aim of getting a basic tasks ideas for those who have no better vision what to do :P (like me). this is a task / responsible list for just take a idea.


Do not consider this as your ultimate vision plan for this future. because everyone life statuses are dynamic and unique. It is not necessary to follow any of the points mentioned here in the same way, and you have to bear the responsibility when you follow the things here, and we would like to kindly inform you that I will not accept the responsibilities , any inconvenience due to the things mentioned here.

vidux / dumpsql_laravel.php
Created March 7, 2022 15:56
laravel dump msyql quary
View dumpsql_laravel.php
$el_quary // your quary from elequent
$query = str_replace(array('?'), array('\'%s\''), $el_quary->toSql());
$query = vsprintf($query, $el_quary->getBindings());
dd( $query);
vidux / BelongsToOneThrough.php
Created March 28, 2021 15:11
Laravel BelongsToOneThrough like relationship
View BelongsToOneThrough.php
//Model story
`Spreedsheet` have many `Rows` `Row` have many `RowValues`
`Spreedsheet` parent of `Rows`, `Rows` parent of `RowValues`
//table structure
vidux / EmailEvent.php
Created January 10, 2021 15:22
Laravel Email event listener for add / modify sender
View EmailEvent.php
namespace App\Listeners;
use Illuminate\Mail\Events\MessageSending;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class EmailEvent
vidux / ExampleMail.php
Created January 10, 2021 15:03
add sender to laravel Mailable build method
View ExampleMail.php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class ExampleMail extends Mailable