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 Sitecore.Data; | |
| using Sitecore.Data.Items; | |
| public static class ItemExtensions | |
| { | |
| public static T GetValueAs<T>(this Item contextItem, ID settingFieldID) | |
| { | |
| return (T)System.Convert.ChangeType(contextItem.Fields[settingFieldID].Value, typeof(T)); | |
| } | |
| } |
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
| UPDATE | |
| [aspnet_Membership] | |
| SET | |
| [Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', | |
| [PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==', | |
| [IsApproved] = '1', | |
| [IsLockedOut] = '0' | |
| WHERE | |
| UserId IN ( | |
| SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\Admin' |
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.Collections.Specialized; | |
| using System.Linq; | |
| using System.Web; | |
| public static class NameValueCollectionExtensions | |
| { | |
| public static string ToQueryString(this NameValueCollection nvc) | |
| { | |
| return string.Join("&", | |
| nvc.AllKeys.Where(key => !string.IsNullOrWhiteSpace(nvc[key])) |
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 | |
| for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" | |
| set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" | |
| set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" | |
| set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%" | |
| set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%" | |
| set "website=Website" | |
| set "backupfolder=%website%_%fullstamp%" |
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 MongoDB Installation | |
| @ECHO OFF | |
| set mongoVersion=3.2 | |
| set mongoServiceName="MongoDB-%mongoVersion%" | |
| set mongoDBFolder=C:\Data\MongoDB\%mongoVersion% | |
| set mongoDBDataFolder=%mongoDBFolder%\Data | |
| set mongoDBLogsFolder=%mongoDBFolder%\Logs | |
| set mongoDBMongoD="C:\Program Files\MongoDB\Server\%mongoVersion%\bin\mongod.exe" |
NewerOlder