Skip to content

Instantly share code, notes, and snippets.

View timmyreilly's full-sized avatar
👨‍🚀
Focusing

Tim Reilly timmyreilly

👨‍🚀
Focusing
View GitHub Profile
Account 1: 0xCDA8e603e9d9EDCc6f30B6ee9aCB56522710f0B1
Account 2: {96e1170655b7a8e005ce0bfc8240847b61142735}
0xfdd838fc5a5b9da3f8e07d19e3a0de3fabf6ffc3
0x7bac972a808cd798c0f9aeb5e7cf185b39d95e65
@timmyreilly
timmyreilly / ConnectingToAzureSQLFromPython
Created October 13, 2017 23:02
Using Flask_SQLAlchemy to connect to Azure SQL
#!/usr/bin/env python
import os
import urllib.parse
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
# Configure Database URI:
params = urllib.parse.quote_plus("DRIVER={SQL Server};SERVER=sqlhost.database.windows.net;DATABASE=pythonSQL;UID=username@sqldb;PWD=password56789")
@timmyreilly
timmyreilly / arduinolinks.txt
Last active October 17, 2017 17:56
Arduino Workshop Links
#!/usr/bin/env bash
set -e
set -o xtrace
DEBIAN_FRONTEND=noninteractive
# The only change so far is removing this line: sudo rm /etc/apt/apt.conf.d/*.*
sudo apt update
sudo apt install unzip -y
sudo apt -y upgrade --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
@timmyreilly
timmyreilly / index.js
Last active October 24, 2018 17:31
A JavaScript Function that uses a cosmos db mongo client to validate and create a document (Thank you Denis K.)
// Method: POST
// Body:
// {
// "userId": "cc20a6fb-a91f-4192-874d-132493685376",
// "productId": "4c25613a-a3c2-4ef3-8e02-9c335eb23204",
// "locationName": "Sample ice cream shop",
// "rating": 5,
// "userNotes": "I love the subtle notes of orange in this ice cream!"
// }
var rp = require('request-promise-native');
@timmyreilly
timmyreilly / README.md
Created November 21, 2018 00:11
ARM Template for Azure Storage to create an Event Grid Subscription and point it at and Existing EventHub

Event Grid

Event grid from a new storage account to event hub:

az login
az group create --name ExampleGroup --location "West US"
az group deployment create --name exampleDep --resource-group ExampleGroup --template-file .\event-hub\armStorageToEventHubEndpoint.json

"Please provide string value for 'endpoint' eg: 
/subscriptions/1230123-1234-1234-1234-123456789012/resourceGroups/resourceGroup1/providers/Microsoft.EventHub/namespaces/tim-acceptanceTestEventHubNamespace/eventhubs/tim-testeventhub
@timmyreilly
timmyreilly / main.tf
Created December 4, 2018 20:43
Terraform Main.tf for Azure Event Grid Subscription from Azure Storage to EventHub.
resource "azurerm_resource_group" "test" {
name = "tempresourceGroup1"
location = "West US"
}
resource "azurerm_eventhub_namespace" "test" {
name = "demo-EventHubNamespace"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
resource "azurerm_template_deployment" "event_grid" {
name = "event-grid-deployment"
resource_group_name = "${var.rg_name}"
template_body = <<DEPLOY
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageName": {