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
/// <summary> | |
/// Calculates number of business days, taking into account: | |
/// - weekends (Saturdays and Sundays) | |
/// - bank holidays in the middle of the week | |
/// </summary> | |
/// <param name="firstDay">First day in the time interval</param> | |
/// <param name="lastDay">Last day in the time interval</param> | |
/// <param name="bankHolidays">List of bank holidays excluding weekends</param> | |
/// <returns>Number of business days during the 'span'</returns> | |
public static int BusinessDaysUntil(this DateTime firstDay, DateTime lastDay, params DateTime[] bankHolidays) |
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
USE MarkerTechV2CMS | |
GO | |
WITH Fields | |
AS | |
( | |
SELECT | |
pd.ProductDefinitionId [ChildDefinitionID] | |
, pd.ProductDefinitionId | |
, pd.Name AS [ProductDefinitionName] |
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 Compress-Subfolders | |
{ | |
param | |
( | |
[Parameter(Mandatory = $true)][string] $InputFolder, | |
[Parameter(Mandatory = $true)][string] $OutputFolder | |
) | |
if (-not (test-path "$env:ProgramFiles\7-Zip\7z.exe")) {throw "$env:ProgramFiles\7-Zip\7z.exe needed"} | |
set-alias sz "$env:ProgramFiles\7-Zip\7z.exe" | |
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
$getFirstLine = $true;get-childItem "*.csv" | foreach {$filePath = $_;$lines = $lines = Get-Content $filePath;$linesToWrite = switch($getFirstLine) {$true {$lines}; $false {$lines | Select -Skip 1}};$getFirstLine = $false;Add-Content "combined.csv" $linesToWrite;} |
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 |
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
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
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
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
$sourceFolder = "C:\" | |
$targetFolder = "C:\" | |
$regnos = @( | |
"regno" | |
) | |
Write-Host "Folder: $sourceFolder" | |
$folderFiles = Get-ChildItem -Path $sourceFolder -Filter *.jpg -Recurse -File -Name | |
foreach ($r in $regnos) |