Skip to content

Instantly share code, notes, and snippets.

@alex-cory
Last active August 29, 2015 14:03
Show Gist options
  • Save alex-cory/3e0a922a3a541e25b67d to your computer and use it in GitHub Desktop.
Save alex-cory/3e0a922a3a541e25b67d to your computer and use it in GitHub Desktop.
<?php
# Display errors in production mode
ini_set('display_errors', '0');
error_reporting(E_ALL & E_ERROR);
ini_set('display_errors', 1);
?>
<!DOCTYPE html>
<html lang="en">
<head> ...
<!--==== Bio ====-->
<?php require './views/bio/bio.php' ?>
<!--==== Work ====-->
<?php require './views/work/work.php'; ?> <!-- KEEPS BREAKING HERE!! -->
<!--==== Blog ====-->
<?php require './views/blog/blog.php'; ?>
<!--==== Contact ====-->
<?php require './views/contact/contact.php'; ?>
<!--==== End of Visual Body ====-->
</body>
</html>
<?php
function getAllRepositories($username)
{
// This file is generated by Composer
if (file_exists('./vendor/autoload.php')) {
// die('apparently the file exists'); // IT MAKES IT HERE
require "./vendor/autoload.php";
$client = new \Github\Client();
$repositories = $client->api('user')->repositories($username);
return $repositories;
} else {
return 'Something went wrong. Check the file path.';
}
}
// $github = new GithubModel;
$repositories = getAllRepositories('alex-cory');
# For Debugging Purposes
// $repositories = array(
// array(
// "name" => "value1",
// "html_url" => "value2"
// )
// );
?>
<!--==== Work Content ====-->
<section class="container content-section">
<div class="row">
<?php // Thumbnail Hover without Javascript (resource: http://goo.gl/5Jpg09) ?>
<?php foreach ($repositories as $repository): ?>
<div class="col-xs-6 col-sm-4 col-md-3">
<div id="wrap" class="thumbnail2 wrap text-center">
<div class="thumbnail2">
<div class="thumbnail">
<a href="#myModal">
<div class="caption">
<h4><?php echo $repository['name']; ?></h4>
<p>short thumbnail description</p>
<br>
<!-- </button> -->
<!-- <p><a href="" class="label label-danger">Zoom</a>
<a href="" class="label label-default">Download</a></p> -->
<!-- End MODAL HERE -->
</div>
</a>
<img src="http://lorempixel.com/400/300/sports/4/" alt="...">
</div>
<div class="panel-footer text-center">
<a href="<?php echo $repository['html_url']; ?>/archive/master.zip"><span class="glyphicon glyphicon-download"></span></a>
<a href="<?php echo $repository['html_url']; ?>"><span class="fa fa-github"></span></a>
<a href="#live_preview"><span class="fa fa-play-circle-o"></span></a>
<a href="mailto:?subject=Found%20our%20next%20software%20engineer&body=Check%20out%20this%20sweet%20project%20he%20did%21%20Yep...%20We%27re%20totally%20hiring%20him.%20
<?php echo $repository['html_url']; ?>"><span class="glyphicon glyphicon-share-alt"></span></a>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="m-top-10">
<div class="panel-image text-center">
<img src="http://666a658c624a3c03a6b2-25cda059d975d2f318c03e90bcf17c40.r92.cf1.rackcdn.com/unsplash_52d09387ae003_1.JPG" class="panel-image-preview" />
<label for="toggle-1"></label>
<div class="panel-footer footer-cool text-center">
<a href="<?php echo $repository['html_url']; ?>/archive/master.zip">
<span class="glyphicon glyphicon-download"></span>
<span class="modal-subtext">Download</span>
</a>
<a href="<?php echo $repository['html_url']; ?>">
<span class="fa fa-github"></span>
<span class="strong modal-subtext">Github</span>
</a>
<a href="#live_preview">
<span class="fa fa-play-circle-o"></span>
<span class="modal-subtext">Live Demo</span>
</a>
<a href="#share">
<span class="glyphicon glyphicon-share-alt"></span>
<span class="modal-subtext">Share</span>
</a>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment