This file contains 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/sh | |
cd /project/path | |
php artisan down | |
git pull | |
composer install | |
php artisan migrate | |
php artisan optimize |
This file contains 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 | |
use Workerman\Lib\Timer; | |
use Workerman\Worker; | |
require __DIR__ . '/bootstrap/autoload.php'; | |
Timer::add(0.1, function () { | |
echo "First timer\n"; |
This file contains 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
function dq($query){ | |
$sql = $query->toSql(); | |
foreach($query->getBindings() as $key => $binding){ | |
$sql = preg_replace('/\?/', "'$binding'", $sql, 1); | |
} | |
dd($sql); | |
} |
This file contains 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
#!/usr/local/bin/php -q | |
<?php | |
error_reporting(E_ALL); | |
session_start(); | |
/* Allow the script to hang around waiting for connections. */ | |
set_time_limit(0); | |
/* Turn on implicit output flushing so we see what we're getting |
This file contains 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
# Redirecting | |
# From www to without www | |
RewriteCond %{HTTP_HOST} ^www\.domain.rs$ | |
RewriteRule (.*) http://domain.rs/$1 [R=301,L] | |
This file contains 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 | |
// Repeating characters possible | |
echo substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstvwxyz', 5)), 0, 5); | |
// No repeating characters | |
echo substr(str_shuffle('0123456789abcdefghijklmnopqrstvwxyz'), 0, 5); |
This file contains 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
<script id="sweetMessages" type="application/json">{!! json_encode(array_only(session()->all(), ['success', 'error', 'warning'])) !!}</script> | |
<script> | |
var sweetMessages = JSON.parse($('#sweetMessages').html()); | |
setTimeout(function () { | |
Object.keys(sweetMessages).forEach(function (key) { | |
return swal(sweetMessages[key], '', key); | |
}); | |
}, 0); | |
</script> |
This file contains 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\Chart; | |
use app\Chart\Http\SomeMiddleware; | |
use Illuminate\Routing\Router; | |
use Illuminate\Support\ServiceProvider; | |
class ChartServiceProvider extends ServiceProvider | |
{ |
OlderNewer