This file contains hidden or 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
#!/bin/bash | |
parameter_name=$1 | |
new_parameter_name=$2 | |
ssmget=$(aws ssm get-parameter --name $1 --with-decryption) | |
ssmdesc=$(aws ssm describe-parameters --filter Key=Name,Values=$1) | |
ssmtags=$(aws ssm list-tags-for-resource --resource-type Parameter --resource-id $1) | |
value=$(echo "$ssmget" | jq -r '.Parameter.Value') |
This file contains hidden or 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
import json | |
import sys | |
size = int(sys.argv[1]) | |
stream_name = "speed_test" | |
schema_message = { | |
"type": "SCHEMA", | |
"stream": stream_name, |
This file contains hidden or 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
#!/usr/bin/env python | |
# Takes an input file and determines if it is a .env or a JSON config file | |
# outputs the opposite of the input file to stdout for redirection to an env/config file | |
# useful for moving from meltano to tap testing, vice-versa | |
# optional arg[2] is prefix, which will chop off an .env prefix or add a prefix if going the other way | |
import sys | |
import json | |
import re | |
infile = sys.argv[1] |
This file contains hidden or 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
#!/usr/bin/env python | |
import json | |
import sys | |
full_catalog=sys.argv[1] | |
schema_table=sys.argv[2] | |
try: | |
replication_method = sys.argv[3] | |
replication_key = sys.argv[4] | |
except: |
This file contains hidden or 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
import msal | |
import pyodata | |
""" | |
The configuration file would look like this (sans those // comments): | |
{ | |
"authority": "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here", | |
"client_id": "your_client_id", | |
"scope": ["https://graph.microsoft.com/.default"], |
This file contains hidden or 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
Sub CreateShapes() | |
i = 0 | |
For Each cell In Selection | |
Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, i * 20, i * 20, 72, 20) | |
With shp.TextFrame2 | |
.VerticalAnchor = msoAnchorMiddle | |
.TextRange.ParagraphFormat.Alignment = msoAlignCenter | |
.AutoSize = msoAutoSizeShapeToFitText | |
.WordWrap = msoFalse | |
.TextRange.Characters.Text = cell.Value |
This file contains hidden or 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
/* Construct day month year link for Strava Cycling Climbing Challenge */ | |
const d = new Date() | |
const m = d.toLocaleString('default', {'month':'long'}) | |
const y = d.getFullYear() | |
const url="https://www.strava.com/challenges/"+m+"-Cycling-Climbing-Challenge-"+y | |
window.location = url | |
/* Alert of climb per day remaining */ | |
var arrCalculation = document.querySelectorAll('[class*="ProgressBar--label-"]') | |
for (a of arrCalculation) { |
This file contains hidden or 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
import json | |
import re | |
from airflow.providers.amazon.aws.secrets.systems_manager import ( | |
SystemsManagerParameterStoreBackend, | |
) | |
class SSMMultiParameterBackend(SystemsManagerParameterStoreBackend): | |
def _get_secret( |
This file contains hidden or 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
# Prints the lines from a document (docfile) that match a regex (rx) | |
Function PrintWord($docfile,$rx){ | |
# Expand-Archive to a temporary directory | |
$tempfile = New-TemporaryFile | |
$tempzipfile = "{0}{1}" -f $($tempfile.Fullname,'.zip') | |
Remove-Item $tempfile | |
Copy-Item $docfile $tempzipfile | |
# Expand-Archive to a temporary directory |
This file contains hidden or 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
#!/usr/bin/python | |
# TA file reducer, splitter for Garmin Edge 200 | |
# Takes the big file from the website and creates new smaller files with ONLY trkpt tags | |
# Simple version of code - assumes program, file and output files are all in the same directory | |
import re | |
# Assumes the input file is in the current directory | |
infile = 'Tour-Aotearoa-route-20200123-Kennett-Bros.gpx' | |
# Regular expression to capture only the first part of the trkpt tag, and encased attributes (usu. lat= long=) |
NewerOlder