This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Return sizes readable by humans | |
| */ | |
| function human_filesize($bytes, $decimals = 2) | |
| { | |
| $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB']; | |
| $factor = floor((strlen($bytes) - 1) / 3); | |
| return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Services; | |
| use App\Post; | |
| use Carbon\Carbon; | |
| use Illuminate\Support\Facades\Cache; | |
| class SiteMap | |
| { | |
| /** | |
| * Return the content of the Site Map | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $array = [ | |
| 4 => 'Wednesday', | |
| 6 => 'Friday', | |
| 1 => 'Sunday', | |
| 5 => 'Thursday', | |
| 3 => 'Tuesday', | |
| 7 => 'Saturday', | |
| 2 => 'Monday' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Contracts\Foundation\Application; | |
| use Illuminate\Routing\Route; | |
| use Symfony\Component\HttpKernel\Exception\HttpException; | |
| use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; | |
| use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Original; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace HaversineFormula; | |
| const EARTH_RADIUS = 6371; | |
| const KILOMETER_TO_MILE = 0.621371192; | |
| class Distance | |
| { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Attend\Exceptions; | |
| use Exception; | |
| use Attend\Traits\RestTrait; | |
| use Attend\Traits\RestExceptionHandlerTrait; | |
| use Symfony\Component\HttpKernel\Exception\HttpException; | |
| use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| use Dingo\Api\Exception\ValidationHttpException; | |
| use Laravel\Lumen\Routing\Controller as BaseController; | |
| class Controller extends BaseController | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Downloading GetDeb and PlayDeb" && | |
| wget http://archive.getdeb.net/install_deb/getdeb-repository_0.1-1~getdeb1_all.deb http://archive.getdeb.net/install_deb/playdeb_0.3-1~getdeb1_all.deb | |
| echo "Installing GetDeb" && | |
| sudo dpkg -i getdeb-repository_0.1-1~getdeb1_all.deb | |
| echo "Installing PlayDeb" && | |
| sudo dpkg -i playdeb_0.3-1~getdeb1_all.deb && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| return [ | |
| 'alphabet' => [ | |
| // https://www.kmu.gov.ua/npas/243262567 | |
| 'gov' => [ | |
| 'а' => 'a', | |
| 'б' => 'b', | |
| 'в' => 'v', | |
| 'г' => 'h', |