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
Date (Year, Month, Day): | |
%Y - Year with century (can be negative, 4 digits at least) | |
-0001, 0000, 1995, 2009, 14292, etc. | |
%C - year / 100 (round down. 20 in 2009) | |
%y - year % 100 (00..99) | |
%m - Month of the year, zero-padded (01..12) | |
%_m blank-padded ( 1..12) | |
%-m no-padded (1..12) | |
%B - The full month name (``January'') |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/* Add container around videos */ | |
add_filter( 'embed_oembed_html', 'custom_oembed_filter', 10, 4 ) ; | |
function custom_oembed_filter($html, $url, $attr, $post_ID) { | |
$return = '<div class="video-container">'.$html.'</div>'; | |
return $return; | |
} |
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
#Remove or comment out this line in config/initializers/devise.rb | |
config.secret_key = "d9eb5171c59a4c817f68b0de27b8c1e340c2341b52cdbc60d3083d4e8958532" \ | |
"18dcc5f589cafde048faec956b61f864b9b5513ff9ce29bf9e5d58b0f234f8e3b" |
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
rails _3.2.13_ new app_name --skip-active-record --skip-test-unit --skip-javascript --skip-bundle | |
(change version rails version number) |
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
1. Copy /etc/hosts somewhere etc. /Users/username/AndroidHosts | |
2. Change copied hosts file so that you have 10.0.2.2 instead of 127.0.0.1 for every one of your virtual hosts | |
3. Start your emulator from Google SDK | |
4. When Emulator starts execute these commands | |
$ adb remount | |
$ adb push /Users/username/AndroidHosts/hosts /system/etc/ | |
Virtual hosts should work now. |
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 | |
$newFromDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsFromDate(); | |
$newToDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsToDate(); | |
$now = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); | |
if(($newFromDate < $now && $newFromDate != NULL) && ($newToDate > $now || $newToDate == "")){ | |
echo "New Product"; | |
} | |
?> |
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 | |
function themeName_preprocess_page(&$vars, $hook) { | |
if (isset($vars['node'])) { | |
// If the node type is "blog_madness" the template suggestion will be "page--blog-madness.tpl.php". | |
$vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type; | |
} | |
} | |
?> |
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
/* == WordPress WYSIWYG Editor Styles == */ | |
.entry-content img { | |
margin: 0 0 1.5em 0; | |
} | |
.alignleft, img.alignleft { | |
margin-right: 1.5em; | |
display: inline; | |
float: left; | |
} |
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 | |
/* Add this to themes template.php */ | |
function THEME_NAME_css_alter(&$css) | |
{ | |
unset($css[drupal_get_path('module', 'system').'/system.theme.css']); | |
unset($css[drupal_get_path('module','system').'/system.base.css']); | |
unset($css[drupal_get_path('module', 'system').'/system.messages.css']); | |
unset($css[drupal_get_path('module', 'comment').'/comment.css']); |