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 | |
$monthNum = 5; | |
$monthName = date("F", mktime(0, 0, 0, $monthNum, 10)); | |
echo $monthName; //output: May |
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 csv_to_array($filename='', $delimiter=',') | |
{ | |
if(!file_exists($filename) || !is_readable($filename)) | |
return FALSE; | |
$header = NULL; | |
$data = array(); | |
if (($handle = fopen($filename, 'r')) !== FALSE) | |
{ |
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
<script type="text/javascript"> | |
var message = "Scroller text goes here"; | |
var space = ""; | |
var i = 0; | |
function scroller(){ | |
if(i < 100){ | |
space += " "; | |
} | |
window.status = space + message; | |
} |
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 if( $this->getRequest()->getControllerName() !== 'onepage') { ?> | |
// your javascript statements goes here | |
<?php } ?> |
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 if( | |
Mage::getSingleton('cms/page')->getIdentifier() == 'home' && | |
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' | |
) : ?> | |
<!-- CONTENT GOES HERE --> | |
<?php endif; ?> |
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 | |
if($this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true))): | |
echo "Homepage"; | |
else: | |
echo "Not in Homepage"; | |
endif; |
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
var gistPrefix = 'http://gist.github.com/', | |
// Cache document.write so that it can be restored once all Gists have been | |
// embedded. | |
cachedWrite = document.write, | |
body = $('body'), | |
// Map each p.gist to an object that contains the paragraph to be replaced | |
// and the Gist's identifier. | |
gists = $('p.gist').map(function(n, p) { | |
p = $(p); |
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 wordpress_youtube_thumbnail($content){ | |
preg_match("/v\/([^*]+)/i", $content, $matches); | |
$matches[1] = preg_replace("/\?/","&",$matches[1]); | |
if($matches[1]=="" || empty($matches[1])){ | |
preg_match("/watch\?v=([^*]+)/i", $content, $matches); | |
$matches[1] = preg_replace("/\?/","&",$matches[1]); | |
} | |
$images = explode("&",$matches[1]); | |
//http://img.youtube.com/vi/bQVoAWSP7k4/1.jpg |
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
Installing AutoConf and Fixing Phpize on OSX 10.9 |
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
Fix Magento 'httponly' issue | |
============================ |