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
| /** | |
| * @return array validation rules for model attributes. | |
| */ | |
| public function rules() | |
| { | |
| return array( | |
| array('title','length','max'=>255), | |
| array('title, created, modified', 'required'), | |
| array('modified','default', | |
| 'value'=>new CDbExpression('NOW()'), |
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
| function home_page_menu_args( $args ) { | |
| $args['show_home'] = true; | |
| return $args; | |
| } | |
| add_filter( 'wp_page_menu_args', 'home_page_menu_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
| UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com', 'http://www.new-domain.com'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.old-domain.com','http://www.new-domain.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
| Array ( | |
| [order_id] => 300080 | |
| [is_parent_order] => N | |
| [parent_order_id] => 0 | |
| [company_id] => 0 | |
| [user_id] => 14 | |
| [total] => 72.00 | |
| [subtotal] => 72 | |
| [discount] => 0.00 | |
| [subtotal_discount] => 0.00 |
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
Show hidden characters
| [ | |
| { | |
| "class": "label_control", | |
| "color": [255, 255, 255], | |
| "shadow_color": [24, 24, 24], | |
| "shadow_offset": [0, -1] | |
| }, | |
| { | |
| "class": "button_control", | |
| "content_margin": [6, 5, 6, 6], |
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
| # Set php version through phpenv. 5.3, 5.4, 5.5, 5.6, 7.0 and 7.1 available | |
| phpenv local 7.1 | |
| sed -i'' 's/^memory_limit=.*/memory_limit = 512m/g' ${HOME}/.phpenv/versions/7.1/etc/php.ini | |
| # Install mailhog | |
| brew install mailhog | |
| #Setup MySql | |
| mysql -e 'create database forge;' | |
| mysql -e 'CREATE USER 'forge'@'localhost';' | |
| mysql -e 'GRANT ALL PRIVILEGES ON * . * TO 'forge'@'localhost';' | |
| # Install dependencies through Composer |
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
| var doc = context.document | |
| var selectLayersOfType_inContainer = function(layerType, containerLayer) { | |
| // Filter layers using NSPredicate | |
| var scope = (typeof containerLayer !== 'undefined') ? [containerLayer children] : [[doc currentPage] children], | |
| predicate = NSPredicate.predicateWithFormat("(className == %@)", layerType), | |
| layers = [scope filteredArrayUsingPredicate:predicate]; | |
| // Deselect current selection |
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
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
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
| UPDATE | |
| tableA | |
| SET | |
| columnA = SUB.columnB | |
| FROM | |
| ( select id, columnB FROM tableA ) as SUB | |
| WHERE | |
| tableA.id = SUB.id; |
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 | |
| $supportedLangs = array('en-GB', 'fr', 'de'); | |
| $languages = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
| foreach($languages as $lang) | |
| { | |
| if(in_array($lang, $supportedLangs)) | |
| { |
OlderNewer