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
$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
<? | |
} 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
<? | |
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
<? | |
$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
<? | |
$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
<? | |
/** | |
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) { |
NewerOlder