Skip to content

Instantly share code, notes, and snippets.

@diogoca
diogoca / gist:5903822
Last active December 19, 2015 05:19
Install pagespeed on centos with cpanel/whm
Here is another exciting thing that google has release and i really wish to document this down so that i could reuse it on all of my servers since i can see a good amount of optimization done on the server by mod_pagespeed. Anyway without anymore bull crap, i shall starts.
Firstly, you might want to visit mod_pagespeed download page and standby for the time being. And my machine is a 64bit machine so if you are running on 32bit just remove all the ’64′ you see in the instruction. eg. “lib64″
Firstly login into your server as “root” and start firing the below commands,
cd /usr/local/src
mkdir mod_pagespeed
cd mod_pagespeed
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
@diogoca
diogoca / gist:5929412
Created July 4, 2013 18:05
htaccess flags
L will make last rule
NE is for no escaping query string
QSA will append your existing query parameters
NC is for ignore case comparison
@diogoca
diogoca / bootstrap.php
Last active December 20, 2015 00:39 — forked from jeroenherczeg/bootstrap.php
Twitter Bootstrap Partial View for Zend Navigation
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initNavigation() {
// make sure the layout is loaded
$this->bootstrap('layout');
// get the view of the layout
$layout = $this->getResource('layout');
$view = $layout->getView();
@diogoca
diogoca / gist:6510635
Created September 10, 2013 14:55
Compilar Varnish VCL - Procurar erros
varnishd -C -f /path/to/foo.vcl
@diogoca
diogoca / gist:6510646
Created September 10, 2013 14:56
Exportar Thunderbird para Outlook Express
Programa: http://luethje.eu/prog/mbx2e068_de.zip
Tutorial: http://email.about.com/od/mozillathunderbirdtips/qt/et_export_to_oe.htm
@diogoca
diogoca / gist:6510879
Created September 10, 2013 15:12
Ordenar array mais ocorrencia e deixar unique
Atualizado: http://jsbin.com/emonev/13/edit
http://jsbin.com/emonev/1/edit
var listaGenero = ['acao', 'drama', 'comedia', 'drama', 'drama', 'comedia', 'humor'];
function contarOcorrencia(genero) {
count = 0;
for (i = 0; i<=listaGenero.length - 1; i++)
@diogoca
diogoca / gist:6691191
Created September 24, 2013 21:02
Php Slug Function
public function slug($name)
{
$name = mb_strtolower($name, 'UTF-8');
$pattern = array(
'/[âãàáä]/u',
'/[êèéë]/u',
'/[îíìï]/u',
'/[ôõòóö]/u',
'/[ûúùü]/u',
@diogoca
diogoca / README.md
Created September 26, 2013 14:01 — forked from aronwoost/README.md

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

@diogoca
diogoca / gist:6764159
Created September 30, 2013 13:54
cron job output to email
php -q /home/username/public_html/support_ticket_sw/pipe/pop.php | mail -s "cron output" myemail@mydomain.com
@diogoca
diogoca / gist:6873543
Created October 7, 2013 19:29
Arruma Data no CentOS
# Arrumando a Data
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/America/Recife /etc/localtime