把Umbraco user刪掉並且把本來屬於此user的資料(例如audit trail)指向admin(userid 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
DECLARE @versionDate date; | |
SET @versionDate = CONVERT(DATETIME, 11/26/2015, 102); -- delete data older than provide date | |
SELECT nodeId, published, documentUser, versionId, text, releaseDate, expireDate, updateDate, templateId, newest into #tmp | |
FROM cmsDocument WHERE versionID NOT IN | |
(SELECT D.versionId FROM cmsDocument D WHERE D.versionId IN |
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
var find = 'abc'; | |
var re = new RegExp(find, 'g'); | |
str = str.replace(re, ''); |
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 | |
t.NAME AS TableName, | |
s.Name AS SchemaName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB | |
FROM | |
sys.tables t | |
INNER JOIN |
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
# inspire from https://rcmtech.wordpress.com/2010/08/12/powershell-find-files-modified-after-a-certain-date/ | |
dir -File -recurse | Sort-object LastWriteTime -desc | format-table lastwritetime, fullname -autosize | |
# 匯出到檔案 files.txt | |
dir -File -recurse | Sort-object LastWriteTime -desc | format-table lastwritetime, fullname -autosize | out-dir files.txt |
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
# 日期格式是 dd/MM/yyyy HH:mm | |
dir -file -recurse | % { $_.LastWriteTime = '11/19/2015 14:20' } |
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
<Target Name="CopyLinkedContentFiles" BeforeTargets="Build"> | |
<Copy SourceFiles="%(Content.Identity)" | |
DestinationFiles="%(Content.Link)" | |
SkipUnchangedFiles='true' | |
OverwriteReadOnlyFiles='true' | |
Condition="'%(Content.Link)' != ''" /> | |
</Target> |
Example usage
Use like:
console.log(toQueryString({
prop1: 'x',
prop2: {
y: 1,
z: 2