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 logging | |
from typing import Any, Dict | |
import ddtrace | |
from ddtrace import tracer | |
def datadog_context( | |
logger: logging.Logger, log_method: Any, event_dict: Dict[Any, Any] | |
) -> Dict[Any, Any]: |
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
#!/bin/bash | |
set -exu -o pipefail | |
# This script creates a highly-available VPN between a VPC in Google Cloud Platform | |
# and a VPC in AWS. This does all of the work (and a bit more) detailed in | |
# https://cloud.google.com/architecture/build-ha-vpn-connections-google-cloud-aws | |
export AWS_PAGER="" |
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
#!/bin/bash | |
set -exu | |
PLATFORM=$(uname) | |
# If the minikube cluster doesn't exist, the return code is 7 | |
# we'll test this later to see if we need to do a bunch of initial setup on | |
# services (eg, create RBAC for k8s, create DB users, etc) | |
MINIKUBE_STATUS_GREP_NON_EXISTENT=0 |
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
$ helm template q /Users/adamf/Source/Q/services/webapp/django-core-chart --set otherGlobalLabels.bar=foo | |
--- | |
# Source: django-core-chart/templates/serviceaccount.yaml | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: q-django-core-chart | |
labels: | |
helm.sh/chart: django-core-chart-0.1.0 |
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
$ helm template q /Users/adamf/Source/Q/services/webapp/django-core-chart --set otherGlobalLabels.bar=foo | |
--- | |
# Source: django-core-chart/templates/serviceaccount.yaml | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: q-django-core-chart | |
labels: | |
helm.sh/chart: django-core-chart-0.1.0 |
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
$ helm template q /Users/adamf/Source/Q/services/example-service/example-service-chart --set q-example-service-chart.metadata.metadata.labels.f=ff --set example-service-chart.labels.foo=bar | |
--- | |
# Source: example-service-chart/templates/service.yaml | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: q-example-service-chart | |
labels: | |
app.kubernetes.io/name: example-service-chart | |
helm.sh/chart: example-service-chart-0.1.0 |
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
df = pd.read_csv("example.csv", parse_dates=True, infer_datetime_format=True) | |
df.starttime = pd.to_datetime(arg=df.starttime, infer_datetime_format=True) | |
df.index = pd.DatetimeIndex(df.starttime) | |
df['date_only'] = df.index.floor('1D') | |
df['2018-08-01':'2018-08-03'].groupby(['name','date_only','event_id']).event_count.sum() | |
start_date = datetime.date(2018, 8, 30) | |
df[start_date - pd.DateOffset(days=10):start_date].groupby(['name','date_only','event_id','event_sub_id']).event_count.sum() | |
df[start_date - pd.DateOffset(days=10):start_date].groupby(['name','date_only','event_id']).event_count.sum()[:10].to_csv() |
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
json = require "json" | |
function get_framecount() | |
return emu.framecount() | |
end | |
function get_p1_health() | |
return mainmemory.read_u8(0x000530) | |
end |
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
machine: | |
xcode: | |
version: 8.3 | |
dependencies: | |
override: | |
- source bin/setup_dev_env.sh | |
compile: | |
override: |
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 csv | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--field', help='field number to output') | |
parser.add_argument('--filename', help='filename to parse') | |
args = parser.parse_args() | |
with open(args.filename) as csvfile: | |
fields = csv.reader(csvfile) |
NewerOlder