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
<? | |
/** | |
Calculates the percentage change between two numbers. | |
Useful for showing how much traffic has changed from one time period to the next. | |
*/ | |
$percentChange = function ($cur, $prev) { |
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
<? | |
$nouns = array( | |
'/film/film' => | |
array( | |
'possessives' => array('directed_by', 'starring') | |
'adjectives' => array('genre') | |
), | |
'/music/album' => array(...) | |
); |
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
<? | |
$url .= '{ "id": "' . $mid . '", "/music/album/artist": [{"mid" : [],"name" : null}], "/music/album/genre": [{}], "/music/album/release_date": null }'; | |
if ($res = ApplicationHelper::rest(array('url' => $url))) { | |
if ($res->result) { | |
$body = json_decode($res->body); | |
$item = (array) $body->result; | |
foreach ($item['/music/album/artist'] as $p) { | |
$poss[] = array('type' => 'Artist', 'mid' => $p->mid[0], 'name' => $p->name); |
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
<? | |
preg_match_all("#[\"|']http://the.squidoocdn.com/(.+[\.v[\d]+]?\.css)[\"|']#", file_get_contents($argv[1]), $css); | |
print_r($css); | |
preg_match_all("#[\"|']http://the.squidoocdn.com/(.+[\.v[\d]+]?\.js)[\"|']#", file_get_contents($argv[1]), $js); | |
print_r($js); |
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
<? | |
} else if ($node['parent']->getProperty('type') == 'meta') { | |
if (in_array($node['parent']->getProperty('parent'), array('Source', 'Original'))) { | |
$parent_mod = Module::getModuleById($node['adjective']->getProperty('title')); | |
$new_stack['title'] = escapeForDisplay($parent_mod->lens_module_title); | |
} | |
$new_stack['url'] = implode('/', array( | |
'stacks', | |
strtolower($this->getNoun(true, $node['parent']->getProperty('parent'))), | |
urlencode(strtolower($node['parent']->getProperty('title'))), |
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
$orig = Portfolio::findOrFail(Input::get('copy_portfolio')); | |
$portfolio = $orig->replicate(); | |
$portfolio->title = Input::get('title'); | |
$portfolio->push(); | |
foreach ($orig->authors as $a) | |
{ | |
$portfolio->authors()->attach($a); | |
} |
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 ($portfolio = DB::transaction(function() { | |
$orig = Portfolio::findOrFail(Input::get('copy_portfolio')); | |
$orig->load('authors', 'audiences', 'editorComment', 'uploads'); | |
$portfolio = $orig->replicate(); | |
$portfolio->title = Input::get('title'); | |
$portfolio->push(); | |
foreach ($orig->authors as $a) |
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
<? | |
/* | |
==== Custom Google Drive Wrapper ==== | |
By: Gil Hildebrand (https://github.com/giltotherescue) | |
Google Drive authentication setup instructions: | |
https://developers.google.com/api-client-library/php/auth/service-accounts |
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 whitelist($parent, $whitelist = null) { | |
global $drive, $shared_folder; | |
if (!$whitelist) { | |
$whitelist = array($parent); | |
} | |
$search = $drive->search("'$parent' in parents"); | |
foreach ($search->files as $file) { |
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
<div class="panel panel-default" style="float: right; width: 45%"> | |
<div class="panel-heading">Unavailable</div> | |
<div class="panel-body"> | |
<ul style="font-size:12px;color:#666666;list-style:disc;"> | |
<li>Means you match the criteria for this character, and are interested in being booked for it, but you are unavailable for the shooting date(s).</li> | |
<li>You may be notified if the shooting date(s) for this character change.</li> | |
<li>Will NOT exclude you from any other casting requests.</li> | |
<li>Will NOT mark your calendar as UNAVAILABLE.</li> | |
<li>You WILL still receive casting notifications for other jobs on the date(s) above.</li> | |
</ul> |
OlderNewer