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 | |
//Define Entry Point | |
if(!defined('sugarEntry'))define('sugarEntry', true); | |
chdir(realpath(dirname(__FILE__))); | |
require_once('include/entryPoint.php'); | |
class PowerMove { | |
private $db; | |
private $hitpoints; //AKA contacts | |
private $wave = 0; // AKA Page |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
cd /path/to/original/location | |
find . -depth -print | cpio -pdum /path/to/new/location |
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
#Tar and gzip with excludes | |
tar -zcvf backup.tar.gz --exclude="*.zip" --exclude="*.sql" * | |
#Tar and gzip while putting file in foriegn location | |
tar -zcvf /usr/local/backups/backup.tar.gz * | |
#Just tar | |
tar -cvf /usr/local/backups/backup.tar * | |
#Restore from tar.gz | |
cd /location/to/untar/to | |
tar -zxvf /path/to/backup.tar.gz |
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
#With Extension (PHP) | |
find . -iname "*.php" -print0 | xargs -0 grep -i -n 'Search Term' | less | |
#Without Extension | |
find . -iname "*" -print0 | xargs -0 grep -i -n 'Search Term' | less |
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 generate_seo_link($string, $replace = '-'){ | |
$string = strtolower($string); | |
//remove query string | |
if(preg_match("#^http(s)?://[a-z0-9-_.]+\.[a-z]{2,4}#i",$string)){ | |
$parsed_url = parse_url($string); | |
$string = $parsed_url['host'].' '.$parsed_url['path']; | |
} |
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 | |
global $timedate; | |
$timedate->swap_formats(date('Y-m-d'), $timedate->dbDayFormat, $timedate->get_date_format()); |
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 send_report_email($subject, $body, $emails){ | |
require_once('include/SugarPHPMailer.php'); | |
$emailObj = new Email(); | |
$defaults = $emailObj->getSystemDefaultEmail(); | |
$mail = new SugarPHPMailer(); | |
$mail->setMailerForSystem(); |
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(!defined('sugarEntry'))define('sugarEntry', true); | |
chdir(realpath(dirname(__FILE__))); | |
require_once('include/entryPoint.php'); | |
//Running with SugarCRM | |
//Custom Code Goes below here |
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 | |
class CustomAPI { | |
var $inbound = false; | |
public function __construct(){ | |
$this->inbound = $this->parse_inbound_json(); | |
} | |
public function get_inbound(){ return $this->inbound; } |
OlderNewer