Skip to content

Instantly share code, notes, and snippets.

@nachmore
nachmore / interactive.py
Last active November 6, 2024 18:25
Create an interactive Python shell at a specific line
import pdb
pdb.set_trace()
# b: set a breakpoint
# c: continue debugging until you hit a breakpoint
# s: step through the code
# n: to go to next line of code
# l: list source code for the current file (default: 11 lines including the line being executed)
# u: navigate up a stack frame
# d: navigate down a stack frame
@nachmore
nachmore / aws-cost-anomaly-detector-sample.sns
Created July 15, 2021 15:15
Sample SNS message sent from AWS Cost Anomy
{
"Records": [
{
"EventSource": "aws:sns",
"EventVersion": "1.0",
"EventSubscriptionArn": "arn:aws:sns:us-east-1:[account-id]:CostAnomalyQueue:f6df06cb-a1be-48be-b560-85876b7821b2",
"Sns": {
"Type": "Notification",
"MessageId": "31236cc0-d7be-55ec-a6f7-35aaf7b15d43",
"TopicArn": "arn:aws:sns:us-east-1:[account-id]:CostAnomalyQueue",
@nachmore
nachmore / flapping-crash.js
Created July 14, 2021 14:01
Javascript function (in AWS Lambda form) that crashes ever other minute. Useful for testing Alarms.
exports.handler = async () => {
// causes a crash every other minute by returning an invalid value
return (new Date().getMinutes() % 2) ? () => {} : 1;
};
@nachmore
nachmore / all-variables.js
Last active July 13, 2021 07:07
Traverse a Javascript object. Particularly useful for dump(this) to grab everything.
dump = (target, match_re, depth, seen) => {
if (depth === undefined) depth = 0
if (seen === undefined) seen = [target]
Object.keys(target).forEach((i, idx) => {
value = target[i] ?? "null";
isObject = (value === Object(value));
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy