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 | |
/** | |
* addContentSecurityPolicy | |
* | |
* Read : https://www.owasp.org/index.php/List_of_useful_HTTP_headers | |
* https://www.owasp.org/index.php/Content_Security_Policy_Cheat_Sheet | |
* http://www.html5rocks.com/en/tutorials/security/content-security-policy/ | |
* https://www.owasp.org/index.php/Content_Security_Policy | |
* http://content-security-policy.com/ | |
* |
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 | |
use Monolog\Logger; | |
use Monolog\Formatter\LineFormatter; | |
use Monolog\Handler\StreamHandler; | |
class Log | |
{ | |
public static $log; |
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 | |
/** | |
* Class Cache | |
* | |
* Facade class to wrap the basic cache functions we use to the Memcached extension so that | |
* we can decide to use a different cache and just rewrite this file instead of changing | |
* all the usages. | |
* | |
* @author Andy Beak |
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
composer.json | |
============= | |
For Laravel 4.x : "maatwebsite/excel": "1.*" | |
For Laravel 5 you can use the newer version. | |
HTML | |
==== | |
<form action="/ppd/download-excel" method="POST" id="download-ppd"> | |
<input id="form-filter-data" name="filter-data" type="hidden"> |
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
CREATE OR REPLACE RULE db_table_ignore_duplicate_inserts AS | |
ON INSERT TO db_table | |
WHERE (EXISTS ( SELECT 1 | |
FROM db_table | |
WHERE db_table.tbl_column = NEW.tbl_column)) DO INSTEAD NOTHING; |
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
/* | |
|-------------------------------------------------------------------------- | |
| Application Error Logger | |
|-------------------------------------------------------------------------- | |
| | |
| Here we will configure the error logger setup for the application which | |
| is built on top of the wonderful Monolog library. By default we will | |
| build a basic log file setup which creates a single file for logs. | |
| | |
*/ |
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
CREATE TABLE price_paid_data | |
( | |
id character varying(255) NOT NULL, | |
price integer NOT NULL, | |
purchase_date date NOT NULL, | |
postcode character varying(7), | |
property_type character varying(1), | |
new_build character varying(1) NOT NULL DEFAULT 0, | |
estate_type character varying(1), | |
paon character varying(255), |
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
#!/bin/bash | |
# Script from http://www.cyberciti.biz/tips/howto-linux-unix-write-to-syslog.html | |
result=$(echo -e "ping\n\r" | nc localhost 6082|grep PONG|wc -l); | |
if [ "${result}" -lt "1" ]; | |
then | |
/etc/init.d/varnish stop; | |
sleep 5; |
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
/** | |
* getPostFromBody | |
* | |
* Returns an array obtained from reading and decoding the post body | |
* Optionally supply an array of fields that are required to be present | |
* | |
* @version 1.0.0 | |
* @author Andy Beak | |
* @since 1.0.0 |
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
{ | |
"Version": "2008-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicRead", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", |
OlderNewer