This file contains 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
{ | |
"name": "jaytaph/security-example", | |
"require": { | |
"symfony/security-core": "~2.8" | |
}, | |
"authors": [ | |
{ | |
"name": "Joshua Thijssen", | |
"email": "jthijssen@noxlogic.nl" | |
} |
This file contains 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 | |
for ($i = 1; $i <= 20; $i++) | |
{ | |
$title = file_get_contents("http://loripsum.net/api/1/plaintext/long/prude/"); | |
$body = file_get_contents("http://loripsum.net/api/3/decorate/link/ul/prude/long/"); | |
$template = "INSERT_TEMPLATE_HERE"; // i.e. 'basic-page' | |
$parent = "INSERT_PARENT_HERE"; // i.e. /about-us/ | |
$c = new Page(); |
This file contains 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 | |
$key = "<API Key>"; | |
$from = "info@example.com"; | |
$to = "dave@example.com"; | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
if(isset($_POST['timestamp']) && isset($_POST['token']) && isset($_POST['signature']) && hash_hmac('sha256', $_POST['timestamp'] . $_POST['token'], $key) === $_POST['signature']) | |
{ | |
if($_POST['event'] == 'complained') { |
This file contains 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 | |
$di = $app->getContainer(); | |
// ----------------------------------------------------------------------------- | |
// Service providers | |
// ----------------------------------------------------------------------------- | |
// Twig | |
$di->set('view', function () use ($di) { | |
$settings = $di->get('settings'); |
This file contains 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 | |
// Before: composer require monolog/monolog | |
// composer autoloader | |
require_once 'vendor/autoload.php'; | |
// Shortcuts for simpler usage | |
use \Monolog\Logger; | |
use \Monolog\Formatter\LineFormatter; | |
use \Monolog\Handler\StreamHandler; |
This file contains 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 | |
/* | |
* /path/to/migrations/directory/Version20121011141021.php | |
*/ | |
namespace ExampleMigrations; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Doctrine\DBAL\Schema\Schema; | |
class Version20121011141021 extends AbstractMigration |
This file contains 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 | |
/** | |
* Debug SOAP requests | |
*/ | |
$client = new SoapClient( | |
'http://example.loc/index.php/api/v2_soap/?wsdl' | |
); | |
// Set yourself debug session cookie, for Xdebug and Phpstorm |
This file contains 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
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
This file contains 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
user www-data; | |
http { | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; |
This file contains 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
alias redstart='redis-server /usr/local/etc/redis/6379.conf' | |
alias redstop='redis-cli -h 127.0.0.1 -p 6379 shutdown' |
NewerOlder