Skip to content

Instantly share code, notes, and snippets.

View theorigin's full-sized avatar

Andy Robinson theorigin

View GitHub Profile
var compareResult = new KellermanSoftware.CompareNetObjects.CompareLogic().Compare(actualResult, expectedResult);
Assert.IsTrue(compareResult.AreEqual, compareResult.DifferencesString);
@theorigin
theorigin / SQLServer-APIPost.sql
Last active January 9, 2024 12:10
SQL Server code to POST to an API
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;
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/react@0.14.2/dist/react.min.js"></script>
<script src="https://npmcdn.com/react-dom@0.14.2/dist/react-dom.min.js"></script>
<script src="https://npmcdn.com/google-map-react@0.14.6/dist/GoogleMapReact.js"></script>
<meta charset="utf-8">
@theorigin
theorigin / Update-CloudFrontDistribution-OriginPath.ps1
Created April 17, 2018 08:13
PS script to update cloudfront distribution
<#
.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
@theorigin
theorigin / RollTheDice.cs
Created May 29, 2021 10:15
Roll the dice
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?");