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
| Entry: http://10k.aneventapart.com/Entry/201 | |
| Title: Yahtml | |
| Description: a 5-dice game like Yahtzee, but in html+javascript+css | |
| Browsers: IE9p4, Firefox 3.6, Chrome 6b, Safari 5, iPhone 3G, Nokia E71x | |
| Files: | |
| ~/yahtml/index.html | |
| 10,105 Bytes | |
| ~/yahtml/ya.manifest |
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
| //NOTE: since the string class is sealed, and you can only override existing operators this will not compile | |
| // coalesce strings when they're null or empty (the ?? operator just coalesces on null) | |
| public static string operator ‽‽(string s1, string s2) | |
| { | |
| return string.IsNullOrEmpty(s1) ? s2 : s1; | |
| } | |
| public static string operator ‽(string s1) |
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
| // using jQuery: | |
| $("#<%= ButtonId.ClientID %>").unbind("click").bind("click", function () { | |
| if (someCondition) { | |
| // call postback event: | |
| //__doPostBack(this.id.replace(/\_/, "$"),''); | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| }); |
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
| <p> | |
| <label for="<%= AgreeTerms.ClientID %>"><asp:CheckBox ID="AgreeTerms" runat="server" /> | |
| I agree to the terms.</label> | |
| <asp:CustomValidator id="AgreeTermsValidator" ClientValidationFunction="termsAgreed" CssClass="error" Display="Dynamic" EnableClientScript="true" ErrorMessage="* required" runat="server"></asp:CustomValidator> | |
| </p> | |
| <p><asp:Button ID="SubmitButton" runat="server" Text="Submit Order" CssClass="button" /></p> | |
| <script type="text/javascript">//<![CDATA[ | |
| var termsAgreed = function (source, arguments) { |
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
| var yield = function(file, callback) { | |
| var o = document.createElement('object'); | |
| o.data = file; | |
| o.width = 0; | |
| o.height = 0; | |
| o.onload = function() { | |
| var s = document.createElement('script'); | |
| s.src = file; |
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 static T FindNestedControl<T>(Control controlToSearch, string id) where T: Control | |
| { | |
| T foundControl = null; | |
| bool exceptionThrown = false; | |
| // look directly in the control first | |
| try | |
| { | |
| foundControl = (T)controlToSearch.FindControl(id); | |
| } |
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>javascript exercise #1</title> | |
| <style> | |
| .highlight { background-color: yellow; } | |
| </style> | |
| </head> | |
| <body> |
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
| //javascript: | |
| (function() { | |
| var l = top.location; | |
| top.location = l.href.split(/&?r=/)[0] + (l.search ? '&' : '?') + 'r=' + Math.random(); | |
| })(); |
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
| // SomePage.aspx.cs (ASPX codebehind) function | |
| [System.Web.Services.WebMethod()] | |
| [System.Web.Script.Services.ScriptMethod()] | |
| public static string GetSomeObjects(string id) | |
| { | |
| //TODO: get stuff here | |
| } |
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
| if (window.navigator.standalone !== void(0)) { | |
| $(window).load(function() { | |
| if (!this.navigator.standalone) { | |
| this.setTimeout(function() { this.scrollTo(this.scrollX, this.scrollY + 1); }, 500); | |
| } | |
| }); | |
| } |