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
void Main() | |
{ | |
var numberOfDice = 2; | |
var numberOfRolls = 2; | |
Console.WriteLine("Roll the Dice"); | |
Console.WriteLine("============="); | |
Console.WriteLine("How many dice do you want to roll?"); | |
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
<# | |
.SYNOPSIS | |
Updates the Cloudfront distribution origin path with the supplied version number | |
.DESCRIPTION | |
Given a version number this script will retrieve the current distribution, extract the ETAG value, update the current-distribution.json file with the version number (for the OriginPath), | |
save the JSON and then update the distribution using the new file. A CloudFront invalidation is then created to expire all edge caches. | |
.PARAMETER version | |
A value indicating the version number to be used e.g. 1.12.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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://npmcdn.com/[email protected]/dist/react.min.js"></script> | |
<script src="https://npmcdn.com/[email protected]/dist/react-dom.min.js"></script> | |
<script src="https://npmcdn.com/[email protected]/dist/GoogleMapReact.js"></script> | |
<meta charset="utf-8"> |
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
DECLARE @Object AS INT; | |
DECLARE @ResponseText AS VARCHAR(8000); | |
DECLARE @Body AS VARCHAR(8000) = | |
'{ | |
"what": 1, | |
"ever": "you", | |
"need": "to send as the body" | |
}' | |
EXEC sp_OACreate 'MSXML2.XMLHTTP', @Object OUT; |
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
var compareResult = new KellermanSoftware.CompareNetObjects.CompareLogic().Compare(actualResult, expectedResult); | |
Assert.IsTrue(compareResult.AreEqual, compareResult.DifferencesString); |
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
{ | |
"$schema": "http://json-schema.org/draft-03/schema#", | |
"type": "object", | |
"properties": { | |
"orderDate": { | |
"type": "string", | |
"format": "date" | |
} | |
} |
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 class UrlHelperExtensions | |
{ | |
public static string ContentWithHash(this UrlHelper urlHelper, string contentPath) | |
{ | |
var virtualFile = urlHelper.Content(contentPath); | |
var actualFile = urlHelper.RequestContext.HttpContext.Server.MapPath(contentPath); | |
var creationDateTime = (File.Exists(actualFile) ? File.GetLastWriteTimeUtc(actualFile) : new DateTime()).ToString("yyyyddMMHHmmss"); |
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 | |
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 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
CREATE PROCEDURE [dbo].[xxx] | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
DECLARE @transactionName VARCHAR(32) = REPLACE((CAST(NEWID() AS VARCHAR(36))),'-','') | |
BEGIN TRY | |
DECLARE @TranCounter INT; |
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
namespace namespace VS.Library.Interfaces | |
{ | |
public interface IFile | |
{ | |
void Move(string sourceFileName, string destFileName); | |
bool Exists(string fileName); | |
void Delete(string fileName); | |
} |
NewerOlder