This file contains 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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
This file contains 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
SELECT | |
CASE @@microsoftversion/ 0x01000000 | |
WHEN 6 THEN 'You''ve got to be kidding me.' | |
WHEN 7 THEN 'SQL Server 7.0' | |
WHEN 8 THEN 'SQL Server 2000' | |
WHEN 9 THEN 'SQL Server 2005' | |
WHEN 10 THEN 'SQL Server 2008' | |
WHEN 11 THEN 'SQL Server 2012' | |
WHEN 12 THEN 'Time to update your gist, homey.' | |
END |
This file contains 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 a list of objects sorted by modified date. | |
* Allows you to quickly identify what has been | |
* added or changed. | |
*/ | |
SELECT | |
modify_date, OBJECT_NAME(object_id ) 'Stored Procedure' , * | |
FROM | |
sys.procedures |
This file contains 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
/* | |
* Sort nulls in your result set. | |
*/ | |
SELECT * FROM myTable | |
WHERE ... | |
ORDER BY CASE WHEN myCol IS NULL THEN 1 ELSE 0 END, myCol; |
This file contains 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
' I need to do this frequently and like to be able to easily modify the colors I'm using for the banding. | |
' The following sub makes it very easy: | |
Sub GreenBarMe(rng As range, firstColor As Long, secondColor As Long, Optional borderColor As Long) | |
On Error GoTo AlternateGreenBarMe | |
Application.ScreenUpdating = False | |
rng.Interior.ColorIndex = xlNone |
This file contains 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
Source for starting point: http://css-tricks.com/abbrs-for-web-nerd-acronymns/ | |
See comments at bottom of hyperlinked post for links to WordPress plugins and other good ideas | |
<abbr title="Customer Relationship Management">CRM</abbr> | |
<abbr title="Content Management System">CMS</abbr> | |
<abbr title="Structured Query Language">SQL</abbr> | |
<abbr title="International Organization for Standards">ISO</abbr> | |
<abbr title="PHP: Hypertext Preprocessor">PHP</abbr> | |
<abbr title="HyperText Markup Language">HTML</abbr> | |
<abbr title="eXtensible HyperText Markup Language">XHTML</abbr> |
This file contains 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
-- Source: http://stackoverflow.com/questions/18932/how-can-i-remove-duplicate-rows | |
DELETE MyTable | |
FROM MyTable | |
LEFT OUTER JOIN ( | |
SELECT MIN(RowId) as RowId, Col1, Col2, Col3 | |
FROM MyTable | |
GROUP BY Col1, Col2, Col3 | |
) as KeepRows ON | |
MyTable.RowId = KeepRows.RowId |
This file contains 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
Sub AppendTimeStampToCurrentWorkbook() | |
Dim myName As String | |
Dim newName As String | |
Dim last_dot As Long | |
myName = ActiveWorkbook.fullName | |
' InStrRev finds last occurrence of a string in another | |
last_dot = InStrRev(myName, ".") | |
newName = Left$(myName, last_dot - 1) & " - " & Format$(Now, "MM-DD-YYYY HH.MM AM/PM") & Mid$(myName, last_dot) |
This file contains 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
/* apply a natural box layout model to all elements */ | |
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } |
OlderNewer