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
| // dbjdbj@gmail.com | |
| // Based on work by http://github.com/dieseltravis | |
| (function () { | |
| var trimLeft = /^\s+/, trimRight = /\s+$/; | |
| // Verify that \s matches non-breaking spaces (IE fails on this test) | |
| if ( !/\s/.test( "\xA0" ) ) { | |
| trimLeft = /^[\s\xA0]+/; | |
| trimRight = /[\s\xA0]+$/; | |
| } | |
| // Use native String.prototype.trim function wherever possible |
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
| :: use this version when adding an option to Windows's Send To menu | |
| :: https://gist.github.com/dieseltravis/343231 | |
| @echo off | |
| setlocal enabledelayedexpansion | |
| :: use passed in folder | |
| SET folder=%~1 | |
| :: get original png sizes | |
| set oldsize=0 | |
| for %%F in ("%folder%\*.png") do ( set /a oldsize=!oldsize!+%%~zF ) |
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
| //EnhanceJS isIE test idea | |
| //detect IE and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check) | |
| //version arg is for IE version (optional) | |
| //comparison arg supports 'lte', 'gte', etc (optional) | |
| function isIE(version, comparison) { | |
| var cc = 'IE', | |
| b = document.createElement('B'), |
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
| setInterval((function () { | |
| console.log(new Date()); // run some arbitrary code | |
| return arguments.callee; // here be the magic | |
| })(), 1000); | |
| // ^---- and that runs the function, and the return val is assign to the interval |
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
| <!-- Splitting XML/XHTML on a node (HR in this case) --> | |
| <xsl:for-each select="./hr"> | |
| <xsl:variable name="currentPosition" select="position()" /> | |
| <div> | |
| <xsl:if test="$currentPosition = 1"> | |
| <!-- first group of elements --> | |
| <xsl:apply-templates select="preceding-sibling::*" /> | |
| </xsl:if> | |
| <xsl:if test="$currentPosition != 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
| using System; | |
| using System.IO; | |
| using System.Net; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using System.Web; | |
| using System.Web.Caching; | |
| using System.Web.UI; | |
| using System.Web.UI.HtmlControls; | |
| using System.Web.UI.WebControls; |
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 System; | |
| //Microsoft.TeamFoundation.Client.dll | |
| using Microsoft.TeamFoundation.Client; | |
| //Microsoft.TeamFoundation.VersionControl.Client.dll | |
| using Microsoft.TeamFoundation.VersionControl.Client; | |
| namespace GetPendingChanges | |
| { | |
| class Program | |
| { |
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 unique = function(thisArray) { | |
| var a = []; | |
| for (var l = thisArray.length; l--;) { | |
| if(a.indexOf(thisArray[l], 0) < 0) { | |
| a.push(thisArray[l]); | |
| } | |
| } | |
| return a; | |
| }; |
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 pretendClick = function (e) { | |
| if (e) { | |
| var key = e.which || e.keyCode; | |
| if (key && (key === 13 || key === 32)) { | |
| e.preventDefault(); | |
| e.stopImmediatePropagation(); | |
| $(this).trigger("click"); | |
| } | |
| } | |
| }; |
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
| // There's a RadEditor in there somewhere... | |
| using Telerik.Web.UI; | |
| private RadEditor GetRadEditor(Control c) | |
| { | |
| RadEditor re = null; | |
| try | |
| { | |
| re = (RadEditor)c; | |
| } |