Created
March 1, 2018 04:23
-
-
Save cnromaine/bd8a85059d41e652fc3079e6f8b75efd to your computer and use it in GitHub Desktop.
Run Embedded C# Pad on a web page
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Embedded C# Pad code example</title> | |
</head> | |
<body> | |
<pre> | |
<code class="codepad language-csharp" data-codepad="theme:cobalt" style="width:100%;height:400px;" >// | |
// This program shows how long ago C# Pad (http://www.csharppad.com) was released. | |
// This source: http://jsbin.com/pukabidogi/edit?html,output | |
var releaseDate = new DateTime(2014, 2, 26, 6, 15, 0, DateTimeKind.Utc); | |
var span = DateTime.UtcNow - releaseDate; | |
Console.WriteLine(""); | |
Console.WriteLine("It's been {0} years, {1} months, {2} days, {3} hours, {4} minutes, {5} seconds since C# Pad was released!", | |
Math.Floor(span.Days / 365.25f), Math.Floor((span.Days % 365.25f) / 30f), (span.Days % 365.25f) % 30f, span.Hours, span.Minutes, span.Seconds ) | |
</code> | |
</pre> | |
<script src="//csharppad.com/embed.js"></script> | |
<script type="text/javascript"> Codepad.all(); </script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment