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 | |
| substring(Url, | |
| (case when charindex('//', Url)= 0 then 1 else CHARINDEX('//', Url) + 2 end), | |
| case | |
| when charindex('/', Url, charindex('//', Url) + 2) > 0 then charindex('/', Url, charindex('//', Url) + 2) - (case when charindex('//', Url)= 0 then 1 else charindex('//', Url) + 2 end) | |
| when charindex('?', Url, charindex('//', Url) + 2) > 0 then charindex('?', Url, charindex('//', Url) + 2) - (case when charindex('//', Url)= 0 then 1 else charindex('//', Url) + 2 end) |
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 | |
| c.name [Column Name], | |
| CONCAT( | |
| t.name, | |
| CASE | |
| WHEN t.name IN ('char', 'varchar','nchar','nvarchar') THEN | |
| CONCAT('(', IIF(c.max_length=-1, 'MAX', CONVERT(VARCHAR(4),IIF(t.name IN ('nchar','nvarchar'), c.max_length/2, c.max_length))), ')') | |
| WHEN t.name IN ('decimal','numeric') THEN | |
| CONCAT('(', CONVERT(VARCHAR(4),c.precision), ',', CONVERT(VARCHAR(4),c.Scale)+')') | |
| ELSE '' |
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 n.id, n.text, n.createDate, c.contentTypeId, FORMAT(CAST(pd.varcharValue AS DECIMAL(18,2)) / 1024 / 1024, '0.00') AS [FileSizeMB], CONCAT('https://wc.uat.sitedr.co.uk/umbraco#/media/media/edit/', n.id) | |
| FROM umbracoNode n left JOIN umbracoContent c ON n.id = c.nodeId LEFT JOIN umbracoContentVersion cv ON c.nodeId = cv.nodeId LEFT JOIN umbracoPropertyData pd ON cv.id = pd.versionId AND pd.propertyTypeId=9 | |
| where c.contentTypeId=1032 AND cv.[current]=1 | |
| ORDER BY CAST(pd.varcharValue AS BIGINT) DESC |
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 @results table | |
| ( | |
| ID varchar(36), | |
| TableName varchar(250), | |
| ColumnName varchar(250), | |
| DataType varchar(250), | |
| MaxLength varchar(250), | |
| Longest varchar(250), | |
| SQLText varchar(250) | |
| ) |
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
| $sourceFolder = "C:\" | |
| $targetFolder = "C:\" | |
| $regnos = @( | |
| "regno" | |
| ) | |
| Write-Host "Folder: $sourceFolder" | |
| $folderFiles = Get-ChildItem -Path $sourceFolder -Filter *.jpg -Recurse -File -Name | |
| foreach ($r in $regnos) |
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 @cols AS NVARCHAR(MAX), @nullLessCols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX); | |
| SET @cols = STUFF(( | |
| SELECT ',' + QUOTENAME(pdf.Name) | |
| FROM uCommerce_ProductDefinitionField AS pdf | |
| WHERE pdf.Deleted=0 | |
| ORDER BY pdf.SortOrder | |
| FOR XML PATH(''), TYPE | |
| ).value('.', 'NVARCHAR(MAX)'),1,1,'') |
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
| anus | |
| arse | |
| arsehole | |
| ass | |
| ass-hat | |
| ass-jabber | |
| ass-pirate | |
| assbag | |
| assbandit | |
| assbanger |
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
| Import-Module WebAdministration | |
| foreach ($webapp in Get-ChildItem -Path IIS:\AppPools\) | |
| { | |
| $name = "IIS:\AppPools\" + $webapp.name | |
| $item = $item = Get-Item $name | Select -ExpandProperty enable32BitAppOnWin64 | |
| if ($webapp.enable32BitAppOnWin64 -ne 'True') | |
| { | |
| Set-ItemProperty -Path $name -Name enable32BitAppOnWin64 -Value True | |
| Write-Host "$name updated to enable 32bit" -ForegroundColor Yellow |
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
| $file_list = Get-Content "C:\files.txt" | |
| $search_folder = "C:\from" | |
| $destination_folder = "C:\to" | |
| foreach ($file in $file_list) { $file_to_move = Get-ChildItem -Path $search_folder -Filter $file -Recurse -ErrorAction SilentlyContinue -Force | % { $_.FullName};if ($file_to_move) { Move-Item $file_to_move $destination_folder; } } |
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
| Get-WebBinding | % { | |
| $name = $_.ItemXPath -replace '(?:.*?)name=''([^'']*)(?:.*)', '$1' | |
| New-Object psobject -Property @{ | |
| Name = $name | |
| Binding = $_.bindinginformation.Split(":")[-1] | |
| } | |
| } | Group-Object -Property Name | | |
| Format-Table Name, @{n="Bindings";e={$_.Group.Binding -join "`n"}} -Wrap |
NewerOlder