Skip to content

Instantly share code, notes, and snippets.

View mflanneryii's full-sized avatar

Michael Flannery II mflanneryii

View GitHub Profile
@isaac-ped
isaac-ped / ResourceGroup.py
Last active May 8, 2023 21:30
Automatic instantiation of single-use component resources
"""
Automatically define singleton resource groups
The structure of the python pulumi library is such that many properties
of resources are not easily modifyable after initialization.
This module functions by delaying the creation of resource attributes
within the ResourceGroup class until the class has been fully instantiated.
"""
from typing import Any, ClassVar, Iterable, TypeVar, Generic
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
component: resolv
tier: node
name: resolv
namespace: default
spec:
selector:
@PiotrCzapla
PiotrCzapla / nre_deployment.py
Last active June 24, 2022 17:11
Python script to log a new relic deployment information with minimal python dependency
"""
Python script to log a new relic deployment information with minimsl dependencies
# Usage:
The scripts accepts either `list` or `new` commands
$ API_KEY="..." APP_ID="..."" python nr_deployment.py new 'rev id' "my title"\
--description="some desc" --timestamp='2022-01-02' --user='test'
# Credentials configuration
@kakarukeys
kakarukeys / .bash_profile
Last active December 4, 2021 00:50
shell script to enable Poetry .env loading
function poetry() {
dot_env_path=$(pwd)
while [[ "$dot_env_path" != "" && ! -e "$dot_env_path/.env" ]]; do
dot_env_path=${dot_env_path%/*}
done
# if POETRY_DONT_LOAD_ENV is *not* set, then load .env if it exists
if [[ -z "$POETRY_DONT_LOAD_ENV" && -f "$dot_env_path/.env" ]]; then
>&2 echo 'Loading .env environment variables…'
@zleight1
zleight1 / azp-custom-schema.yml
Last active July 1, 2021 22:03
AZP VS Code Extension Custom Schema With Template Syntax
This file has been truncated, but you can view the full file.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/Microsoft/azure-pipelines-vscode/blob/master/local-schema.json",
"$comment": "v1.147.0",
"title": "Pipeline schema",
"description": "A pipeline definition",
"oneOf": [{
"$ref": "#/definitions/pipeline"
}, {
"type": "string",
@adamcrews
adamcrews / certificate_synthetic.js
Created June 11, 2019 05:36
New Relic SSL/TLS Synthetic
/*
To use this synthetic, set the following Secure credentials:
NEW_RELIC_INSIGHTS_API_KEY - Your api key from the account settings.
NEW_RELIC_ACCOUNT_ID - Your account ID, also found in the account settings.
CERTS_TO_MONITOR - A list of hosts to check via https, separated by a comma and a space, for example:
host.example.com, foo.example.com
Create a new Synthetic monitor, copy the entire contents of this script to the monitor.
Set the monitor to run once a day from a single location.
@yoav-steinberg
yoav-steinberg / rediff.py
Created April 13, 2014 15:48
rediff - the redis diff script
import urlparse
import argparse
import redis
import sys
from multiprocessing import Pool
import signal
def parse_redis_url(s):
url = urlparse.urlparse(s)
if not url.scheme:
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@BashedCrab
BashedCrab / HydrogenLayouts.py
Last active March 19, 2023 04:14
HydrogenLayouts
#
# Hydrogen is a lightweight GUI framework for Pythonista
#
# Hydrogen - https://gist.github.com/BashedCrab/5924965
#
# HydrogenLayouts - https://gist.github.com/BashedCrab/6103019
#
# HydrogenDemo - https://gist.github.com/BashedCrab/5953776
#