http://stackoverflow.com/a/26315881 =DATEVALUE(MID(A1,1,10))+TIMEVALUE(MID(A1,12,8))
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
// http://stackoverflow.com/a/77542 | |
System.Collections.IEnumerable collection = Enumerable.Range(100, 10); | |
foreach (var o in collection.OfType<object>().Select((x, i) => new {x, i})) | |
{ | |
Console.WriteLine("{0} {1}", o.i, o.x); | |
} |
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
CREATE FUNCTION [dbo].[Capitalize](@input VARCHAR(MAX)) | |
RETURNS VARCHAR(MAX) | |
AS | |
BEGIN | |
RETURN UPPER(LEFT(@input, 1)) + LOWER(SUBSTRING(@input, 2, LEN(@input))) | |
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
CREATE FUNCTION [dbo].[RegexReplace](@input VARCHAR(MAX), @pattern VARCHAR(MAX), @replacement VARCHAR(MAX)) | |
RETURNS VARCHAR(MAX) | |
AS | |
BEGIN | |
WHILE PATINDEX(@pattern, @input) > 0 | |
SET @input = STUFF(@input, PATINDEX(@pattern, @input), 1, @replacement) | |
RETURN @input | |
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
//https://github.com/jakkaj/Xamling-Core/blob/918a7400583774106d5a9fba82a5f14656d52b06/XamlingCore/XamlingCore.Portable/Data/Mapper/SimpleMapper.cs | |
//From: http://stackoverflow.com/questions/930433/apply-properties-values-from-one-object-to-another-of-the-same-type-automaticall | |
//user: http://stackoverflow.com/users/428886/azerothian | |
//with Modifications for PCL by Jordan Knight. | |
using System; | |
using System.Linq; | |
using System.Reflection; | |
namespace XamlingCore.Portable.Data.Mapper |
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
-- http://stackoverflow.com/a/8439798 | |
DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSOR | |
SET @Cursor = CURSOR FAST_FORWARD FOR | |
SELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + ']' | |
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 | |
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME | |
OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql |
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
// http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html | |
// http://stackoverflow.com/a/20354786 | |
var UTIL = (function (parent, $, undefined) { | |
var my = parent._private = parent._private || {}; | |
my.iframeform = function (url, callback) { | |
var object = this; | |
object.time = new Date().getTime(); | |
object.callback = callback || function (){}; |
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
// Detecting data URLs | |
// data URI - MDN https://developer.mozilla.org/en-US/docs/data_URIs | |
// The "data" URL scheme: http://tools.ietf.org/html/rfc2397 | |
// Valid URL Characters: http://tools.ietf.org/html/rfc2396#section2 | |
function isDataURL(s) { | |
return isDataURL.regex.test(s); | |
} | |
isDataURI.regex = /^\s*data:([a-z]+\/[a-z0-9\-]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Title</title> | |
<!--[if lt IE 9]> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.js"></script> | |
<![endif]--> | |
</head> |