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
| private System.DateTime GetLastDayOfMonth(int intMonth, int intYear) | |
| { | |
| //todo: move to utility class | |
| return DateAndTime.DateSerial(intYear, intMonth + 1, 0); | |
| } | |
| // Quarterly helper functions: | |
| public static int GetQuarter(DateTime originalDate) | |
| { |
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 Shared Function LocalizeUrls(ByVal originalUrl As String, ByVal content As String) As String | |
| ' make image src's and anchor href's absolute in the string _sourceHtml | |
| ' get path for source | |
| Dim siteUri As New Uri(originalUrl) | |
| ' modify img[@src] and a[@href] | |
| Dim sources As MatchCollection = Regex.Matches(content, "(src|href)=([""'])(?!\#|http)([^\2]+?)(\2)", RegexOptions.Compiled Or RegexOptions.CultureInvariant Or RegexOptions.IgnoreCase) | |
| For Each src As Match In sources | |
| Dim attribute As String = src.Groups(1).Value | |
| Dim quote As String = src.Groups(2).Value |
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 querystring(param) { | |
| if (location.search.length > 1) { | |
| var qsArgs = location.search.substring(1, location.search.length).replace(/\+/g, " ").split("&"); | |
| for (var i = 0; i < qsArgs.length; i++) { | |
| var pair = qsArgs[i].split("="); | |
| var key = decodeURIComponent(pair[0]); | |
| if (param == key) { | |
| var value = (pair.length === 2)? decodeURIComponent(pair[1]): key; | |
| return value; | |
| } |
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
| @echo off | |
| Net Start Webclient | |
| robocopy "\\live.sysinternals.com\Tools" "C:\Program Files\SysinternalsSuite" /LEV:0 /Z /XA:H /XF thumbs.db /XO /IT /R:10 /W:10 | |
| Net Stop Webclient | |
| pause |
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
| /* | |
| sample HTML: | |
| <div> | |
| <p class="charStats wordStats"> | |
| <span class="curChars"><strong class="charVal">0</strong> chars</span>, | |
| <span class="curWords"><strong class="wordVal">0</strong> words</span> | |
| </p> | |
| <textarea rows="2" cols="40" class="charCount wordCount"></textarea> | |
| </div> | |
| */ |
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
| Private _searchString As String | |
| Private Function FindSomeObjectById(ByVal o As SomeObject) As Boolean | |
| Dim searchID as Integer = 0 | |
| Integer.TryParse(_searchString, searchID) | |
| Return o.Id = searchID | |
| End Function | |
| 'etc... |
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
| Example usage: | |
| ...in <head>: | |
| <link rel="stylesheet" type="text/css" href="/YuiCompressor.ashx?css=reset,style" /> | |
| ...just before the </body>: | |
| <script type="text/javascript" src="/YuiCompressor.ashx?js=main,someotherscript"></script> | |
| Changelog: | |
| 2010-02-18: Updated to support HTTP compression |
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
| html = html.replace(/[\u0080-\uFFFF]/g, function($0) { | |
| return "&#" + ($0).charCodeAt(0) + ";"; | |
| }); |
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
| // jQuery example that gets/sets text nodes in html | |
| // wrap all direct child text nodes | |
| $html.contents().filter(function() { | |
| //Node.TEXT_NODE === 3 | |
| return (this.nodeType === 3); | |
| }).each(function () { | |
| this.nodeValue = $.trim(this.nodeValue); | |
| if (this.nodeValue.length > 0) { | |
| $(this).wrap("<p></p>"); |
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 nestedListFixer = /(?:<\/li>(?:<\/ol>\s*)+)+(?:<p(?:\sstyle=\"[^\"]+\")?>(?:\s*<span(?:\sstyle=\"[^\"]+\")?>)*(?:(?:&(?:nbsp|\#0*160|x0*A0);)|\s)+(?:<\/span>)*(?:[ivxlcdm]+\.)(?:\s*<span(?:\sstyle=\"[^\"]+\")?>)*(?:(?:&(?:nbsp|\#0*160|x0*A0);)|\s)+(?:<\/span>)*(.*?)(?:<\/span>)*<\/p>\s*)+(?:<ol(?:\sstyle=\"[^\"]+\")?(?:\stype=\"?\w+\"?)?\sstart=\"?\d+\"?>\s*)+/gi; |