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 ErrorController extends Zend_Controller_Action | |
{ | |
public function errorAction() | |
{ | |
/** Other suff */ | |
if ( true === $this->getRequest()->isXmlHttpRequest() ) | |
{ |
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 App_Thumb | |
{ | |
protected $_width = null; | |
protected $_oldWidth = null; | |
protected $_height = null; | |
protected $_oldHeight = null; | |
protected $_imagePath = null; | |
protected $_resource = 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
FOR /F "tokens=*" %G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q %G |
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 | |
/** | |
* Based on FileCache class by Erik Giberti, | |
* http://af-design.com/blog/2010/07/30/simple-file-based-caching-in-php/ | |
* | |
* @author nebiros | |
*/ | |
class App_Cache { | |
/** |
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 | |
/** | |
* Mysql wrapper, to handle some mysql_* functions in a OOP way. | |
* | |
*/ | |
class App_Db_Mysql { | |
const DEFAULT_ROW_COUNT = 10; | |
const DEFAULT_PAGE = 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
<?php | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { | |
/** | |
* | |
* @return void | |
*/ | |
protected function _initRouting() { | |
/* @var $fc Zend_Controller_Front */ | |
$fc = $this->getPluginResource( "frontcontroller" )->getFrontController(); |
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
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
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
# brew install re2c graphviz | |
# cd /tmp | |
# wget http://pecl.php.net/get/xhprof-0.9.2.tgz | |
# tar -xvzf xhprof-0.9.2.tgz | |
# cd xhprof-0.9.2/extension | |
# phpize | |
# MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch i386 -arch x86_64 -bind_at_load" | |
# export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET | |
# ./configure --with-php-config=/usr/local/zend/bin/php-config | |
# make |
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
module Feedzirra | |
module Parser | |
class FlickrEntry | |
include SAXMachine | |
include FeedEntryUtilities | |
element :guid, :as => :id | |
element :link, :as => :url |