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
use Illuminate\Support\Collection; | |
Collection::macro('reverseNested', function ($childrenField,$parents=[]) { | |
$result = collect(); | |
foreach ($this->items as $item) { | |
if ($item->$childrenField) { | |
$parents[] = $item->name; | |
$subCategories = collect($item->$childrenField)->map(function($cat) use ($parents){ | |
$cat->parents = $parents; |
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
$this->info('--Aktarım Başladı-'); | |
$connectionName = 'old_mysql'; | |
$newDb = \DB::connection(''); | |
$oldDb = \DB::connection($connectionName); | |
$tmpOldTables = $oldDb->getDoctrineSchemaManager()->listTables(); | |
$tables = $newDb->getDoctrineSchemaManager()->listTables(); | |
$newTables = []; | |
$foreignKeys = []; | |
$indexes = []; |
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
$response = $next($request); | |
$buffer = $response->getContent(); | |
ini_set('zlib.output_compression', 'On'); // If you like to enable GZip, too! | |
$buffer = preg_replace('~<img(?!.*data-lazyno)[^>]*\K(?=src)~i', 'data-r', $buffer); | |
$response->setContent($buffer); | |
$buffer = $response->getContent(); | |
$buffer = preg_replace('~<iframe(?!.*data-lazyno)[^>]*\K(?=src)~i', 'data-r', $buffer); | |
$response->setContent($buffer); |
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
sudo chgrp -R brew /usr/local/Cellar | |
sudo chgrp -R brew /usr/local/Homebrew | |
sudo chgrp -R brew /usr/local/var/homebrew | |
sudo chgrp -R brew ${HOME}/Library/Caches/Homebrew | |
sudo chgrp -R brew ${HOME}/Library/Logs/Homebrew | |
sudo chgrp -R brew /usr/local/etc | |
sudo chgrp -R brew /usr/local/opt | |
sudo chgrp -R brew /usr/local/bin | |
sudo chgrp -R brew /usr/local/var | |
sudo chgrp -R brew /usr/local/share/man/man1 |
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
server bakımı | |
1 kullanılmayan veri tabanlarını sil | |
2 error logları sil | |
3 yüksek mailleri sil | |
4 tüm resimleri sıkıştır | |
5 kullanılmayan dosyaları temizle | |
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
http://blogsearch.google.co.th/ping/RPC2 | |
http://www.blogsearch.google.ru/ping/RPC2 | |
http://www.blogsearch.google.co.ve/ping/RPC2 | |
http://www.blogsearch.google.de/ping/RPC2 | |
http://www.blogsearch.google.gr/ping/RPC2 | |
http://www.blogpeople.net/ping | |
http://blogsearch.google.be/ping/RPC2 | |
http://xping.pubsub.com/ping/ | |
http://blogsearch.google.ae/ping/RPC2 | |
http://blogsearch.google.at/ping/RPC2 |
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
$dl->debug(function ($type, $buffer) { | |
if (preg_match_all('/\[download\] (.*?)\% of (.*?)M/',$buffer,$match)) { | |
$perchant = (int)trim($match[1][0]); | |
if ($perchant > 0) { | |
echo $perchant . "<br>"; | |
} | |
} | |
}); |
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 isLocation($url,$returnBaseUrl= false){ | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_NOBODY, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_MAXREDIRS, 3); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,5); | |
curl_setopt($ch,CURLOPT_TIMEOUT, 15); |
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 remoteFileSize($url) { | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_NOBODY, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_MAXREDIRS, 3); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,5); | |
curl_setopt($ch,CURLOPT_TIMEOUT, 15); |
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 isImage($url = '') { | |
if (!strstr($url,'http')) return false; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_NOBODY, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_MAXREDIRS, 3); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
NewerOlder