Skip to content

Instantly share code, notes, and snippets.

View scott-grimes's full-sized avatar

Scott Grimes scott-grimes

View GitHub Profile

Given the following template:

{{- /*
mylibchart.util.merge will merge two YAML templates and output the result.
This takes an array of three values:
- the top context
- the template name of the overrides (destination)
- the template name of the base (source)
*/}}
{{- define "mylibchart.util.merge" -}}

IyEvYmluL2Jhc2gKIyBUaGlzIHNjcmlwdCBjb25zdHJ1Y3RzIG1hcmtkb3duIGZpbGVzIGZyb20gdGhlIG1ldGFkYXRhLnlhbWwgZmlsZQojIEV2ZXJ5IHRlYW0gZ2V0cyBhIHVuaXEgbWFya2Rvd24gZmlsZSB3aXRoIGEgbWVybWFpZCBkaWFncmFtIHNob3dpbmcgdGhlaXIgcmVsZWFzZSBjYWRlbmNlLAojIGFuZCBhbGwgY2x1c3RlciBtZXRhZGF0YSBpcyBzdXJmYWNlZCB3aXRoIGxpbmtzIHNvIHVzZXJzIGNhbiBxdWlja2x5IHZpZXcgYW5kIGVkaXQgdGhlaXIgZmlsZXMKCiMgc2V0IGlucHV0IGFuZCBvdXRwdXQgZmlsZW5hbWVzCmlucHV0X3lhbWw9ImZvb2Jhci55YW1sIgpvdXRwdXRfZGlyZWN0b3J5PSJmb29iYXIiCgpybSAiJHtvdXRwdXRfZGlyZWN0b3J5fS8qIgoKdGVhbXM9JChjYXQgJGlucHV0X3lhbWwgfCB5cSAnLmNsdXN0ZXJPd25lcltdIHwgLm5hbWUnKQoKZm9yIHRlYW0gaW4gJHRlYW1zOyBkbwoKICBjbHVzdGVyc195YW1sPSQoY2F0ICRpbnB1dF95YW1sIHwgeXEgIi5jbHVzdGVyT3duZXJbXSB8IHNlbGVjdCgubmFtZSA9PSBcIiR7dGVhbX1cIikgfCAuY2x1c3RlcnMiKQogIGRlcGxveW1lbnRQcmlvaXJpdGllcz0kKGVjaG8gIiR7Y2x1c3RlcnNfeWFtbH0iIHwgeXEgJy5bXSB8IHNlbGVjdCgudGllciAhPSAibGFiIikgfCAuZGVwbG95bWVudFByaW9yaXR5JyB8IHNvcnQgLW4gfCB1bmlxKQoKICAjIG5vZGVzIGluIG1lcm1haWQgZ3JhcGggYXJlIG5hbWVkIGNsdXN0ZXJfJHtjX2Nsb3VudH0KICBsZXQgImNfY291bnQ9MCIK

write a python program that generates a list of times to harvest vegetables. every vegetable has an array of cron expressions which define when a vegetable can be harvested. vegetables are grouped into tiers. vegetables in one tier must be harvested before the next tier. tiers must be spaced apart by one week. the first harvest occurs two weeks from now

modify the program so that the start time is a variable. modify the program so that the length of the delay between tiers is a variable

import datetime
import random
import croniter

# Define a dictionary of vegetables with their respective cron expressions
@scott-grimes
scott-grimes / scheduledPrViewer.sh
Created November 14, 2022 14:47
scheduledPrViewer.sh
#!/usr/bin/env bash
#
# Returns an ordered list of releases scheduled to be merged within x hours
# optionally, filter by team
#
# example
#
# Show all releases within next 7 days
# ./things2.sh 168
#
@scott-grimes
scott-grimes / automerger.sh
Created November 14, 2022 14:45
automerger.sh
#!/usr/bin/env bash
#
# Auto-merges PR's with the "scheduled" label according to the most recent
# comment "/schedule <iso-8601>"
#
# Additionally, will ack "/schedule <iso-8601>" comments as they appear with
# a message using the ACK_TEMPLATE
#
# this should be run every 15min/30min/1h depending on how we set our changewindows
#
@scott-grimes
scott-grimes / .zshrc
Last active September 10, 2019 16:24
zsh
export PATH=$HOME/Library/Python/3.7/bin:$PATH
export ZSH="/Users/scottgrimes/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(git kube-ps1 kubectl helm terraform ansible aws)
source $ZSH/oh-my-zsh.sh

Keybase proof

I hereby claim:

  • I am scott-grimes on github.
  • I am scottgrimes (https://keybase.io/scottgrimes) on keybase.
  • I have a public key whose fingerprint is 7DE8 BCBB AB3F 4BEC 5C17 EEF9 49BA 180F 5D6B B5F2

To claim this, I am signing this object: