Skip to content

Instantly share code, notes, and snippets.

@joelowrance
joelowrance / SQL Part1.md
Last active November 15, 2022 00:35
SQL Part1

Getting Started

Most samples are based around the WideWorldImporters database. Instructions on how set up are here. The database to install is “WideWorldImporters-Full.bak”

Window Functions

Using this base query

SELECT 
      o.OrderId,
      o.OrderDate, 
      ol.OrderLineId,
      ol.StockItemId,
 ol.Description, 
@tonholis
tonholis / app.py
Last active November 10, 2023 15:44
Python consumer that works with MassTransit
import sys
import pika
import json
import re
import logging
import logging.handlers
PUBLISHER_EXCHANGE_NAME = 'DoSomeJob'
CONSUMER_QUEUE_NAME = 'python_consumer_queue'
@mikepfeiffer
mikepfeiffer / stress.sh
Created January 27, 2019 21:05
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
function downloadFile($url, $targetFile)
{
"Downloading $url"
$uri = New-Object "System.Uri" "$url"
$request = [System.Net.HttpWebRequest]::Create($uri)
$request.set_Timeout(15000) #15 second timeout
$response = $request.GetResponse()
$totalLength = [System.Math]::Floor($response.get_ContentLength()/1024)
$responseStream = $response.GetResponseStream()
$targetStream = New-Object -TypeName System.IO.FileStream -ArgumentList $targetFile, Create