Skip to content

Instantly share code, notes, and snippets.

View jaynarayan89's full-sized avatar

jaynarayan jaynarayan89

  • vapi ,gujarat , India
View GitHub Profile
In Auth\LoginController you have:
use AuthenticatesUsers;
Change it to:
use AuthenticatesUsers {
logout as performLogout;
}
@jaynarayan89
jaynarayan89 / gist:7724b552f89511b765d6585f7ee04a0b
Created October 19, 2020 06:27
wordpress file per for localhost
sudo usermod -a -G www-data jay
sudo find . -exec chown jay:www-data {} +
sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +
@jaynarayan89
jaynarayan89 / tree
Created September 24, 2019 06:28
tree queries 2
/*
SELECT date(activated_at) as activated_at,
leader_member_id,
count(if(leg_side = 'left',1,null)) as left_count,
count(if(leg_side = 'right',1,null)) as right_count
FROM `binary_active_team_members`
WHERE earning_id is NULL
GROUP BY date(activated_at),
@jaynarayan89
jaynarayan89 / gettree
Created August 21, 2019 14:09
closure table tree query
public function getTree($root, $level = 3)
{
$nodes = DB::select(
'
SELECT
members.id,
members.first_name,
members.leg_side,
members.parent_id
<?php
namespace App\Repositories\Backend;
use App\Models\Member;
use Illuminate\Support\Facades\DB;
use App\Exceptions\GeneralException;
use App\Repositories\BaseRepository;
use Illuminate\Pagination\LengthAwarePaginator;
@jaynarayan89
jaynarayan89 / test
Created July 25, 2019 07:09
laravel test error
/** @test */
public function an_admin_can_resend_users_confirmation_email()
{
$this->loginAsAdmin();
$user = factory(User::class)->states('unconfirmed')->create();
Notification::fake();
$this->get("/admin/auth/user/{$user->id}/account/confirm/resend");
Notification::assertSentTo($user, UserNeedsConfirmation::class);
@jaynarayan89
jaynarayan89 / commands
Created March 8, 2019 14:19
lamp virtual host
sudo mkdir -p ~/Documents/projects/NEW-SITE-NAME.loc/public_html
sudo touch /etc/apache2/sites-available/NEW-SITE-NAME.loc.conf
sudo gedit /etc/apache2/sites-available/NEW-SITE-NAME.loc.conf
put the following content in file and save.
--------------------------------------------
<VirtualHost *:80>
ServerAdmin admin@NEW-SITE-NAME.loc
@jaynarayan89
jaynarayan89 / test.php
Created October 25, 2018 03:12
php code for perfomance testing of your code
// Test results
$array1 = test('array_walk');
$array2 = test('array_walk_list_each');
$array3 = test('array_walk_foreach1');
$array4 = test('array_walk_foreach2');
// Check arrays for equal
var_dump($array1 == $array2, $array1 == $array3, $array1 == $array4);
@jaynarayan89
jaynarayan89 / gist:ad56fb0ad59c345fbd44d660ded55641
Last active October 19, 2018 10:32
github post css starter projects i am intrested in
https://github.com/cssanimation/gulp-postcss-starter
https://github.com/drewminns/postCSS-starter
https://github.com/HamedPour/PostCSS-Developer-Kit
https://github.com/martdn/postcss-starter-kit
https://github.com/kmh3785/PostCSS-Starter-Kit
https://github.com/brewboxit/brewbox-postcss-starterkit/tree/gulp-starter
<VirtualHost kakaria.loc:80>
DocumentRoot "D:\xampp\htdocs\kakaria"
ServerAdmin kakaria.loc
<Directory "D:\xampp\htdocs\kakaria">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>