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 @count = SUM(p.rows) | |
FROM sys.partitions AS p | |
INNER JOIN sys.tables AS t | |
ON p.[object_id] = t.[object_id] | |
INNER JOIN sys.schemas AS s | |
ON t.[schema_id] = s.[schema_id] | |
WHERE p.index_id IN (0,1) -- heap or clustered index | |
AND t.name = N'tablename' | |
AND s.name = N'dbo'; |
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
function Disable-IEESC | |
{ | |
$AdminKey = “HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}” | |
Set-ItemProperty -Path $AdminKey -Name “IsInstalled” -Value 0 | |
$UserKey = “HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}” | |
Set-ItemProperty -Path $UserKey -Name “IsInstalled” -Value 0 | |
Stop-Process -Name Explorer | |
Write-Host “IE Enhanced Security Configuration (ESC) has been disabled.” -ForegroundColor Green | |
} | |
Disable-IEESC |
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
public static IEnumerable<TAggregate> InParallel<TSource, TAggregate>( | |
this IEnumerable<TSource> source, | |
Func<TSource, Task<IEnumerable<TAggregate>>> parallelTask) => | |
InParallel(source, parallelTask, k => k); | |
public static IEnumerable<TAggregate> InParallel<TSource, TAggregate, TKey>( | |
this IEnumerable<TSource> source, | |
Func<TSource, Task<IEnumerable<TAggregate>>> parallelTask, | |
Func<TSource,TKey> keySelector) |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowViewAccountInfo", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:ListVirtualMFADevices", | |
"iam:GetAccountPasswordPolicy" | |
], |
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
showCurrency(value: number, precision: number, seperator: string, decimalSeperator: string): string { | |
const stringValue = `${value || 0}` | |
const parts = stringValue.split('.') | |
let numeric = `${parts[0]}` | |
if (seperator) numeric = numeric.replace(/(\d)(?=(\d{3})+(?!\d))/g, `$1${seperator}`) | |
let decimal = `${parts[1] || 0}` | |
if (precision > 0) decimal = decimal.padEnd(precision, '0') | |
decimalSeperator = decimalSeperator || '.' | |
return `${numeric}${decimalSeperator}${decimal}` | |
} |
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
interface Declaration { | |
transforms: { [key: string]: (ctx: any) => void } | |
asyncs: { [key: string]: (ctx: any) => Promise<void> } | |
middlewares: { (ctx: any): void }[] | |
context: { [key: string]: (config: any) => ((state: any) => any) } | |
state: any | |
} | |
export default <Declaration>{ | |
transforms: { |
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
public class Client | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public int Amount { get; set; } | |
} | |
public class Repository |
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
public class Client | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public int Amount { get; set; } | |
public DataContext Context { get; set; } |
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
function awaitable(fn) { | |
return new Promise((resolve, reject) => { | |
let callback = (err, data) => { | |
if (err) { | |
reject(err); | |
return; | |
} | |
resolve(data); | |
}; | |
var newArgs = Array.prototype.slice.call(arguments, 1); |
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
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type) | |
{ | |
$certCallback = @" | |
using System; | |
using System.Net; | |
using System.Net.Security; | |
using System.Security.Cryptography.X509Certificates; | |
public class ServerCertificateValidationCallback | |
{ | |
public static void Ignore() |