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.' | |
]); | |
} |
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\Auth; | |
use App\Http\Controllers\Controller; | |
use Illuminate\Foundation\Auth\ResetsPasswords; | |
class PasswordController 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
// access the persistent file system | |
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) { | |
// get the file named "config.json" | |
fs.root.getFile("config.json", { create: false }, function(fileEntry) { | |
// attempt to remove the file if it exists | |
fileEntry.remove(function() { | |
// delete successful | |
console.info('Config file has been deleted successfully.'); |
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 list of files / directories, returns array | |
SSH::getGateway()->getConnection()->nlist('.'); | |
// get current working directory, returns string | |
SSH::getGateway()->getConnection()->pwd(); | |
// check for directory, returns boolean | |
SSH::getGateway()->getConnection()->is_dir("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
#!/bin/bash | |
PIDFILE=/var/www/html/ajc.pid | |
if [ -f $PIDFILE ] | |
then | |
PID=$(cat $PIDFILE) | |
ps -p $PID > /dev/null 2>&1 | |
if [ $? -eq 0 ] | |
then |