Skip to content

Instantly share code, notes, and snippets.

View drichardson's full-sized avatar

Doug Richardson drichardson

View GitHub Profile
@drichardson
drichardson / datadog_metrics_cursor_bug_output.txt
Created March 26, 2026 04:02
Datadog GET /api/v2/metrics links.next cursor bug - script output
Step 1: GET https://api.datadoghq.com/api/v2/metrics?filter[configured]=false&page[size]=1000
Status: 200
Items returned: 1000
next_cursor length: 12304 chars
links.next length: 12383 chars
Step 2: GET https://api.datadoghq.com/api/v2/metrics?filter[configured]=false&page[cursor]=4e7a6732596b4a445356686152315a3559566861624670474f58526157464a355956644f656c6779526d35614d30706d545552465631457a576d6c4f534842315644424f55325649566d394d565456705931553065564674556e4e6b64306c43526d356f4e464a71536e5250557a423656587073564752584f57785053464a515632773564553959593046425555464251554642516d525461466447615441785956644f57553173546b52564d4778495431565a64314a57627a4254625852325446646a515551794d57786b5345707757544e4f5a6c6c585a47356a624468335458686154564e4961444e6b523364305a455a4b516d4a5862484a594d445630596d747761565a71556d354364305658556c5a77615752496347315552555a56556c524b626c5657536c6c69566c5a455455686b636c565251554a42515546425155464b4e585252613164614d44564c546a42734e55394865464e4e566b303057544647516d5649536e686b625570
@drichardson
drichardson / datadog_metrics_cursor_bug.py
Created March 26, 2026 03:58
Datadog GET /api/v2/metrics links.next cursor bug reproduction
#!/usr/bin/env -S uv run --with requests
# /// script
# requires-python = ">=3.12"
# dependencies = ["requests"]
# ///
"""
Demonstrates a bug in the Datadog GET /api/v2/metrics API where the cursor
URL returned in links.next is not followable (returns 400 Bad Request).
Requires DD_API_KEY and DD_APP_KEY environment variables.
@drichardson
drichardson / README.md
Last active August 11, 2025 18:03
Zendesk Ticket to Atlas Bookmarklet

Installation

Create a new bookmark in your browser, then copy/paste the minified code below into the URL field.

To Update bookmarklet

Use Bookmarklet Maker to minify and URI encode the bookmarklet.

@drichardson
drichardson / obsidian-web-clipper.js
Last active October 27, 2025 04:20 — forked from kepano/obsidian-web-clipper.js
Using my properties
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@drichardson
drichardson / github-org-up
Last active September 11, 2022 15:27
Clone/update all repositories in an organization you have access to.
#!/bin/bash
# Clone/pull every repo you have access to in a github org into a directory.
# Source: https://gist.github.com/drichardson/4f1e831e0feece632ef4cb179955864c
set -euo pipefail
# Max repos to checkout.
LIMIT=500
usage() {
#pragma once
#include "CoreMinimal.h"
#include "Engine/World.h"
#include "EngineUtils.h"
DECLARE_LOG_CATEGORY_EXTERN(LogWorldSingleton, Log, All);
/*
@drichardson
drichardson / WorldSingleton.h
Created December 31, 2020 22:37
UE4 World Singleton
#pragma once
#include "CoreMinimal.h"
#include "Engine/World.h"
#include "EngineUtils.h"
/*
* TWorldSingleton is a weak pointer to a actor in a level, which is only a
* singleton by convention of only one actor of that type being in a UWorld.
@drichardson
drichardson / pre-commit
Created December 16, 2020 21:20
git pre-commit hook script to run pycodestyle to check for PEP-8 conformance
#!/bin/sh
# Is pycodestyle is installed?
which pycodestyle &> /dev/null
if [[ $? -ne 0 ]]; then
cat <<-EOF
pre-commit hook failed. pycodestyle is not installed.
Run the following and try your commit again:
pip install pycodestyle
@drichardson
drichardson / github-list-gpg-keys.py
Created December 7, 2020 21:20
List github gpg public keys for a user
#!/usr/bin/python3
import json
import sys
import urllib.request
import os
scriptname=os.path.basename(__file__)
usage=f'''Missing username.
@drichardson
drichardson / Out-FileUtf8NoBom.psm1
Created October 24, 2017 20:15 — forked from mklement0/Out-FileUtf8NoBom.ps1
PowerShell function that emulates Out-File for creating UTF-8-encoded files *without a BOM* (byte-order mark).
<#
.SYNOPSIS
Outputs to a UTF-8-encoded file *without a BOM* (byte-order mark).
.DESCRIPTION
Mimics the most important aspects of Out-File:
* Input objects are sent to Out-String first.
* -Append allows you to append to an existing file, -NoClobber prevents
overwriting of an existing file.
* -Width allows you to specify the line width for the text representations