Skip to content

Instantly share code, notes, and snippets.

View giltotherescue's full-sized avatar

Gil Hildebrand giltotherescue

View GitHub Profile
$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);
}
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)
<?
/*
==== 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
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) {
@giltotherescue
giltotherescue / freebase.php
Created May 22, 2012 21:59
Search freebase
<?
$nouns = array(
'/film/film' =>
array(
'possessives' => array('directed_by', 'starring')
'adjectives' => array('genre')
),
'/music/album' => array(...)
);
<?
$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);
@giltotherescue
giltotherescue / casting_notices.php
Created December 2, 2015 19:56
explanation text
<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>
<?
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);
@giltotherescue
giltotherescue / hullagraph.php
Created January 28, 2013 19:18
Replace line 448 and below with this code if you want to rename the Source and Original stacks based on the title of the parent postcard.
<?
} 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'))),
When it comes to your goals and aspirations in the areas of physique alteration, sports performance, and health, it is very important to target your time and efforts doing what works, and avoid doing what doesn’t. You care too much about your appearance, health, and performance to settle for a suboptimal product.
Renaissance Periodization was founded with the understanding that science is the surest path to the truth, and in this field, to results. Our approach is the rigorous application of scientific principles to nutrition and training. Everything we do is built on a foundation of peer-reviewed literature and experimentally-confirmed theory.
At Renaissance, formulas, calculations, and literature reviews replace gurus, hunches, and attachments to tradition.
We know what works and we want to help you reach your goals.