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 | |
| // ref: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/ | |
| // Validate Email | |
| if (filter_var('test+email@fexample.com', FILTER_VALIDATE_EMAIL)) { | |
| echo "Your email is ok."; | |
| } else { | |
| echo "Wrong email address format."; | |
| } | |
| //Validate Username |
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
| version: '3' | |
| services: | |
| traefik: | |
| restart: unless-stopped | |
| image: traefik:v2.0.2 | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| labels: | |
| - "traefik.http.services.traefik.loadbalancer.server.port=8080" |
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\Helpers; | |
| class SMS | |
| { | |
| /** | |
| * Gets API Ultra Fast Send Url. | |
| * |
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 | |
| # app/Http/Controllers/CaddyController.php | |
| namespace App\Http\Controllers; | |
| use App\Store; | |
| use Illuminate\Http\Request; | |
| class CaddyController extends Controller | |
| { |
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/sh | |
| curl https://www.arvancloud.ir/fa/ips.txt > ./r1c_ips.txt; | |
| echo 'running......' | |
| for x in `cat ./r1c_ips.txt`; | |
| do | |
| ufw allow from $x | |
| done | |
| ufw reload > /dev/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
| # Ubuntu 20 LTS Server Setup for Laravel | |
| # Login as root user | |
| sudo su - | |
| # Update list of available packages | |
| apt update |
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
| # Replace! | |
| # [!server!] (the forge server instance) | |
| # [!sudo_password!] (random password for sudo) | |
| # [!db_password!] (random password for database user) | |
| # [!user.name!] (git user name) | |
| # [!user.email!] (git user email) | |
| # [!server_ip!] (git user email) | |
| # | |
| # REQUIRES: |
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
| # | |
| # REQUIRES: | |
| # - server (the forge server instance) | |
| # - event (the forge event instance) | |
| # - sudo_password (random password for sudo) | |
| # - db_password (random password for database user) | |
| # - callback (the callback URL) | |
| # |
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 | |
| /************************************************************************* | |
| * Get File Information | |
| */ | |
| // Assuming these come from some data source in your app | |
| $s3FileKey = 's3/key/path/to/file.ext'; | |
| $fileName = 'file.ext'; |
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\Rules; | |
| use Illuminate\Contracts\Validation\Rule; | |
| class StringIsLengthRule implements Rule | |
| { | |
| protected $length; | |
| protected $message = 'The string must be greater than the length'; |