Skip to content

Instantly share code, notes, and snippets.

View harikt's full-sized avatar
⛱️
Tanvish Technologies

Hari K T harikt

⛱️
Tanvish Technologies
View GitHub Profile
@harikt
harikt / libraries.php
Created March 11, 2011 15:32
Add to libraries.php or clone li3_htmlpurifier ...
Libraries::add('HTMLPurifier', array(
"path" => LITHIUM_LIBRARY_PATH . "/HTMLPurifier/HTMLPurifier",
"includePath" => LITHIUM_LIBRARY_PATH . "/HTMLPurifier/HTMLPurifier",
"prefix" => "HTMLPurifier_",
"bootstrap" => "Bootstrap.php",
"loader" => array("HTMLPurifier_Bootstrap", "autoload"),
));
/*
* Add above code to libraries.php or
@harikt
harikt / Exception.php
Created April 15, 2011 01:56
Fuel PHP is a 5.3 framework
<?php
/**
* Fuel
*
* Fuel is a fast, lightweight, community driven PHP5 framework.
*
* @package Fuel
* @version 1.0
* @author Fuel Development Team
* @license MIT License
@harikt
harikt / flash.php
Created August 2, 2011 13:05
Flash Messages in ZF
<?php
//In controller
//Read http://akrabat.com/zend-framework/zend-frameworks-flash-messenger-action-helper/
if( $some_condition ) {
$this->_helper->flashMessenger->addMessage('Task saved');
$this->_redirect('admin/tours');
}
//Get all flash messengers
$this->view->messages = $this->_helper->flashMessenger->getMessages();
//The above will work as it redirects and calls the action again. The message will be there to show .
@harikt
harikt / sphinx
Created August 5, 2011 18:59
Running sphinx-quickstart
hari@hari-Vostro1510:/media/Linux/docs/docs$ sphinx-quickstart
Welcome to the Sphinx quickstart utility.
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).
Enter the root path for documentation.
> Root path for the documentation [.]:
You have two options for placing the build directory for Sphinx output.
@harikt
harikt / db.sql
Created September 16, 2011 05:45
Post and Tags Relation
-- Adminer 3.2.2 MySQL dump
SET NAMES utf8;
SET foreign_key_checks = 0;
SET time_zone = 'SYSTEM';
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `posts`;
CREATE TABLE `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@harikt
harikt / geonames.org
Created October 3, 2011 11:40
Import Geonames Database

First up, thanks to everyone in this thread… what i post is what took me a while to figure out (character set in load data and some other errors in the original script (like capital I in countryInfo etc).

Original Post Over : http://forum.geonames.org/gforum/posts/list/45/732.page

save as import.sql (update)

Code: CREATE DATABASE geonames; USE geonames;

@harikt
harikt / installing.sh
Created January 5, 2012 18:47
Compile and Install PHP 5.4 from Source
#Download Apache and extract it
$ ./configure --help
#You will get a list of options, run with enable-so
$ ./configure --enable-so
$ make
@harikt
harikt / Bootstrap.php
Created February 14, 2012 07:12
Routes for ZF , shown in example
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
/**
*
* Routes
*/
protected function _initRoutes()
{
@harikt
harikt / SplClassLoader.php
Created February 19, 2012 17:01 — forked from jwage/SplClassLoader.php
PSR-0 autoloader implementation
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@harikt
harikt / AbstractPage.php
Created April 9, 2012 19:03
Trying to make use of Twig than Aura.View, just vague idea, still need to think more on how to make a better way. How to change from controller etc
<?php
/**
*
* This file is part of the Aura project for PHP.
*
* @license http://opensource.org/licenses/bsd-license.php BSD
*
*/
namespace Hari\Twig\Web;
use Aura\Framework\Inflect;