Skip to content

Instantly share code, notes, and snippets.


Zev Averbach zevaverbach

View GitHub Profile
zevaverbach / gist:0f3668cd2e3f42c6d2f152b97471461e
Created February 5, 2023 10:09
wp 6.1.1 response to POST
View gist:0f3668cd2e3f42c6d2f152b97471461e
{"id":5,"date":"2023-02-05T10:05:40","date_gmt":"2023-02-05T10:05:40","guid":{"rendered":"https:\/\/\/2023\/02\/test-wp-api","raw":"https:\/\/\/2023\/02\/test-wp-api"},"modified":"2023-02-05T10:05:40","modified_gmt":"2023-02-05T10:05:40","password":"","slug":"test-wp-api","status":"publish","type":"post","link":"https:\/\/\/2023\/02\/test-wp-api","title":{"raw":"Test WP-API","rendered":"Test WP-API"},"content":{"raw":"This is my first post created using restAPI","rendered":"<p>This is my first post created using restAPI<\/p>\n","protected":false,"block_version":0},"excerpt":{"raw":"","rendered":"<p>This is my first post created using restAPI<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[],"permalink_template":"https:\/\/myxomycete-princip
zevaverbach /
Last active January 23, 2023 20:59
Download all the CS61A videos (UC Berkeley 2011)
# The lecture listing is here:
# NOTE: the URLs were obtained by running this in the JS console on each of the lecture pages:
# > copy(document.getElementsByClassName("item-download-options")[0].children[2].children[1].href)
cat vid_urls.txt | while read line; do echo $line | wget $line -O lecture_$(sed -E 's/.*Lecture%20([0-9]+).*/\1/').mp4; done
zevaverbach / plugins_to_try.txt
Last active December 16, 2021 14:07
vim plugins to try (from this talk by Jess Archer)
View plugins_to_try.txt
zevaverbach / copy_urls_from_reminders.kmmacros
Last active December 1, 2021 12:17
A Keyboard Maestro macro to copy the URLs from an Apple Reminders list to a text file.
View copy_urls_from_reminders.kmmacros
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
zevaverbach /
Created November 8, 2021 11:45
Partition a list in Python 3.7
from typing import Dict, Tuple, Any, List
def make_tuple_partitions(
unique_values: List[Any], num_partitions: int
) -> Dict[Tuple[int, int], Tuple[Any, Any]]:
Given a list of values, return a dictionary with (the_index, the_index + 1) as the keys
and (chunk_start_value, chunk_end_value) as the values such that the chunks are equal
or close to equal in size.
zevaverbach /
Created October 27, 2021 11:06
Some spaghetti to produce a SQLAlchemy Table *string* from a SQLA model.
import re
from black import format_str, FileMode
def convert_tablemapping_to_table_object(model) -> str:
schema_name = model.__table_args__["schema"].lower()
table_repr = repr(model.__table__)
header_str, *columns = table_repr.split("Column(")
# from
zevaverbach /
Created October 14, 2021 20:16
TypedDicts for Battlesnake /move endpoint
from dataclasses import dataclass
from types import TypedDict, Annotated, Literal
class Squad(TypedDict):
allowBodyCollisions: bool
sharedElimination: bool
sharedHealth: bool
sharedLength: bool
View gist:02c6a4d4675ca614cc9e1f699559a05c
// Copyright 2013 Soundslice LLC. License: BSD.
/* HTML example: ****************
<figure class="vid">
<video preload>
<source src="/videos/help/playhead.mp4" type="video/mp4">
<source src="/videos/help/playhead.webm" type="video/webm">
<p>To move the playhead, click in the timeline or drag the playhead’s diamond.</p>
zevaverbach / imapflow.d.ts
Created May 16, 2021 20:12
ImapFlow Type Declaration File -- not complete
View imapflow.d.ts
declare module "imapflow" {
type SequenceString = string;
export interface FetchQueryObject {
uid?: boolean;
flags?: boolean;
bodyStructure?: boolean;
envelope?: boolean;
internalDate?: boolean;
size?: boolean;
zevaverbach /
Last active April 7, 2021 15:40
Reading notes from "Software and Systems Security for CompTIA CySA+" on Pluralsight

Software and Systems Security for CompTIA CySA+

Examining the Software Development Lifecycle (SDLC)

  • ignored instructor's advice to set up penetration testing VMs



  • the most important phase
  • done by the most senior team members, with input from customers