Skip to content

Instantly share code, notes, and snippets.

View mdsohelmia's full-sized avatar
🎯
Focusing

Sohel Mia mdsohelmia

🎯
Focusing
View GitHub Profile
@mdsohelmia
mdsohelmia / cloudSettings
Created September 19, 2018 02:52
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-19T02:51:57.528Z","extensionVersion":"v3.1.2"}
@mdsohelmia
mdsohelmia / cloudSettings
Created September 19, 2018 02:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-19T02:53:53.581Z","extensionVersion":"v3.1.2"}
$(window).on('scroll',function() {
var scroll = $(window).scrollTop();
if (scroll < 245) {
$(".header-middle").removeClass("scroll-header");
}else{
$(".header-middle").addClass("scroll-header");
}
});

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@mdsohelmia
mdsohelmia / CountriesTableSeeder.php
Created September 14, 2019 19:40 — forked from SumonMSelim/CountriesTableSeeder.php
Countries Table Seeder for Laravel
<?php
use App\Country;
use Illuminate\Database\Seeder;
class CountriesTableSeeder extends Seeder
{
public function run()
{
$countries = [
@mdsohelmia
mdsohelmia / auth.php
Created September 15, 2019 07:39 — forked from mabasic/auth.php
`config/auth.php` for JWT Authentication in Lumen
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
@mdsohelmia
mdsohelmia / compat_l5.php
Created September 15, 2019 08:56 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@mdsohelmia
mdsohelmia / compat_l5.php
Created September 15, 2019 08:56 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@mdsohelmia
mdsohelmia / url.md
Created September 15, 2019 14:22 — forked from sohelamin/url.md
Restful URL
@mdsohelmia
mdsohelmia / eloquent-cheatsheet.php
Created September 18, 2019 19:01 — forked from hasinhayder/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/