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 DISTINCT | |
o.name AS Object_Name, | |
o.type_desc | |
FROM sys.sql_modules m | |
INNER JOIN | |
sys.objects o | |
ON m.object_id = o.object_id | |
WHERE m.definition Like '%ABD%'; |
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
# read in the certificate from a pre-existing PFX file | |
$cert = Get-PfxCertificate -FilePath "$env:temp\codeSignCert.pfx" | |
# find all scripts in your user profile... | |
Get-ChildItem -Path $home\Documents -Filter *.ps1 -Include *.ps1 -Recurse -ErrorAction SilentlyContinue | | |
# ...that do not have a signature yet... | |
Where-Object { | |
($_ | Get-AuthenticodeSignature).Status -eq 'NotSigned' | |
} | | |
# and apply one |
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
(new System.Xml.Serialization.XmlSerializer(obj.GetType())).Serialize(new System.IO.StreamWriter(@"c:\temp\text.xml"), obj) |
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
param([string]$oc,[string]$nc) | |
Write-Host "Searching for: "$oc | |
Get-ChildItem test.config -recurse | | |
Foreach-Object { | |
$c = ($_ | Get-Content) | |
$n = $c -replace [RegEx]::Escape($oc), $nc | |
if($c -ne $n) { | |
Write-Host $_.FullName | |
if($nc -ne $NULL) { |
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
$.ajax({ | |
contentType: 'application/json', | |
dataType: 'html', | |
type: 'GET', | |
async: true, | |
cache: false, | |
url: url, | |
success: function(result) { | |
}, | |
error: function() { |
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
@Html.DropDownListFor(model => model.Status, Status.GetValues(typeof(Status)).Cast<Status>().Select(v => new SelectListItem | |
{ | |
Text = WebAdministration.Classes.Helpers.SplitCamelCase(v.ToString()), | |
Value = ((int)v).ToString() | |
}).ToList(), new { @class = "form-control" }) | |
/// <summary> | |
/// Takes a camel case string and splits it | |
/// </summary> |
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
update-package Newtonsoft.Json -reinstall |
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
find: | |
({........-....-....-....-............}) | |
replace: | |
\L$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
SELECT | |
ROW_NUMBER() OVER (ORDER BY ct_id) AS row_num, | |
ROW_NUMBER() OVER (PARTITION BY source_id ORDER BY ct_id) AS partitioned_row_num, | |
RANK() OVER (ORDER BY ct_id) AS row_num, | |
RANK() OVER (PARTITION BY source_id ORDER BY ct_id) AS partitioned_row_num | |
FROM | |
ct_pstor |
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 Invoke-SQL { | |
param( | |
[string] $dataSource = $(throw "Please specify a datasource."), | |
[string] $database = $(throw "Please specify a database."), | |
[string] $sqlCommand = $(throw "Please specify a query.") | |
) | |
$connectionString = "Data Source=$dataSource; " + | |
"Integrated Security=SSPI; " + | |
"Initial Catalog=$database" |