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
+-----+------------------------+----------+ | |
| iid | title | count(*) | | |
+-----+------------------------+----------+ | |
| 10 | Los Angeles | 2 | | |
| 7 | Programming | 1 | | |
| 14 | New York City | 1 | | |
| 27 | Farmville | 1 | | |
| 34 | Facebook | 1 | | |
| 49 | University of Maryland | 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
<? | |
// Creates a mysqldump and emails the resulting dump file | |
// Edit the following values | |
$dbhost = "DBHOST"; // usually localhost | |
$dbuser = "DBUSER"; | |
$dbpass = "DBPASS"; | |
$dbname = "DBNAME"; | |
$sendTo = "[email protected]"; | |
$sendToName = "SEND_TO_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
0 2 * * * curl -O temp http://www.mysite.com/path/to/mysqlbackup/backup.php |
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 100 interest recommendations from Directed Edge | |
$de = new DirectedEdgeRest(); | |
$item = "user".$uid; | |
$limit = 100; | |
$tags = "interest"; | |
$recommendedInterests = $de->getRecommended($item, $tags, $limit); | |
$recommendedInterestsCount = count($recommendedInterests); | |
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($_SESSION['last_directed_edge_request'] < time() - 600) { | |
// Get 100 interest recommendations from Directed Edge | |
$de = new DirectedEdgeRest(); | |
$item = "user".$uid; | |
$limit = 100; | |
$tags = "interest"; | |
$recommendedInterests = $de->getRecommended($item, $tags, $limit); | |
$recommendedInterestsCount = count($recommendedInterests); |
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
class DirectedEdgeRest | |
{ | |
/** | |
* Gets multiple simultaneous recommendations from Directed Edge | |
* @param array $queryArray Array of the form array(0 => (array('item' => (string) $item, 'tags' => (string) $tags, 'limit' => (int) $limit)) | |
* | |
* @return array Multi-dimensional array containing responses to | |
* queries in the order they were passed in the array | |
*/ | |
public function getMultiRecommended($queryArray) |
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
public function notifyAdviceGiverOfComment($uid, $aid, $cid, $body) | |
{ | |
$advice = new Advice(); | |
$adviceArray = $advice->getAdvice($aid); | |
$usersArray = array(array("first_name" => $adviceArray['first_name'], "last_name" => $adviceArray['last_name'], "email" => $adviceArray['email'])); | |
// Return true if the commenter and adviceer are the same | |
// ... we don't want to send an email | |
if($uid == $adviceArray['uid']) { |
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
<select> | |
<option>Select your timezone...</option> | |
<option value="376">[UTC-12] Niue Time</option> | |
<option value="376">[UTC-12] Samoa Standard Time</option> | |
<option value="52">[UTC-11] Hawaii-Aleutian Standard Time</option> | |
<option value="52">[UTC-11] Cook Island Time</option> | |
<option value="375">[UTC-9:30] Marquesas Islands Time</option> | |
<option value="53">[UTC-9] Alaska Standard Time</option> | |
<option value="53">[UTC-9] Gambier Island Time</option> | |
<option value="129">[UTC-8] Pacific Standard Time</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
/* | |
Return URL for validation and making pay requests | |
array | |
'signature' => string 'lyOR0dvgfv0nW36/LExYn58/J4FNZRqqkzXNwjezm80VTbTCjtRcbs0HNbTI/uhMTybjblnWn5Az | |
USaPYErzoazPP7CNAfjT4mKKzxRwUAukvRL70+tMyHiGwwM1O6mAW0/hM/RiTafSx8TzC5UIvKq1 | |
1H07ndhTp0m/7qETZ4w=' (length=174) | |
'expiry' => string '06/2016' (length=7) | |
'signatureVersion' => string '2' (length=1) | |
'signatureMethod' => string 'RSA-SHA1' (length=8) |
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 | |
require_once(str_replace('//','/',dirname(__FILE__).'/') .'../models/UsersFacebookStore.php'); | |
require_once(str_replace('//','/',dirname(__FILE__).'/') .'../controllers/UsersGoal.php'); | |
require_once(str_replace('//','/',dirname(__FILE__).'/') .'../controllers/User.class.php'); | |
require_once(str_replace('//','/',dirname(__FILE__).'/') .'../helpers/URL.php'); | |
/** | |
* @owner Josh Smith <[email protected]> | |
* |