Created
July 27, 2017 22:48
-
-
Save DanielCordell/a993c3d263e8b546be065aa027a36a23 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/> | |
<link type="text/css" rel="stylesheet" href="css/main.css"/> | |
<link type="text/css" rel="stylesheet" href="css/devicon.css"/> | |
<link type="text/css" rel="stylesheet" href="css/font-awesome.min.css"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
<meta name="theme-color" content="#8c9eff"> | |
<title>Daniel Cordell</title> | |
</head> | |
<body> | |
<header> | |
<div class = "navbar-fixed"> | |
<nav> | |
<div class="nav-wrapper indigo"> | |
<a href="#" data-activates="mobilenav" class="button-collapse"><i class="material-icons">menu</i></a> | |
<ul class="hide-on-med-and-down"> | |
<li><a href="/">About Me</a></li> | |
<li><a href="/Skills">Skills</a></li> | |
<li><a href="/Portfolio">Portfolio</a></li> | |
<li><a href="/CV.docx">CV</a></li> | |
</ul> | |
</div> | |
</nav> | |
</div> | |
<ul class="side-nav" id="mobilenav"> | |
<li><a href="/">About Me</a></li> | |
<li><a href="/Skills">Skills</a></li> | |
<li><a href="/Portfolio">Portfolio</a></li> | |
<li><a href="/CV.docx">CV</a></li> | |
</ul> | |
</header> | |
<main> | |
<div class = "container"> | |
<div class = "row section maintext"> | |
<div class = "col s12 l6"> | |
<div class="card-panel small indigo accent-1 center-align"> | |
<div class="card-title white-text">I'm <strong>Daniel Cordell</strong>, a <strong>Programmer</strong> and <strong>Computer Scientist</strong> currently studying at the University of Nottingham.</div> | |
</div> | |
</div> | |
<div class = "col s12 l6"> | |
<div class="card-panel small indigo accent-1 center-align white-text"> | |
<div class = "card-title titletext">I enjoy working on my own projects in my free time.</div> | |
<div class = "card-content"> | |
<?php | |
$ch = curl_init(); | |
curl_setopt($ch,CURLOPT_URL,"https://api.github.com/users/danielcordell/repos"); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,200); | |
curl_setopt($ch,CURLOPT_TIMEOUT, 200); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array( | |
"method" => "GET", | |
"Content-Type: application/json", | |
"User-Agent: danielcordell" | |
)); | |
$response = curl_exec($ch); | |
$obj = json_decode($response, true); | |
$result = array(); | |
foreach($obj as $val){ | |
$language = $val["language"]; | |
if (!isset($result[$language])){ | |
$result[$language] = 0; | |
} | |
$result[$language] += 1; | |
} | |
?> | |
<div class="left-align container"> | |
<?php | |
$iconified = [ | |
"c++" => "cplusplus", | |
"c#" => "csharp", | |
]; | |
function iconify($language){ | |
global $iconified; | |
$language = strtolower($language); | |
return isset($iconified[$language]) ? $iconified[$language] : $language; | |
} | |
foreach($result as $key=>$value){ | |
$project = $value == 1 ? " project" : " projects"; | |
echo nl2br("<div class = 'row button'><a class = 'col s12 btn waves-effect waves-light indigo' href = 'https://github.com/search?q=" . urlencode("user:danielcordell") . "+" . urlencode("language:" . $key) . "'><div class = 'row button'><i class='col s2 devicon devicon-". iconify($key) ."-plain'></i><div class = 'col s8'>" . $value . " " . $key . $project . "</div></div></a></div>"); | |
} | |
?> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="divider"></div> | |
</div> | |
</main> | |
<footer class="page-footer indigo center-align" content="width=device-width, initial-scale=1"> | |
<div class="container row"> | |
<div class="col l3 m3 s4 push-s2"><a href="https://twitter.com/CrdlPls"><i class="fa fa-twitter icon fa-4x" aria-hidden="true"></i></a></div> | |
<div class="col l3 m3 s6 push-s1"><a href="https://www.facebook.com/danbcordell"><i class="fa fa-facebook icon fa-4x" aria-hidden="true"></i></a></div> | |
<div class="col l3 m3 s4 push-s2"><a href="https://github.com/DanielCordell"><i class="fa fa-github icon fa-4x" aria-hidden="true"></i></a></div> | |
<div class="col l3 m3 s4 push-s2"><a href="mailto:danielbc@hotmail.co.uk"><i class="fa fa-envelope icon fa-4x" aria-hidden="true"></i></a></div> | |
</div> | |
</footer> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.js"></script> | |
<script type="text/javascript" src="js/materialize.js"></script> | |
<script type="text/javascript" src="js/nav.js"></script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment