Skip to content

Instantly share code, notes, and snippets.

@carlosfunk
carlosfunk / invoke_lambda.py
Created April 24, 2020 03:28
Function to invoke a lamdba from python
import boto3
client = boto3.client('lambda')
def invoke_lambda(stage: str, region: str, name: str) -> List[Dict[str, Any]]:
response = client.invoke(FunctionName=f"{stage}-{region}-{name}", InvocationType="RequestResponse")
string_response = response["Payload"].read().decode("utf-8")
return json.loads(string_response)
@carlosfunk
carlosfunk / install_python.ps1
Last active June 13, 2023 04:57
Powershell scripts for setting up a Python environment under Windows
# To run this file you will need to open Powershell as administrator and first run:
# Set-ExecutionPolicy Unrestricted
# Then source this script by running:
# . .\install_python.ps1
$save_dir=Resolve-Path ~/Downloads
$project_dir = "C:\Projects"
$virtualenv_dir = $project_dir + "\virtualenvs"
$client = New-Object System.Net.WebClient