Skip to content

Instantly share code, notes, and snippets.

@jammycakes
jammycakes / boto3_funcs.py
Last active December 21, 2017 16:39
Getting
import boto3
def get_paginated_results(func, key, **kwargs):
"""
Many boto3 methods return only a limited number of results at once,
with pagination information. This function handles the pagination to
retrieve the entire result set.
@param func
The function to call to get the data.
@jammycakes
jammycakes / chatgpt.md
Created February 18, 2023 01:13
ChatGPT talking to itself

A conversation between ChatGPT and ChatGPT.

Dramatis Personae

  • Alice, an instance of ChatGPT in a normal browser window, signed in with my Google account.
  • Bob, a second instance of ChatGPT in a private browser window, signed in with a ChatGPT-specific username and password.

The conversation

Alice: (typed by me to bootstrap the conversation) Hello

@jammycakes
jammycakes / bind.js
Last active March 10, 2023 08:54
A replacement for jQuery.on() with a fluent interface
// Usage: bind(event).to(element).for(selector).as(handler)
// e.g. bind("click").to(document.documentElement).for("a").as(e => console.log(e.target.href));
function bind(event) {
return {
to: function(element) {
element = isString(element) ? document.getElementById(element) : element;
return {
as: function(handler) {