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 | |
/*********Start Pepperjam Network Codes #1 ******/ | |
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId(); | |
$order = Mage::getSingleton('sales/order'); | |
$order->load($lastOrderId); | |
$_totalData = $order->getData(); | |
$_currency = $_totalData['order_currency_code']; | |
$_productData = $order->getAllItems(); |
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 | |
//Possible color value | |
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color'); //"color" is the attribute_code | |
$allOptions = $attribute->getSource()->getAllOptions(true, true); | |
foreach ($allOptions as $instance) { | |
$id = $instance['value']; //id of the option | |
$value = $instance['label']; //Label of the option | |
} | |
?> |
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
root@myserver:~# dd if=/dev/zero of=/swap.dat bs=1024 count=512k | |
root@myserver:~# mkswap /swap.dat | |
root@myserver:~# swapon /swap.dat | |
root@myserver:~# vim /etc/fstab | |
vim is started to edit, add the following to the end of /etc/fstab file | |
/swap.dat none swap sw 0 0 | |
Then, edit the mysql config file | |
root@myserver:~# vim /etc/mysql/my.cnf |
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 | |
/** | |
* Export MySQL users and permissions | |
* | |
* This script exports raw CREATE USER and GRANT queries of a given database | |
* to help migrate MySQL users and permissions to a new server. | |
* Users will keep their passwords across the migration. | |
* | |
* Warning: The import queries expects exactly the same database structure! | |
* |
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 | |
use Aws\Common\Aws; | |
use Aws\S3\Exception\S3Exception; | |
// make sure the SDK is installed | |
// I've used Composer to autoload it: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html | |
/* | |
* jQuery File Upload Plugin PHP Class 7.1.0 | |
* https://github.com/blueimp/jQuery-File-Upload |
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
jQuery(document).ready(function($) { | |
jQuery('input[placeholder]').each(function(){ | |
var ph=jQuery(this).attr('placeholder'); | |
if(jQuery(this).val()=='') | |
jQuery(this).val(ph); | |
jQuery(this).focus(function(){ |
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
/** | |
* Template Name: Showcase Template | |
* Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts | |
* | |
* The showcase template in Twenty Eleven consists of a featured posts section using sticky posts, | |
* another recent posts area (with the latest post shown in full and the rest as a list) | |
* and a left sidebar holding aside posts. | |
* | |
* We are creating two queries to fetch the proper posts and a custom widget for the sidebar. | |
* |
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
function my_scripts_method() { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); | |
wp_enqueue_script( 'jquery' ); | |
} | |
add_action('wp_enqueue_scripts', 'my_scripts_method'); |
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
$(document).ready(function() | |
{ | |
}); |
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
function toUnicode(theString) { | |
var unicodeString = ''; | |
for (var i=0; i < theString.length; i++) { | |
var theUnicode = theString.charCodeAt(i).toString(16).toUpperCase(); | |
while (theUnicode.length < 4) { | |
theUnicode = '0' + theUnicode; | |
} | |
theUnicode = '\\u' + theUnicode; | |
unicodeString += theUnicode; | |
} |