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
if(isset($_POST['matching_algo_run_time']) && !empty($_POST['matching_algo_run_time'])){ | |
$algo_time = explode(':', $_POST['matching_algo_run_time']); | |
$hours = $algo_time[0]; | |
$minutes = $algo_time[1]; | |
$hour_12 = ($hours > 12) ? ($hours + 12) - 24 : $hours + 12; | |
if($hour_12 == 24) | |
$hour_12 = '00'; | |
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
---------CRON JOB--------------------------------------------- | |
#Bestee Import Products and Categories From Amazon every 5 Hours | |
00 */05 * * * curl -s -m 10 http://inheritx.dnsdynamic.com:8590/bestee/job/ImportAmazonProducts > /dev/null 2>&1 | |
#Bestee Get The Score For Amazon Products After every 1 Hour | |
00 */01 * * * curl -s -m 10 http://inheritx.dnsdynamic.com:8590/bestee/job/TestFreakScoreMigration > /dev/null 2>&1 |
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 FAMILY TREE MYSQL CUSTOM FUNCTION------------------ | |
DELIMITER $$ | |
DROP FUNCTION IF EXISTS `GetChildren` $$ | |
CREATE FUNCTION `GetChildren` (GivenID INT) RETURNS TEXT CHARSET latin1 | |
DETERMINISTIC | |
BEGIN | |
DECLARE rv,q,strq,queue,queue_children TEXT; |
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
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] |
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 ANCESTORS MYSQL CUSTOM FUNCTION------ | |
DELIMITER $$ | |
DROP FUNCTION IF EXISTS `GetAncestry` $$# MySQL returned an empty result set (i.e. zero rows). | |
CREATE FUNCTION `GetAncestry` (GivenID INT) RETURNS VARCHAR(1024) | |
DETERMINISTIC | |
BEGIN | |
DECLARE rv VARCHAR(1024); | |
DECLARE cm CHAR(1); |
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
Install Elance Tracker | |
------------------------ | |
1. Download elance tracker from the elance for ubuntu. | |
2. Download Adobe Air | |
wget http://airdownload.adobe.com/air/lin/download/latest/AdobeAIRInstaller.bin | |
3. Provide proper permission | |
chmod +X AdobeAIRInstaller.bin |
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
// Preview Image | |
function preview(input) | |
{ | |
if (input.files && input.files[0]) | |
{ | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
$('#preview_image') | |
.attr('src', e.target.result) |
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 | |
/** | |
* Spintax - A helper class to process Spintax strings. | |
* @name Spintax | |
* @author Jason Davis - http://www.codedevelopr.com/ | |
*/ | |
class Spintax | |
{ | |
public function process($text) | |
{ |
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
for($i=0;$i<10;$i++) | |
{ | |
echo "<div class=class".($xyz++%2).">Hello</div>"; | |
} | |
// OR | |
for($j=0;$j<10;$j++) | |
{ | |
$class = ($j%2 == 0)?'even':'odd'; |
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 | |
$this->widget('zii.widgets.jui.CJuiDatePicker', array( | |
'name'=>'from_date', | |
'options'=>array( | |
'showAnim'=>'fold', // 'show' (the default), 'slideDown', 'fadeIn', 'fold' | |
'dateFormat'=>'dd-mm-yy', | |
'showOn'=>'button', // 'focus', 'button', 'both' | |
'buttonText'=>Yii::t('ui','Select form calendar'), | |
'buttonImage'=>Yii::app()->baseUrl.'/images/calendar.png', | |
'buttonImageOnly'=>true, |
NewerOlder