This file contains hidden or 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
case ($invoice->hasSilverMembership() && $invoice->hasSpouseProduct()) : | |
$content_name = 'Silver + Spouse'; | |
$value = 194; | |
break; | |
case ($invoice->hasGoldMembership() && $invoice->hasSpouseProduct()) : | |
$content_name = 'Gold + Spouse'; | |
$value = 294; | |
break; | |
case ($invoice->hasPlatinumMembership() && $invoice->hasSpouseProduct()) : | |
$content_name = 'Platinum + Spouse'; |
This file contains hidden or 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
// You should be using MAMP (not pro) as your local server. Set up wildcard virtual hosts in MAMP. Put the following in | |
/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf | |
<Virtualhost *:80> | |
VirtualDocumentRoot "/Users/[username]/Sites/%1/" | |
ServerName vhosts.[username].dev | |
ServerAlias *.[username].dev | |
UseCanonicalName Off | |
<Directory "/Users/[username]/Sites/*"> |
This file contains hidden or 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 hidden or 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
// To Dev (replace jmayhak w/ your dev name) | |
javascript:(function()%7Bvar%20url=location.host;if(url.indexOf('staging')!==-1)%7Bwindow.location=location.protocol+'//'+url.replace('.staging.corp.sb03.com','.jmayhak.dev.corp.sb03.com')+location.pathname;%7Dif(url.indexOf('dev')==-1&&url.indexOf('staging')==-1)%7Bwindow.location=location.protocol+'//'+location.host+'.jmayhak.dev.corp.sb03.com'+location.pathname;%7D%7D)(); | |
// To Staging | |
javascript:(function()%7Bvar%20url=location.host;if(url.indexOf('staging')==-1&&url.indexOf('dev')==-1)%7Bwindow.location=location.protocol+'//'+url+'.staging.corp.sb03.com'+location.pathname;%7Dif(url.indexOf('dev')!==-1)%7Bwindow.location=location.protocol+'//'+url.replace(/%5C.com%5C.%5Cw+%5C.dev/,'.com.staging')+location.pathname;%7D%7D)(); | |
// To Production | |
javascript:(function()%7Bvar%20url=location.host;if(url.indexOf('staging')!==-1)%7Bwindow.location=location.protocol+'//'+url.replace('.staging.corp.sb03.com','')+location.pathname;%7Dif(url.indexOf('dev')!==-1)%7Bwindow. |
This file contains hidden or 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
PFObject *myPost = [PFObject objectWithClassName:@"Post"]; | |
[myPost setObject:@"I'm Hungry" forKey:@"title"]; | |
[myPost setObject:@"Where should we go for lunch?" forKey:@"content"]; | |
// Create the comment | |
PFObject *myComment = [PFObject objectWithClassName:@"Comment"]; | |
[myComment setObject:@"Let's do Sushirrito." forKey:@"content"]; | |
// Add a relation between the Post and Comment | |
[myComment setObject:myPost forKey:@"parent"]; |
This file contains hidden or 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('GENDER_MALE', 'm'); | |
define('GENDER_MALE_FULL', 'male'); | |
define('GENDER_FEMALE', 'f'); | |
define('GENDER_FEMALE_FULL', 'female'); | |
define('GENDER_UNKNOWN', 'u'); | |
define('GENDER_UNKNOWN_FULL', 'unknown'); | |
function isValidGender($gender) |
This file contains hidden or 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 | |
namespace EFNEP\Controllers; | |
class UserApi extends Api | |
{ | |
/** | |
* Sets the url and data and tells Walleye what the handlers accept | |
* | |
* @param array $url |
This file contains hidden or 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 | |
/** | |
* Implodes an array full of arrays based on the passed key that is in each element of the array | |
* by the passed delimiter | |
* | |
* implode_key(',', array(array('title'=>'jonathan'), array('title'=>'justin')), 'title') | |
* // will return "jonathan,justin" | |
* | |
* @param string $delimiter |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
// NOTE: create a folder for each metric. ./ActiveUsers and ./NewUsers and etc | |
$appMetrics = array('ActiveUsers', 'NewUsers', 'MedianSessionLength', 'AvgSessionLength', 'Sessions', 'RetainedUsers'); | |
// define your platforms as listed in Flurry | |
$platforms = array(); |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
$string = file_get_contents(dirname(__FILE__) . '/efnep_global_dev_2011-05-26.sql'); | |
preg_match_all('/CREATE TABLE `(\w*)` \(\s( `(\w*)` .*\s)*/', $string, $matches); | |
$matches_sql = $matches[0]; | |
$php_code = ''; | |
$drop_coe = ''; |
NewerOlder