This file contains 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 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 | |
import turtle | |
D = 90 | |
L = 10 | |
def iterate(axiom, num=0, initator='F'): | |
""" | |
Compute turtle rule string by iterating on an axiom |
This file contains 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 | |
# jsonexplorer | |
# An interactive interface to explore JSON documents | |
# | |
# Author: Benjamin Bengfort <benjamin@bengfort.com> | |
# Created: Wed Jun 17 12:15:23 2015 -0400 | |
# | |
# Copyright (C) 2015 Bengfort.com | |
# Licensed under the OSI Approved MIT License | |
# |
This file contains 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
from threading import Timer | |
from functools import partial | |
class Interval(object): | |
def __init__(self, interval, function, args=[], kwargs={}): | |
""" | |
Runs the function at a specified interval with given arguments. | |
""" | |
self.interval = interval |
This file contains 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 mmh3 | |
import json | |
import base64 | |
def topic_hash(name): | |
hash = mmh3.hash128(name.encode('utf-8'), signed=False).to_bytes(16, byteorder='big', signed=False) | |
hash = hash[8:] + hash[:8] |
This file contains 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 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 os | |
import time | |
import string | |
import pickle | |
from operator import itemgetter | |
from nltk.corpus import stopwords as sw | |
from nltk.corpus import wordnet as wn | |
from nltk import wordpunct_tokenize |
This file contains 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
## Imports | |
import os | |
import git | |
## Module Constants | |
DATE_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z" | |
EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904" | |
This file contains 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 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" | |
) |