Monday, November 25, 2019

css snippet for blogger code highlighting

code,
.code {
    display: block;
    background: beige;
    padding: 10px;
    margin: 8px 15px;
}

how to add background image overlay in CSS

.class-selector {
background:url(http://lorempixel.com/800/600/nature/2) rgba(255,0,150,0.3);
background-size:cover;
background-blend-mode: multiply;
}

Get Static Properties from a PHP Class

We will get all the static properties as an PHP Array

private function theme_default_value ($key) {
  $full_class_path = Constants::$my_namespace . 'MyClass';
  $class = new \ReflectionClass( $full_class_path );
  $default_value = $class->getStaticPropertyValue( $key );
  return $default_value;
}

photoshop shortcut for developer

ctrl + h = toggle ruler

ctrl + alt + z = previous | alternatively browse history

ctrl + shift + c = to copy of selected portion where transparent stuff will be automatically cropped

ctrl + alt + 0 = 100%;
ctrl + 1= 100%;
ctrl + 0 = 0;

Tab = to get full view;

f8 = info of a layer

# how to know info of layer by click on mouse


To know a layer info we have to select another layer from layer option. Then need to click on expected layer.
Now if we open info window (F8 - shortcut), we will see info of that layer


# to know layer color
just double click on layer

# how to crop a image in a desired size

create a new canvas with your desired size.   

now paste image on this canvas     

Now use free transform tool (`ctrl + t` shortcut) by holding `shift` key.     

# for color overlay
When we take a new canvas `color mode` should be `rgb` and `resolution` should be `72`

Sublime key bindings for jsx emmet expansion using shift + tab

{
  "keys": ["shift+tab"], "command": "expand_abbreviation_by_tab",
  "context": [
    {
      "operand": "source.js",
      "operator": "equal",
      "match_all": true,
      "key": "selector"

    },
    { 
      "key": "selection_empty",
      "operator": "equal",
      "operand": true,
      "match_all": true
    }
 
  ]
}

Tuesday, February 20, 2018

laravel pagination with materialize css

Publishing pagination vendor using artisan command



php artisan vendor:publish --tag=laravel-pagination



make a file name materializecss.blade.php inside views/vendor/pagination directory and paste following code




@if ($paginator->hasPages())


    <ul class="pagination">


        {{-- Previous Page Link --}}


        @if ($paginator->onFirstPage())


            <li class="disabled"><i class="material-icons">chevron_left</i></li>


        @else


            <li class="waves-effect"><a href="{{ $paginator->previousPageUrl() }}"><i class="material-icons">chevron_left</i></a></li>


        @endif



        {{-- Pagination Elements --}}


        @foreach ($elements as $element)


            {{-- "Three Dots" Separator --}}


            @if (is_string($element))


                <li class="disabled">{{ $element }}</li>


            @endif



            {{-- Array Of Links --}}


            @if (is_array($element))


                @foreach ($element as $page => $url)


                    @if ($page == $paginator->currentPage())


                        <li class="active">


                            <a>{{ $page }}</a>


                        </li>


                    @else


                        <li class="waves-effect"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>


                    @endif


                @endforeach


            @endif


        @endforeach



        {{-- Next Page Link --}}


        @if ($paginator->hasMorePages())


            <li class="waves-effect"><a href="{{ $paginator->nextPageUrl() }}"><i class="material-icons">chevron_right</i></a></li>


        @else


            <li class="disabled"><a href="{{ $paginator->nextPageUrl() }}"><i class="material-icons">chevron_right</i></a></li>


        @endif


    </ul>




@endif








In order to use in views




    {{$variable->links('vendor.pagination.materializecss')}}





Monday, November 6, 2017

Specified key was too long error in laravel 5.4 in case of old mysql / mariadb

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}



changed to AppServiceProvider.php file

css snippet for blogger code highlighting

code, .code {     display: block;     background: beige;     padding: 10px;     margin: 8px 15px; }