По материалам сайта Calculate Linux: https://www.calculate-linux.org/main/ru/git
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
| /** | |
| * Bootstrap any application services. | |
| * | |
| * @return void | |
| */ | |
| public function boot() | |
| { | |
| DB::listen(static function ($query) { | |
| $locations = collect(debug_backtrace()) | |
| ->reject(static fn($trace) => empty($trace['file'] ?? null)) |
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
| 1. Выделения окончания ссылки. | |
| Регулярка: /(?!\/)([^\/]+)$/ | |
| Пример: https://acuvue.testpromo.site/preview/8f34f792-6e9f-4334-8b28-e850da3f7cd2 | |
| Результат: 8f34f792-6e9f-4334-8b28-e850da3f7cd2 | |
| 2. Извлечение имени файла | |
| Регулярка: /(?<filename>^.*)(?<extension>\.[^\.]+)$/ | |
| Пример: "Screenshot from 2021-03-14. 09-00-01.png" | |
| Результат: | |
| filename: "Screenshot from 2021-03-14. 09-00-01" |
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 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108872 bytes) in /var/www/vendor/khanamiryan/qrcode-detector-decoder/lib/GDLuminanceSource.php on line 79 | |
| Решение: | |
| https://github.com/khanamiryan/php-qrcode-detector-decoder/pull/76 | |
| только при значении 100 код не распознается, начинает распознаваться от 600. В докер образе без ошибки максимально 700. | |
| lib/QrReader.php | |
| @@ -58,13 +58,15 @@ public function __construct($imgSource, $sourceType = QrReader::SOURCE_TYPE_FILE |
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
| docker rm $(docker ps -aq) | |
| docker rmi $(docker images -q) | |
| docker volume rm $(docker volume ls -q) |
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
| Remove old version of installed snaps | |
| snap list --all | while read snapname ver rev trk pub notes; do if [[ $notes = *disabled* ]]; then sudo snap remove "$snapname" --revision="$rev"; fi; done | |
| Starting from snap 2.34 and later, you can set the maximum number of a snap’s revisions stored by the system by setting the refresh.retain option. | |
| sudo snap set system refresh.retain=2 | |
| The refresh.retain value can only be a number between 2 and 20 and has a default value of 3. |
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
| После обновления до Ubuntu 18.04 lts вторая (правая) кнопка в тачпаде работает как основная (левая). | |
| gsettings set org.gnome.desktop.peripherals.touchpad click-method 'areas' |
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 | |
| /** | |
| * Filtering a array by its keys using a callback. | |
| * | |
| * @param $array array The array to filter | |
| * @param $callback Callback The filter callback, that will get the key as first argument. | |
| * | |
| * @return array The remaining key => value combinations from $array. | |
| */ |
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 tests; | |
| use main\User; | |
| class UserTest extends \PHPUnit_Framework_TestCase{ | |
| /** | |
| * Выполнение защищенного/частного метода класса. | |
| * | |
| * @param object &$object Объект тестируемого класса | |
| * @param string $methodName Вызываемое имя метода | |
| * @param array $parameters Массив параметров (аргументов) метода. |
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
| The open source video transcoder https://handbrake.fr/downloads.php | |
| https://confluence.atlassian.com/confkb/unable-to-play-embedded-mp4-videos-on-ipad-or-iphone-in-confluence-305037325.html | |
| Formats http://www.bigasoft.com/articles/how-to-play-mp4-on-ipad.html | |
| One important thing to note is that "iDevices" doesn't support all the varieties of mp4. Here is a small list about MPEG-4 and H.264 supported varieties. | |
| According to Apple official website, iPad or iPhone 4S is only compatible with H.264 or MPEG-4 video format with the following specifications: | |
| If it is H.264 video, it should meet: up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; | |
| If it is MPEG-4 video, it should meet: up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; |
NewerOlder