This file contains hidden or 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 | |
| /** | |
| * Rewrite Mage_Catalog_Model_Resource_Url class | |
| * | |
| * @category Lyonscg | |
| * @package Lyonscg_Catalog | |
| * @author Vladimir Kosenok [email protected] | |
| * @copyright Copyright (c) 2012 Lyons Consulting Group (www.lyonscg.com) | |
| */ |
This file contains hidden or 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 | |
| // Define the 'class' class | |
| $class = Obj() | |
| ->fn('new', function ($class) { | |
| $newClass = Obj($class->methods) | |
| ->fn('new', function($class) { | |
| $obj = Obj($class->imethods); | |
| $args = func_get_args(); | |
| array_shift($args); |
This file contains hidden or 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 | |
| /** | |
| * PHP also could behave as prototype object | |
| */ | |
| class Object { | |
| public function __call($name, $args) | |
| { | |
| return call_user_func_array( | |
| $this->$name, |
This file contains hidden or 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 | |
| $array = array(4,3,2,1); | |
| function sum ($arr) { | |
| if (empty($arr)) { | |
| return 0; | |
| } else { | |
| return $arr[0] + sum(array_slice($arr, 1)); | |
| } |
This file contains hidden or 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 | |
| /** | |
| * @author [email protected] | |
| * | |
| * Script to migrate data between databases | |
| * Migration uses delete strategy | |
| * Drop table on destination database, | |
| * create new one based on the data from source database | |
| * insert data from source database | |
| * |
This file contains hidden or 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 | |
| /** | |
| * @author [email protected] | |
| */ | |
| $c = file_get_contents('pdo_mysql-2.log'); | |
| $qs = explode("\n\n", $c); | |
| array_pop($qs); | |
| $res = 0; | |
| $dups = array(); |
This file contains hidden or 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
| # Add Speroteck repository to global configuration of composer | |
| composer config --global repositories.speroteck composer http://composer.speroteck.com/ | |
| # Look for speroteck repositories | |
| composer search speroteck | |
| # Get information about package | |
| composer show speroteck/quickview | |
| # Create magento project |
This file contains hidden or 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
| # Add Speroteck composer endpoint to global configuration | |
| composer config --global repositories.speroteck composer http://composer.speroteck.com/ | |
| # Example: create Magento project | |
| composer create-project speroteck/magento-ce --repository-url=http://composer.speroteck.com/ |
This file contains hidden or 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
| http://lero9.co.nz/ | |
| http://themeforest.net/item/beautyshop-premium-responsive-magento-theme/3976069 |
This file contains hidden or 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
| cat ~/.ssh/id_dsa.pub | ssh you@remote 'cat - >> ~/.ssh/authorized_keys' |