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 | |
| require "vendor/autoload.php"; | |
| use setasign\Fpdi\Fpdi; | |
| use setasign\Fpdi\PdfReader; | |
| use setasign\FpdiProtection\FpdiProtection; | |
| class PasswordProtectPDF | |
| { | |
| protected $pdf = 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
| # .htaccess file for root WordPress directory | |
| # add this line if it's not already present in your .htaccess file | |
| ErrorDocument 401 default | |
| <Files "wp-login.php"> | |
| AuthName "WordPress Admin" | |
| AuthUserFile "/path/to/passwd" | |
| AuthType Basic | |
| require valid-user |
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
| # move to home directory | |
| cd ~/ | |
| # download svn source | |
| wget https://archive.apache.org/dist/subversion/subversion-1.7.14.tar.bz2 | |
| # extract source | |
| tar -xzvf subversion-1.7.14.tar.bz2 | |
| # enter extracted directory |
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
| <IfModule mod_ssl.c> | |
| <VirtualHost *:443> | |
| Include conf/vhosts/mydomain.vhost | |
| SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem | |
| SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem | |
| Include /etc/letsencrypt/options-ssl-apache.conf | |
| </VirtualHost> | |
| </IfModule> |
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
| <IfModule mod_ssl.c> | |
| <VirtualHost *:443> | |
| Include conf/vhosts/domain.vhost | |
| SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem | |
| SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem | |
| Include /etc/letsencrypt/options-ssl-apache.conf | |
| </VirtualHost> | |
| </IfModule> |
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
| // include the libraries we need | |
| var request = require('request'); | |
| var cheerio = require('cheerio'); | |
| // set some defaults | |
| req = request.defaults({ | |
| jar: true, // save cookies to jar | |
| rejectUnauthorized: false, | |
| followAllRedirects: true // allow redirections | |
| }); |
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 | |
| require 'vendor/autoload.php'; | |
| $sdk = new Aws\Sns\SnsClient([ | |
| 'region' => 'eu-west-1', | |
| 'version' => 'latest', | |
| 'credentials' => ['key' => 'xxx', 'secret' => 'xxx'] | |
| ]); | |
| $result = $sdk->publish([ |
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
| # get list of docker images | |
| docker images | |
| # build docker image | |
| docker build -t <repo>/<name>:<version> ./path/to/directory | |
| # example: docker build -t nirajshah/php7:v0.3 . | |
| # run a command in container | |
| docker run <img_id> <command> | |
| # example: docker run bbd53c8ffa96 php -v |
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\Controllers; | |
| use App\Http\Requests; | |
| use Illuminate\Http\Request as LaravelRequest; | |
| use Illuminate\Foundation\Auth\ResetsPasswords; | |
| use Redirect; | |
| use Request; |
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
| protected function validator(array $data) | |
| { | |
| return Validator::make($data, [ | |
| 'name' => 'required|max:255', | |
| 'email' => 'required|email|max:255|unique:users', | |
| 'password' => 'required|confirmed|min:8|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).+$/', | |
| ], [ | |
| 'password.regex' => 'Password must contain at least 1 lower-case and capital letter, a number and symbol.' | |
| ]); | |
| } |