Aug 17
icon1 admin | icon2 images, technical | icon4 08 17th, 2010| icon3 No Comments »
Tags: , ,

this is a cool website. Done with the Canvas element in HTML5

here’s flowerpoop drawn out.

if you draw some stuff we’ll host it here.

http://www.openrise.com/lab/FlowerPower/

Your Ad Here
Jul 13
icon1 admin | icon2 technical | icon4 07 13th, 2010| icon3 No Comments »
Tags:

I needed ImageMagick to do some image manipulation, i ran across this very cool php extension. instead of using GD. you may run into some small snafus while trying to install it. my system is fedora core 12

first thing you do is install ImageMagick, and ImageMagick-devel

yum install ImageMagick-devel ImageMagick

then you run pecl

pecl install imagck

if you run into any problems like re2c not being up to date. pull the latest RPM, and install.

the cool thing about this extension is when you want to resize images on the fly its as easy as this

<?php

header(‘Content-type: image/jpeg’);

$image = new Imagick(‘image.jpg’);

// If 0 is provided as a width or height parameter,
// aspect ratio is maintained
$image->thumbnailImage(100, 0);

echo $image;

?>

Jun 12
icon1 admin | icon2 technical | icon4 06 12th, 2010| icon3 No Comments »
Tags: , , ,

if you ever need to redirect w/in a plugin

$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper(‘redirector’);
$redirector->gotoUrl(‘url’);
Your Ad Here
May 24

Ever change the svn repository location and needed to update the old location to the new location here how you do it

flowerpoop@lappy2000:~$ svn switch –relocate [old repo url] [new repo url]

that’s it kids that’s all you have to do.

Jul 22
icon1 admin | icon2 technical | icon4 07 22nd, 2009| icon3 No Comments »

ok i have been playing with zend at home to increase my knowledge, and i have run across this, i think its pretty handy, and gave me much insight in zend’s 1.8 bootstrapping method. i didnt use any of the dojo stuff, mainly because i plan to use jquery for all my dynamic javascripting needs.

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
    /**
     * Bootstrap autoloader for application resources
     *
     * @return Zend_Application_Module_Autoloader
     */

    public static $root = ;
    public static $registry;  
    public static $db;  
   
    public function getRoot(){
        $path = $_SERVER[‘DOCUMENT_ROOT’];
        if (substr($path,strlen($path) -1,strlen($path)) == ‘/’){
            $path = substr($path,0,strlen($path)-1);
        }
        return $path;
    }    
    protected function _initAutoload() {
        $autoloader = new Zend_Application_Module_Autoloader ( array (‘namespace’ => ‘Default’, ‘basePath’ => dirname ( __FILE__ ) ) );
        Zend_Session::setOptions(array(‘remember_me_seconds’ => 7200));
        Zend_Session::start();
        self::$root = $this->getRoot();
        self::setConfig();
        self::setRegistry();
        self::setTimeZone();
        self::setupDatabase();
        return $autoloader;
    }
    //Date time setting will be done here
    public static function setTimeZone()
    {
        date_default_timezone_set(‘Europe/London’);
    }
    //Configuration file reading & setting up configuration will be done using following.
    public static function setConfig(){
       
        $config = new Zend_Config_Ini(
            self::$root . ‘/../application/configs/application.ini’,APPLICATION_ENV);
            self::$registry->configuration = $config;
            self::$db = self::$registry->configuration->resources->toArray();
    }
   
    public static function setRegistry()
    {
        self::$registry = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS);
        Zend_Registry::setInstance(self::$registry);
    }

    /*DB setup done here.
    Read configuration, create db instance & set in registry to use in other part of application.*/
 
    public static function setupDatabase()  
    {  
        $config = self::$db;
        $db = Zend_Db::factory($config["db"]["adapter"], $config["db"]["params"]);  
        $db->query("SET NAMES ‘utf8′");  
        self::$registry->database = $db;  
        Zend_Db_Table::setDefaultAdapter($db);  
    }  
   
    protected function _initView() {
        // Initialize view
        $view = new Zend_View ( );
        //$view->doctype(‘XHTML1_STRICT’); /* Quick Change out depending on project */
        $view->doctype ( ‘XHTML1_TRANSITIONAL’ );    /* Quick Change out depending on project */
       
        $view->env = APPLICATION_ENV;
       
        Zend_Dojo::enableView ( $view );
        Zend_Dojo_View_Helper_Dojo::setUseDeclarative ();
        $view->dojo ()->setLocalPath ( "/js/prod/dojo/dojo.js" )
                ->setDjConfigOption ( ‘usePlainJson’, true )
                ->setDjConfigOption ( ‘parseOnLoad’, true )
                ->addStylesheetModule ( ‘dijit.themes.soria’ )
                ->addStylesheet ( ‘/js/prod/dojox/grid/resources/soriaGrid.css’ )
                ->enable ();
        // Add it to the ViewRenderer
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper ( ‘ViewRenderer’ );
        $viewRenderer->setView ( $view );
        // Return it, so that it can be stored by the bootstrap
        return $view;
    }
}

more can be read here i give credit to the guy who wrote this up originally and shared with the rest of the world.

Your Ad Here
Older Poop
Get Adobe Flash playerPlugin by wpburn.com wordpress themes