Skip to content

Instantly share code, notes, and snippets.

View AV4TAr's full-sized avatar

Diego Sapriza AV4TAr

View GitHub Profile
@AV4TAr
AV4TAr / gist:1350193
Created November 9, 2011 02:57
throw 404 exception in zend framework
<?php
throw new Zend_Controller_Action_Exception("UPS!!! This page don't exist",404);
@AV4TAr
AV4TAr / sphinx.conf
Created February 6, 2012 19:04
Mysql Meetup - Sphinx - ejemplo1
source source1
{
type = mysql
sql_host = mysqlA
sql_user = user
...
sql_query = SELECT id, group_id, UNIX_TIMESTAMP(date_added) \
date_added, title, content \
FROM documents
sql_attr_uint = group_id
@AV4TAr
AV4TAr / gist:1754328
Created February 6, 2012 19:41
Mysql Meetup - Sphinx ejemplo2
index test1 {
source = source1
source = source2
charset_type = sbcs
path = /sphinx/data/test1
}
@AV4TAr
AV4TAr / gist:1760825
Created February 7, 2012 17:23
Mysql Meetup - Sphinx ejemplo distrbuido
index dist1
{
type = distributed
local = archive
agent: hCHUNCK01:9332:CHUNK01
agent: hCHUNCK02:9332:CHUNK02
agent: hCHUNCK03:9332:CHUNK03
agent: hCHUNCK04:9332:CHUNK04
agent: hCHUNCK02:9332:CHUNK05
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@AV4TAr
AV4TAr / navigation.xml
Created April 12, 2012 18:32
navigation xml flie
<?xml version="1.0" encoding="UTF-8"?>
<configdata>
<nav>
<home>
<label>Home</label>
<uri>/</uri>
<pages>
<database>
<label>Search</label>
@AV4TAr
AV4TAr / Bootstrap.php
Created April 12, 2012 18:41
Bootstraping Zend_Navigation
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initNavigation()
{
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$config = new Zend_Config_Xml(APPLICATION_PATH .
@AV4TAr
AV4TAr / gist:2370035
Created April 12, 2012 18:50
Layout.phtml
...
<section id="breadcrumbs">
<ul class="breadcrumb">
<?=
$this->navigation()
->breadcrumbs()
->setMinDepth(0)
->setLinkLast(false)
->setSeparator(" / ");
?>
@AV4TAr
AV4TAr / gist:2370124
Created April 12, 2012 19:01
navigation setup example
<?php
class ManagementController extends Zend_Controller_Action
{
public function init()
{
//where are we?
$uri = $this->getRequest()->getPathInfo();
//activate the navigation option
<?php
$seleccion = 25;
$i = 1;
$cantidad_de_dias = 31;
echo "<select>";
while($i<=$cantidad_de_dias){
if($i == $seleccion){
echo '<option value='.$i.' selected="selected">'.$i.'</option>';
} else {