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 | |
/** | |
* Return the value for a key in an array or a property in an object. | |
* Typical usage: | |
* | |
* $object->foo = 'Bar'; | |
* echo get_key($object, 'foo'); | |
* | |
* $array['baz'] = 'Bat'; | |
* echo get_key($array, 'baz'); |
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 getUtf8String($string) { | |
if ( !isUtf8($string) ) | |
return utf8_encode($string); | |
return $string; | |
} | |
function isUtf8($string) { | |
if ( function_exists("mb_check_encoding") ) { | |
return mb_check_encoding($string, 'UTF8'); |
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 transcribe_cp1252_to_latin1($cp1252) { | |
return strtr( | |
$cp1252, | |
array( | |
"\x80" => "e", "\x81" => " ", "\x82" => "'", "\x83" => 'f', | |
"\x84" => '"', "\x85" => "…", "\x86" => "+", "\x87" => "#", | |
"\x88" => "^", "\x89" => "0/00", "\x8A" => "S", "\x8B" => "<", | |
"\x8C" => "OE", "\x8D" => " ", "\x8E" => "Z", "\x8F" => " ", | |
"\x90" => " ", "\x91" => "`", "\x92" => "'", "\x93" => '"', |
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 get_thumbnail($img_path, $folder = ''){ | |
// Should we just return the given $img_path? | |
if(empty($folder) || !strstr($img_path, '/')){ | |
return $img_path; | |
} | |
// Insert folder name right before image filename |
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
/* It would be better to reference these Google webfonts directly from your html file */ | |
@import url(http://fonts.googleapis.com/css?family=Molle:400italic); | |
@import url(http://fonts.googleapis.com/css?family=Droid+Sans); | |
body { | |
font-family: "Droid Sans"; | |
font-size: 14px; | |
line-height: 1.4em | |
} |
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 | |
/** | |
* Filter input based on a whitelist. This filter strips out all characters that | |
* are NOT: | |
* - letters | |
* - numbers | |
* - Textile Markup special characters. | |
* | |
* Textile markup special characters are: |
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 | |
// your prefix here | |
$prefix = 'mg4Hk_'; | |
// magento sample data file | |
// make sure the path to the magento sample data folder is set correctly | |
$sample_data_path = '../magento-sample-data-1.6.1.0/'; | |
$dumpFile = $sample_data_path . "magento_sample_data_for_1.6.1.0.sql"; |
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
<[\/]?(span|font|div)[^>]*> |
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
* { font-size: 14px; font-family: helvetica, arial, sans-serif; } | |
body { margin: 0; padding: 0; } | |
h1 { font-size: 24px; } | |
h2 { font-size: 18px; } | |
h3 { font-size: 15px; } | |
header { padding: 20px 0; background: #eee; margin-bottom: 20px; } | |
main { margin-bottom: 20px; } | |
footer { border-top: 1px solid #ccc; margin: 40px 0; padding-top: 20px; text-align: right; } | |
.container { max-width: 700px; margin: 0 auto; width: 96%; padding: 0 2%; } |
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
@import url('http://fonts.googleapis.com/css?family=Arvo:400'); | |
@import url('http://fonts.googleapis.com/css?family=Dosis'); | |
body { margin: 0; padding: 0; color: #333; font-size: 18px; font-family: "Dosis", helvetica, arial, sans-serif; font-weight: normal; } | |
h1, h2, h3 { font-family: "Arvo", helvetica, arial, sans-serif; font-weight: normal; } | |
h2 a { color: #333; text-decoration: none; } | |
h2 a:hover, h2 a:active, h2 a:focus { color: #4288CE; text-decoration: none; } | |
h1 { font-size: 36px; } | |
h2 { font-size: 28px; } | |
h3 { font-size: 20px; } |
OlderNewer