Skip to content

Instantly share code, notes, and snippets.

View Maxlab's full-sized avatar

Nikolay Stepanov Maxlab

View GitHub Profile
@Maxlab
Maxlab / webp.markdown
Created August 10, 2022 06:16 — forked from kieetnvt/webp.markdown
Configure WebP NGINX with Fallback to native images

Configure WebP

Make sure the mime.types has type webp

/etc/nginx/mime.types

include

image/webp webp;

@Maxlab
Maxlab / nginx.conf
Created March 15, 2018 04:37 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@Maxlab
Maxlab / README.md
Created November 17, 2017 11:49 — forked from magnetikonline/README.md
Nginx FastCGI cache configuration example.

Nginx FastCGI cache

Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.

Will need to create a directory to hold cache files, for the example given here that would be:

$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
@Maxlab
Maxlab / App\Ext\UrlWindow
Last active April 25, 2017 08:00
Semantic-UI pagination for Laravel 5.4
<?php namespace App\Ext;
use Illuminate\Contracts\Pagination\LengthAwarePaginator as PaginatorContract;
class UrlWindow extends \Illuminate\Pagination\UrlWindow
{
/**
* Create a new URL window instance.
*
* @param \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator
<?php
namespace App\Console\Commands\Foundation;
use App\Console\Commands\Command;
use App\User;
use Illuminate\Contracts\Auth\Access\Gate;
class AbilitiesListCommand extends Command
{
Verb URI Action Route Name View Policy Middleware
GET /resources index resources.index resources.list list can:list,Resource::class
GET /resources/create create resources.create resources.create create can:create,Resource::class
POST /resources store resources.store create can:create,Resource::class
GET /resources/{resource} show resources.show resources.show view can:view,resource
GET /resources/{resource}/edit edit resources.edit resources.edit update can:update,resource

|