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
$('#pass').keyup(function(e) { | |
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\W).*$", "g"); | |
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); | |
var enoughRegex = new RegExp("(?=.{6,}).*", "g"); | |
if (false == enoughRegex.test($(this).val())) { | |
$('#passstrength').html('More Characters'); | |
} else if (strongRegex.test($(this).val())) { | |
$('#passstrength').className = 'ok'; | |
$('#passstrength').html('Strong!'); | |
} else if (mediumRegex.test($(this).val())) { |
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 checkEmail(emailAddress) { | |
var sQtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]'; | |
var sDtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]'; | |
var sAtom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+'; | |
var sQuotedPair = '\\x5c[\\x00-\\x7f]'; | |
var sDomainLiteral = '\\x5b(' + sDtext + '|' + sQuotedPair + ')*\\x5d'; | |
var sQuotedString = '\\x22(' + sQtext + '|' + sQuotedPair + ')*\\x22'; | |
var sDomain_ref = sAtom; | |
var sSubDomain = '(' + sDomain_ref + '|' + sDomainLiteral + ')'; | |
var sWord = '(' + sAtom + '|' + sQuotedString + ')'; |
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
delete from cmsPreviewXml where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from cmsContentVersion where contentId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from dbo.umbracoRelation where childId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from dbo.umbracoRelation where parentId in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
delete from dbo.umbracoDomains where domainRootStructureID in (select id from umbracoNode where path like '%-20%' and id!=-20) | |
-- delete the X |
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
SELECT migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure_pct ,QUOTENAME(db_name(mid.database_id)) AS [database] | |
,QUOTENAME(OBJECT_SCHEMA_NAME(mid.object_id, mid.database_id)) AS [schema] | |
,QUOTENAME(OBJECT_NAME(mid.object_id, mid.database_id)) AS [table] | |
,'CREATE INDEX [mi_' + SUBSTRING(CONVERT(VARCHAR(64), NEWID()), 1, 8) + ']' + ' ON ' + mid.statement + ' (' + ISNULL(mid.equality_columns, '') + CASE | |
WHEN mid.equality_columns IS NOT NULL | |
AND mid.inequality_columns IS NOT NULL | |
THEN ',' | |
ELSE '' | |
END + ISNULL(mid.inequality_columns, '') + ')' + ISNULL(' INCLUDE (' + mid.included_columns + ')', '') AS create_index_statement | |
,migs.*,mid.database_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></title> | |
<link rel="stylesheet" href="style.css"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> | |
<script src ="script/script.js"></script> | |
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
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 | |
WHILE (@@FETCH_STATUS = 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
public bool SaveCroppedImage(Image image, int maxWidth, int maxHeight, string filePath) | |
{ | |
ImageCodecInfo jpgInfo = ImageCodecInfo.GetImageEncoders() | |
.Where(codecInfo => | |
codecInfo.MimeType == "image/jpeg").First(); | |
Image finalImage = image; | |
System.Drawing.Bitmap bitmap = null; | |
try | |
{ | |
int left = 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
public static string ReportAllProperties<T>(this T instance) where T : class | |
{ | |
if (instance == null) | |
return string.Empty; | |
var strListType = typeof(List<string>); | |
var strArrType = typeof(string[]); | |
var arrayTypes = new[] { strListType, strArrType }; |
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
SELECT ' CREATE ' + | |
CASE | |
WHEN I.is_unique = 1 THEN ' UNIQUE ' | |
ELSE '' | |
END + | |
I.type_desc COLLATE DATABASE_DEFAULT + ' INDEX ' + | |
I.name + ' ON ' + | |
SCHEMA_NAME(T.schema_id) + '.' + T.name + ' ( ' + | |
KeyColumns + ' ) ' + | |
ISNULL(' INCLUDE (' + IncludedColumns + ' ) ', '') + |
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
/* Delete Old Document Versions */ | |
Declare @keepOldVersionsCount int, @keepNewerThanDate datetime | |
Set @keepOldVersionsCount = 0 /* 0 Keeps published and newest only. */ | |
Set @keepNewerThanDate = getdate() /* getDate() or '2013-01-01' */ | |
IF OBJECT_ID('tempdb..#versions') IS NOT NULL DROP TABLE #versions | |
SELECT VersionID, nodeId, updateDate, newest, published INTO #versions |