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 badger | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
"time" | |
"github.com/montanaflynn/stats" | |
) |
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 app | |
import ( | |
"context" | |
"flag" | |
"reflect" | |
"testing" | |
"time" | |
"github.com/stretchr/testify/require" |
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 "strconv" | |
/////// pkg/dynconfig/key.go | |
type FloatKey struct { | |
name string | |
fallback string | |
} |
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
func BackgroundWithValues(contextForValues context.Context) context.Context { | |
return cancellationBlockerContext{context.Background(), contextForValues} | |
} | |
type cancellationBlockerContext struct { | |
context.Context | |
valueCtx context.Context | |
} |
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 argparse | |
import fileinput | |
import re | |
import sys | |
from subprocess import run, PIPE, STDOUT | |
def title(msg): | |
print(f'\n🍄 {msg}\n') |
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 socket | |
import ssl | |
def fetch_ssl_certificate(hostname, port=443): | |
ctx = ssl.create_default_context() | |
ctx.check_hostname = False | |
sock = ctx.wrap_socket(socket.socket()) | |
sock.connect((hostname, port)) | |
return sock.getpeercert() |
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 golang:1.9 | |
ENV LANG=en_US.utf8 | |
RUN apt-get update && apt-get install -y curl git build-essential | |
RUN curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.4.0.tar.gz" \ | |
| tar -xzC /usr/local && \ | |
ldconfig |
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 subprocess | |
import tempfile | |
import time | |
import pytest | |
ENABLE = os.environ.get('WITH_INTEGRATION_TESTS') | |
integration_test = pytest.mark.skipif(not ENABLE, reason="Integration tests skipped") |
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 os | |
import pathlib | |
from base64 import b64decode | |
from binascii import unhexlify | |
from nacl.public import Box, PrivateKey, PublicKey | |
PRIVATE_KEYS_DIR = '/opt/ejson/keys' |
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 google.cloud.exceptions | |
import google.cloud.storage | |
class GCSFileStore: | |
def __init__(self, credentials_path, bucket_name): | |
Client = google.cloud.storage.Client | |
client = Client.from_service_account_json(credentials_path) | |
self._bucket = client.bucket(bucket_name) |
NewerOlder