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
BEGIN TRAN | |
DECLARE @Nodes TABLE (NodeId int) | |
INSERT INTO @Nodes (NodeId) | |
SELECT top 1000 n.id | |
FROM cmsContent C | |
INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId | |
INNER JOIN umbracoNode N ON C.nodeId = N.id | |
WHERE CT.alias = '[Your Document Type Alias Here]' |
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
DECLARE @S varchar(max) = '' | |
SELECT @S = @S + ' | |
' + [YourField] FROM [YourTable] | |
SELECT @S AS [Data] FOR XML PATH('') |
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
// Set for any request | |
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US"); | |
// Set only if within Umbraco editor | |
if (Request.RawUrl.Contains("macroResultWrapper") || Request.RawUrl.Contains("GetMacroResultAsHtmlForEditor")) | |
{ | |
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US"); | |
} |
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-website | select name,id,state,physicalpath, | |
@{n="Bindings"; e= { ($_.bindings | select -expa collection) -join ';' }} , | |
@{n="LogFile";e={ $_.logfile | select -expa directory}}, | |
@{n="attributes"; e={($_.attributes | % { $_.name + "=" + $_.value }) -join ';' }} | | |
Export-Csv -NoTypeInformation -Path d:\my_list.csv |
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
var enumerateMe = originalList.Select((item, index) => new { Position = index, Item = item }); |
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
var names = name.Trim().Split(new[] { ' ' }, 2); | |
string firstName; | |
string lastName; | |
if (names.Length == 1) | |
{ | |
firstName = String.Empty; | |
lastName = names[0]; | |
} | |
else |
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
HttpWebRequest request = WebRequest.Create(i_Uri) as HttpWebRequest; | |
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate"); | |
response = request.GetResponse() as HttpWebResponse; | |
If(response.Headers.ToString().IndexOf("gzip") != -1) | |
{ | |
//unzip; | |
} | |
private static void DecompressGzipStream(Stream i_GzipStream) |
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 TOP 100 | |
* | |
FROM | |
uCommerce_CampaignItem ci | |
LEFT JOIN uCommerce_Target t ON ci.CampaignItemId = t.CampaignItemId | |
LEFT JOIN uCommerce_VoucherTarget vt ON t.TargetId = vt.VoucherTargetId | |
LEFT JOIN uCommerce_ProductTarget pt ON t.TargetId = pt.ProductTargetId | |
WHERE | |
ci.Name = 'Campaign Item Name' |
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
FROM [TableX] | |
ORDER BY [FieldX] | |
OFFSET 501 ROWS | |
FETCH NEXT 100 ROWS ONLY |
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
forfiles -p "< Path To Folder >" -s -m *.* /D -< Number of days ago > /C "cmd /c del @path" |
OlderNewer