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 get_discounted_price_custom( $product = null ) { | |
if ( $product == null ) { | |
return false; | |
} | |
if ( $product->is_type( 'variable' ) ) { | |
$default_attributes = $product->get_variation_default_attributes(); | |
$variation_id = iconic_find_matching_product_variation( $product, $default_attributes ); | |
$product = wc_get_product( $variation_id ); |
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
{# Get the categories related to my "entrySection" entries in structure order #} | |
{% set entries = craft.entries.section('entrySection') %} | |
{% set relatedCats = craft.categories.relatedTo(entries) %} | |
{# Loop the categories #} | |
{% for category in relatedCats %} | |
{{ category.title }} | |
{# Get and loop through entries related to this cat #} |
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
#from root dir | |
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/home/usamba","/lost+found"} /* /home/usamba/backup_folder |
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 attributeLabels() { | |
$labels = array( | |
'placeOfBirth' => 'Place Of Birth', | |
'notes' => 'Notes', | |
'status' => 'Status', | |
'studentID' => 'Student', | |
'entryYear' => 'Entry Year', | |
); | |
return array_merge($labels, parent::attributeLabels()); |
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
::set PATH=%PATH%;C:\wamp\bin\php\php5.3.13 ::not necessary if php is set on environment variables | |
::set FRAMEWORKS=C:\frameworks ::not necessary if frameworks is set on environment variables | |
@echo off | |
setlocal enabledelayedexpansion | |
set /a counter=0 | |
echo Please enter your choice: | |
for /f %%i in ('dir /b %FRAMEWORKS%"\yii*"') do ( | |
set /a counter+=1 | |
set option=!counter! %%i |
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
/* Drupal 6 Rules | |
* Unpublish of content with Date field (identity check date-based) | |
* Send auto email with Datetime field (identity check date-based) | |
*/ | |
//removes all the headers, this comment included | |
array ( | |
'rules' => | |
array ( | |
'rules_send_auto_email' => |
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
/** | |
* DRUPAL | |
* Use of the rules | |
* Example of unpublishing a node on a date with rules scheduler | |
*/ | |
Create the Rule set first...then the Rule. | |
at /admin/config/workflow/rules/components/add | |
Create a ruleset (name it "Unpublish Content") |
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
// Add in Google Analytics tracking; just in case ga.js isn't correctly loaded | |
var track = function(category, name, value) { | |
if (window._gaq) { | |
window._gaq.push(["_trackEvent", category, name, value]); | |
} | |
}; | |
track("Source", "Visit", this.href); |
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 src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script>window.jQuery || document.write("<script src='js/libs/jquery-1.7.2.min.js'>\x3C/script>")</script> |
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
#Tools->Options->Miscellaneous->Files->Ignored Files Pattern | |
^(yiilite\.php|CVS|SCCS..... | |
#Create new php file in your project /protected directory named yii.php with this content: | |
class Yii extends YiiBase | |
{ | |
/** | |
* Returns the application singleton or null if the singleton has not been created yet. | |
* @return CWebApplication the application singleton, null if the singleton has not been created yet. | |
*/ |
NewerOlder