Created
July 9, 2017 01:00
-
-
Save justinhartman/6969d9c80b71d0c353bc69554f2dcd59 to your computer and use it in GitHub Desktop.
This is to be used to demonstrate how you embed Gists into your Github Pages website using Jekyll
This file contains hidden or 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
{ | |
"name": ".publish", | |
"path": ".publish", | |
"sha": "3f949857e8ed4cb106f9744e40b638a7aabf647f", | |
"size": 9, | |
"url": "https://api.github.com/repos/justinhartman/howto/contents/.publish?ref=master", | |
"html_url": "https://github.com/justinhartman/howto/blob/master/.publish", | |
"git_url": "https://api.github.com/repos/justinhartman/howto/git/blobs/3f949857e8ed4cb106f9744e40b638a7aabf647f", | |
"download_url": "https://raw.githubusercontent.com/justinhartman/howto/master/.publish", | |
"type": "file", | |
"content": "LnB1Ymxpc2gK\n", | |
"encoding": "base64", | |
"_links": { | |
"self": "https://api.github.com/repos/justinhartman/howto/contents/.publish?ref=master", | |
"git": "https://api.github.com/repos/justinhartman/howto/git/blobs/3f949857e8ed4cb106f9744e40b638a7aabf647f", | |
"html": "https://github.com/justinhartman/howto/blob/master/.publish" | |
} | |
} |
This file contains hidden or 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
<?php | |
/* | |
Ensure that the $age variable is set to null before running the myLife function. | |
*/ | |
$age = nil | |
/** | |
* This function returns a message to the user telling them how old they are. | |
* | |
* @param [int] $age Requires an integer value as an input. | |
* @return [string] Returns a message to the user displaying the input value. | |
* @author Justin Hartman <[email protected]> | |
* @copyright Copyright 2017 Justin Hartman. All rights reserved. | |
* @category Users | |
* | |
*/ | |
function myLife($age) { | |
if (isset($age) && is_int($age)) { | |
echo "You are ".$age." years old." | |
} elseif (!isset($age)) { | |
echo "Please enter your age silly! We'd really like to get to know you better."; | |
} elseif (!is_int($age)) { | |
echo "Hmm, you won't believe this but I can't read your age. Tip, only use numbers when entering your age - e.g. 22."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment