- Take into consideration this may break old legacy applications.
- Syntax changes may be required for old legacy applications.
- Therefore do not run this in production environment.
- Instead you need to consider creating a test enviroment using the below instructions.
- Ubuntu 14.x does not include PHP7 by default. There is not a fixed date on when Ubuntu will include PHP 7 in the official repository.
- My webserver of choice is nginx over apache. No problem so far using nginx.
- If you run into problems please read the output from error.
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 namespace BackOfficeBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
/** | |
* Class BackOfficeBaseController | |
* @author Jaziel Lopez <[email protected]> | |
* @package BackOfficeBundle\Controller | |
*/ | |
abstract class BackOfficeBaseController extends Controller |
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
#!/usr/bin/env bash | |
mkdir /etc/nginx/ssl 2>/dev/null | |
openssl genrsa -out "/etc/nginx/ssl/$1.key" 1024 2>/dev/null | |
openssl req -new -key /etc/nginx/ssl/$1.key -out /etc/nginx/ssl/$1.csr -subj "/CN=$1/O=Vagrant/C=UK" 2>/dev/null | |
openssl x509 -req -days 365 -in /etc/nginx/ssl/$1.csr -signkey /etc/nginx/ssl/$1.key -out /etc/nginx/ssl/$1.crt 2>/dev/null | |
block="server { | |
listen ${3:-80}; | |
server_name $1; |
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
/** | |
* | |
* Utility Backoffice Object | |
*/ | |
window.backoffice = Object.create({ | |
/** | |
* Getter URL parameters | |
* @param name | |
* @returns {string|null} | |
*/ |
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
/** | |
* | |
* Trim and replace multiple whitespaces | |
* @param $value | |
* | |
* @return mixed | |
*/ | |
public function sanitize($value){ | |
return preg_replace('/\s+/', ' ', trim($value)); |
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
/** Use contraints **/ | |
use Symfony\Component\Validator\Constraints\Email; | |
use Symfony\Component\Validator\Constraints\Regex; | |
use Symfony\Component\Validator\Constraints\Url; | |
/** Snapshot of a controller class **/ | |
public function postAction(Request $request) | |
{ | |
$nameContainsErrors = $this->validator->validate($this->request->get('vendor_name'), new Regex(['pattern' => '/^[a-zA-Za0-9_-\s]+$/'])); | |
$urlContainsErrors = $this->validator->validate($this->request->get('vendor_url'), new Url()); |
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
SELECT GROUP_CONCAT(id), EMAIL, COUNT(*) as COUNT | |
FROM customer | |
GROUP BY email | |
HAVING COUNT(*) >= 2; |
Quick HOWTO installation | Python's scrapy package | OSX 10.10.5 | Homebrew
- Using homebrew make sure you have all dependencies for python's resolved to prevent any issue from breaking packages.
$brew install python
- If the previous step was satisfactory then create a generic directory for python's projects
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
$(document).ready(function(){ | |
/** | |
* Proxy | |
* @type {string} | |
*/ | |
var proxy = '/wp-content/themes/samples.theme/proxy.php?url='; | |
/** | |
* Growl errors |
OlderNewer