...
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\Http\RedirectResponse; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Http\Response; | |
| class NormalizeNumbersMiddleware |
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
| ########################## | |
| ## MySQL container | |
| ########################## | |
| # Using binded data | |
| docker run -d -p 3306:3306 -p 33060:33060 \ | |
| -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \ | |
| --restart unless-stopped \ | |
| -v /var/lib/mysql/data:/var/lib/mysql \ | |
| -v /etc/mysql/config:/etc/mysql/conf.d \ |
You have 2 options, use the script descrived bellow or follow the instrutions
script in this gist if you want the source code
wget https://gist.githubusercontent.com/Vertecedoc4545/6e54487f07a1888b656b656c0cdd9764/raw/2c5e8ccb428fc331307e2f653cab88174c051310/build-ubuntu-23.sh
chmod +x build-ubuntu-23.sh
./build-ubuntu-23.sh
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 | |
| /* | |
| * @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/master/doc | |
| */ | |
| use PhpCsFixer\Config; | |
| use PhpCsFixer\Finder; | |
| $rules = [ |
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
| /* | |
| من یک فیچری دارم بنام رسانه، هر کاربر میتونه یک رسانه بسازه و تعیین کنه که نوع اون چی باشه. هر رسانه فقط یک نوع میتونه داشته باشه، میتونه تلگرام باشه، بله باشه، یا وبهوک باشه. | |
| هر رسانه در قالب یک داکیومنت جدا در مونگو ذخیره میشه. پس اگر یک کاربر دو نوع رسانه تلگرام و وبهوک رو خواست، ما براش دو تا درخواست توی دیبتابیس ذخیره میکنیم که یکیش نوع تلگرام هست (فیلد telegram_id داره) و یکی دیگه که نوع وبهوک هست (فیلد webhook_id داره). | |
| حالا من میخوام چک کنم که کدوم کاربر ها دو نوع تلگرام و وبهوک رو دارن. | |
| در نظر بگیر که هر نوع رسانه توی داکیومنت جدا ذخیره میشه. | |
| */ | |
| // MongoDB aggregations | |
| [ | |
| { | |
| $match: { |
Remove the files with creation time more than 10 days.
find . -type f -ctime +10 -exec rm {} +Get creation time of a file in a human-readable format.
stat -c "%w"
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
| before_script: | |
| - | | |
| # Validate repo's Git credentials. | |
| git config user.email "$GITLAB_USER_EMAIL" | |
| git config user.name "$GITLAB_USER_NAME" | |
| git config credential.helper "store --file=.git/credentials" | |
| git config http.sslverify "false" | |
| .commit_version: &commit_version | |
| - git remote set-url origin https://${GITLAB_USER_LOGIN}:${ACCESS_KEY}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git |