Skip to content

Instantly share code, notes, and snippets.

View mjbear's full-sized avatar

Michael Bear mjbear

View GitHub Profile
@mjbear
mjbear / urllib3_requests_override_chars.py
Created November 3, 2023 00:07
override urllib3 allowed chars so requests will accept otherwise invalid characters
import requests
import urllib3.util.url
# ref: Lyle at https://github.com/psf/requests/issues/6115#issuecomment-1172198984
def hook_invalid_chars(component, allowed_chars):
# handle url encode here, or do nothing
return component
# Method1:
@mjbear
mjbear / cicd.yml
Last active September 30, 2024 16:22
GitHub Actions for CI/CD with conditional logic
name: Testing CI/CD with GitHub Actions
# Simple test leveraging `echo` to do nothing special other than show job was triggered
#
# Use case: skip 'docker' job since normal contributors cannot access repo secrets (and the job fails)
# REFERENCES:
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions
# Credit: https://github.com/planetoftheweb/podcast-generator/pull/2
FROM ubuntu:latest
RUN apt-get update && \
apt-get install -y \
python3.10 \
python3-pip \
python3-venv \
git
#!/usr/bin/env bash
profiles_path='org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:'
prof=$(gsettings get org.gnome.Terminal.ProfilesList default | awk -F\' '{print $2}')
name=$(gsettings get "$profiles_path/:$prof/" visible-name)
size=20
font="'Monospace $size'"
# echo -e "$profiles_path/:$prof/"