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
| // GET: /Monkey/Get/5 | |
| /// <summary>Return Raw JSON</summary> | |
| public ActionResult Get(int id) { | |
| return Json( | |
| new { | |
| Id = id, | |
| Name = "George", | |
| ScientificName = "Simia Curiosa", | |
| Active = "true", | |
| DateCreated = "1343404556" |
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
| // Scroll to top, add extra height to make this possible | |
| $(document).ready(function () { | |
| if (navigator.userAgent.match(/Android/i)) { | |
| window.scrollTo(0, 0); // reset in case prev not scrolled | |
| var nPageH = $(document).height(); | |
| var nViewH = window.outerHeight; | |
| if (nViewH > nPageH) { | |
| nViewH -= 250; | |
| $('body').css('height', nViewH + 'px'); | |
| } |
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
| <!-- Add to the <head> section --> | |
| <style type="text/css"> | |
| .git-ribbon { | |
| background-color: #a00; | |
| overflow: hidden; | |
| /* top left corner */ | |
| position: absolute; | |
| left: -3em; | |
| top: 2.5em; | |
| /* 45 deg ccw rotation */ |
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
| public DateTime FromUnixTime(long unixTime) | |
| { | |
| var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); | |
| return epoch.AddSeconds(unixTime); | |
| } |
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
| <link rel="icon" href="~/images/favicon.png"> | |
| <!--[if IE]> | |
| <link rel="Shortcut Icon" href="~/images/favicon.ico" /> | |
| <![endif]--> |
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
| .Header { | |
| text-align: center; | |
| } |
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
| $(document).ready(function () { | |
| $('.links_wrapper a').hover( | |
| function () { | |
| var hue = Math.floor(Math.random() * 256); | |
| switch (hue % 3) { | |
| case 0: | |
| // orange | |
| $(this).css('background', '#FC9E00'); | |
| break; | |
| case 1: |
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
| protected void Page_PreInit(object sender, EventArgs e) | |
| { | |
| String mobileParam = Request.QueryString["m"] ?? "0"; | |
| if (int.Parse(mobileParam) == 1) | |
| this.MasterPageFile = "mobile master page"; | |
| else | |
| { | |
| string u = Request.ServerVariables["HTTP_USER_AGENT"]; | |
| Regex b = new Regex(@"android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino", RegexOptions.IgnoreCase | RegexOptions.Multiline); |
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
| function reformatImages() { | |
| $(document).ready(function () { | |
| $('#div_content_inner_wrapper img').each(function () { | |
| if ($(this).width() > $('body').width()) { | |
| var newWidth = $('body').width() - 30; | |
| $(this).css('width', newWidth); | |
| } | |
| $(this).css("border", "solid 1px gray"); | |
| $(this).css("padding", "2px"); | |
| }); |
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
| string u = Request.ServerVariables["HTTP_USER_AGENT"]; | |
| Regex b = new Regex(@"android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino", RegexOptions.IgnoreCase | RegexOptions.Multiline); | |
| Regex v = new Regex(@"1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im |