Skip to content

Instantly share code, notes, and snippets.

View miyasinarafat's full-sized avatar
:octocat:
★★★

MD Iyasin Arafat miyasinarafat

:octocat:
★★★
View GitHub Profile
@miyasinarafat
miyasinarafat / curl-multi-test.php
Created May 31, 2019 08:11 — forked from gilbitron/curl-multi-test.php
Testing 95 regular curl_exec requests vs curl_multi_exec requests
<?php
$sites = [
'http://www.google.com/',
'http://www.facebook.com/',
'http://www.youtube.com/',
'http://www.yahoo.com/',
'http://www.live.com/',
'http://www.wikipedia.org/',
'http://www.baidu.com/',
@miyasinarafat
miyasinarafat / MailConfigServiceProvider.php
Created February 20, 2019 08:46
How to use database for mail settings in Laravel
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;
class MailConfigServiceProvider extends ServiceProvider
{
/**
@miyasinarafat
miyasinarafat / LICENCE SUBLIME TEXT
Created February 3, 2019 05:50
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@miyasinarafat
miyasinarafat / AppServiceProvider.php
Last active February 25, 2019 09:24
If you are using CloudFlare or a similar CDN you will get an infinite loop error with the %{HTTPS} solutions provided here. If you're a CloudFlare user you'll need to use this:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\App;
class AppServiceProvider extends ServiceProvider
@miyasinarafat
miyasinarafat / Permission.php
Created January 8, 2019 10:00
Middleware Permission to dynamically authorize users for spatie/laravel-permission. Using in lumen. Inspired from : https://gist.github.com/lamberttraccard/c0ab9c1ff7b52bd4eb9d8fa188c4470c
<?php
namespace App\Http\Middleware;
use App\Http\Controllers\V1\Auth\AuthController;
use Closure;
use Illuminate\Contracts\Auth\Factory as Auth;
class Permission
{
@miyasinarafat
miyasinarafat / ForgotPasswordController.php
Created December 13, 2018 10:19 — forked from nasrulhazim/ForgotPasswordController.php
Laravel: Forgot Password Controller for API
<?php
namespace App\Http\Controllers\Api\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Support\Facades\Password;
class ForgotPasswordController extends Controller
@miyasinarafat
miyasinarafat / Model.php
Created December 3, 2018 07:45 — forked from vielhuber/Model.php
custom relationship in eloquent / eager loading #laravel
<?php
public function foos() {
$relation = $this->hasMany('App\Bar');
return $relation; // default behaviour
// modify the query builder
$relation->where('foo','bar');
return $relation;

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far: