Skip to content

Instantly share code, notes, and snippets.

View yolabingo's full-sized avatar

Todd Jacobsen yolabingo

  • New Mexico, USA
View GitHub Profile
@yolabingo
yolabingo / mdview
Last active April 29, 2026 19:23
bash markdown preview tool
#!/usr/bin/env bash
# save to ~/bin/mdview:
# gh gist view 13fefaade768ab04167d012f74bbab7a --raw > ~/bin/mdview && chmod +x ~/bin/mdview
# mdview - Preview markdown files with gh markdown-preview --dark-mode
# Usage: mdview [OPTIONS] [file|directory]
# Options:
# -h, --help Show this help message
# -r, --recurse-dirs Recursively search for markdown files in subdirectories
@yolabingo
yolabingo / docker-compose.yaml
Last active May 9, 2025 16:11
glowroot docker compose
networks:
gr:
services:
cassandra:
container_name: cassandra
image: cassandra:4.1
restart: unless-stopped
environment:
- MAX_HEAP_SIZE=8G
#!/usr/bin/env python3
import requests
from rich.pretty import pprint
resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) for k, v in data.items()][:10])
@yolabingo
yolabingo / gist:f5e08e6a6d14940b82597a0dd98cb65c
Last active July 7, 2023 21:01
CentOS 9 docker rootless prereqs

Save the following as docker-prereqs.sh and run as root or with sudo:

#!/bin/bash
DOCKER_USER=dotcms-docker

dnf install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf update -y
dnf install -y iptables tar fuse-overlayfs jq
DO $$ DECLARE
r RECORD;
BEGIN
-- if the schema you operate on is not "current", you will want to
-- replace current_schema() in query with 'schematodeletetablesfrom'
-- *and* update the generate 'DROP...' accordingly.
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE';
END LOOP;
END $$;
@yolabingo
yolabingo / macports.sh
Created March 15, 2023 02:26
macports housekeeping
port selfupdate && port upgrade outdated && port uninstall inactive && port uninstall leaves
@yolabingo
yolabingo / gist:afaf95b6ec24d1ecc2bc4efdb9c8adc5
Created October 18, 2022 02:24
quick and dirty react graphql
'use strict';
var query = `query PageRender { page(url: "/index") { url friendlyName } }`;
const e = React.createElement;
class EmptyElement extends React.Component {
constructor(props) {
super(props);
}
render() {
fetch('https://demo.dotcms.com/api/v1/graphql', {
method: 'POST',
@yolabingo
yolabingo / xcode.md
Created October 13, 2022 17:48
xcode bullshit
@yolabingo
yolabingo / python_links.md
Last active April 11, 2024 20:20
python ftw
@yolabingo
yolabingo / urljoin.py
Created September 1, 2022 01:52
python - join url fragments
def urljoin(*args):
""" Joins given arguments into an url, removing extra slashes """
return "/".join(map(lambda x: x.rstrip('/') if x.startswith('//') else x.strip('/'), args))