This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Uses gcloud commands to cleanup old GCR images and reduce storage costs. | |
import re | |
import json | |
import argparse | |
import subprocess | |
from datetime import datetime, timedelta, timezone | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"log" | |
"time" | |
api "github.com/rotationalio/ensign/pkg/api/v1beta1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package counter | |
import ( | |
"sync" | |
"sync/atomic" | |
) | |
type Counter interface { | |
Inc() | |
Load() uint64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merging a struct from another struct using reflection. | |
package main | |
import ( | |
"encoding/json" | |
"errors" | |
"fmt" | |
"reflect" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Wrapper for a command line editor to edit files. | |
*/ | |
package main | |
import ( | |
"encoding/json" | |
"errors" | |
"flag" | |
"fmt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/tls" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"encoding/pem" | |
"fmt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(args): | |
pass | |
def make_wide(formatter, width=120, max_help_position=42): | |
""" | |
Increase space between arguments and help text, if possible. | |
See: https://stackoverflow.com/questions/5462873/ | |
""" | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import json | |
import random | |
import zipfile | |
config = { | |
"color": "red", | |
"amount": 42.24, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
import asyncio | |
import argparse | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
from functools import partial | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# requires | |
# Creates a requirements.txt file using pip freeze. | |
# | |
# Author: Benjamin Bengfort <[email protected]> | |
# Created: Fri Jan 22 08:50:31 2016 -0500 | |
# | |
# Copyright (C) 2016 Bengfort.com | |
# For license information, see LICENSE.txt | |
# |