Skip to content

Instantly share code, notes, and snippets.

View jjgriff93's full-sized avatar

James Griffin jjgriff93

  • AI Incubator @ Tony Blair Institute for Global Change
  • UK
View GitHub Profile
@jjgriff93
jjgriff93 / project-assets-amendment.json
Last active February 3, 2018 01:01
Azure .NET Mgmt API - JSON Dependencies for app
"dependencies": {
"Microsoft.Azure.Management.Fluent": "1.4.1"
},
@jjgriff93
jjgriff93 / AzuredotNETMgmtAPI-authFileTemplate.txt
Created February 2, 2018 01:24
Azure .NET Mgmt API - auth file template
subscription=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
client=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
key=XXXXXXXXXXXXXXXX
tenant=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
managementURI=https\://management.core.windows.net/
baseURL=https\://management.azure.com/
authURL=https\://login.windows.net/
graphURL=https\://graph.windows.net/
@jjgriff93
jjgriff93 / fluent-objAPI-call.cs
Last active February 2, 2018 00:34
.NET API - Example of using a fluent-interfaced API
var object = new APIObject().DoSomething(withThisParameter).DoSomethingElseWithANumber(42).DoSomething(withAnotherParameter).ApplyChanges();
@jjgriff93
jjgriff93 / progressive-objAPI-call.cs
Last active February 2, 2018 00:33
.NET API - Example of a traditional progressive object-based API call
var object = new APIObject();
APIObject.DoSomething(withThisParameter);
APIObject.DoSomethingElseWithANumber(42);
APIObject.DoSomething(withAnotherParameter);
APIObject.ApplyChanges();
@jjgriff93
jjgriff93 / monitor-db.bash
Last active January 30, 2018 01:30
Azure SQL Test - Monitor DB
az sql db list-usages \
--name SQLTestDB \
--resource-group SQLRG \
--server sqltestlogicalserver
@jjgriff93
jjgriff93 / update-row.sql
Last active January 30, 2018 01:13
Azure SQL Test Dataset - update row
UPDATE [SalesLT].[Product]
SET [ListPrice] = 5
WHERE Name = 'AzureSocks';
@jjgriff93
jjgriff93 / new-row.sql
Last active January 30, 2018 00:05
Azure SQL Test Dataset - insert row
INSERT INTO [SalesLT].[Product]
( [Name]
, [ProductNumber]
, [Color]
, [ProductCategoryID]
, [StandardCost]
, [ListPrice]
, [SellStartDate]
)
VALUES
@jjgriff93
jjgriff93 / top-10-by-category.sql
Last active January 29, 2018 23:53
Azure SQL Test Dataset - top 10 products by category
SELECT TOP 10 pc.Name as CategoryName, p.name as ProductName
FROM SalesLT.ProductCategory pc
JOIN SalesLT.Product p
ON pc.productcategoryid = p.productcategoryid;
@jjgriff93
jjgriff93 / IISInstall.ps1
Created January 29, 2018 16:05
Windows Server 2016 - PowerShell DSC Config File - IIS Web Server
configuration IISInstall
{
node "localhost"
{
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
}
@jjgriff93
jjgriff93 / template.json
Last active March 12, 2018 14:48
Windows Server 2016 Azure VM - template deployment - template.json
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {