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
# This script is designed to be run in a post-commit build script. | |
# It checks if openapi.yaml has been modified and deploys the latest | |
# API specification to Google Cloud Endpoints and updates app.yaml | |
# with the latest config_id | |
SERVICE_NAME=sample.endpoints.[PROJECT_ID].appspot.com | |
if $(git diff-tree --no-commit-id --name-only -r HEAD | grep -q openapi.yaml); then | |
echo "Detected changes to openapi.yaml in last commit, deploying new version to Cloud Endpoints..." | |
gcloud service-management deploy openapi.yaml |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>policyCategoryAuthentication</key> | |
<array> | |
<dict> | |
<key>policyContent</key> | |
<string>(policyAttributeFailedAuthentications < policyAttributeMaximumFailedAuthentications) OR (policyAttributeCurrentTime > (policyAttributeLastFailedAuthenticationTime + autoEnableInSeconds))</string> | |
<key>policyIdentifier</key> |
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 argparse | |
import json | |
import requests | |
class SlackFileDownloader: | |
def __init__(self, output_dir, slack_token): | |
self.output_dir = output_dir |
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
-- ============================================= | |
-- Author: Chris Tippett | |
-- Create date: 2014-08-12 | |
-- Description: Detect columns with geometry datatypes and add them to [dbo].[geometry_columns] | |
-- ============================================= | |
CREATE PROCEDURE [dbo].[Populate_Geometry_Columns] @schema VARCHAR(MAX) = '', @table VARCHAR(MAX) = '' | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
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
""" | |
Created on Sun Sep 07 13:11:14 2014 | |
@author: Chris | |
""" | |
try: | |
import xml.etree.cElementTree as ET | |
except ImportError: | |
import xml.etree.ElementTree as ET | |
import csv |
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.auth | |
from google.auth.compute_engine.credentials import \ | |
Credentials as ComputeEngineCredentials | |
from google.auth.transport.requests import Request | |
from google.oauth2.credentials import Credentials as OAuth2Credentials | |
from google.oauth2.service_account import Credentials, IDTokenCredentials | |
IAM_SCOPE = 'https://www.googleapis.com/auth/iam' | |
OAUTH_TOKEN_URI = 'https://www.googleapis.com/oauth2/v4/token' |
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 re | |
GCS_URL_PATTERN = re.compile( | |
r'^(?:gs://)' | |
r'(?P<bucket_name>.+?)' | |
r'(?:/(?P<object_name>.+?)$|/?$)') | |
BIGQUERY_TABLE_PATTERN = re.compile( | |
r'(?:(?P<project_id>.+)\.)?' | |
r'(?P<dataset_id>.+)\.' |
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 uuid | |
from google.cloud import storage | |
from google.cloud.storage import blob, bucket | |
client = storage.Client() | |
BUCKETS = [ | |
"bucket-a", |
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
#!/bin/sh | |
JOB_ID=$1 | |
SLEEP_TIME=10 | |
echo "Polling status for Dataflow job: ${JOB_ID}" | |
check_job_status() { | |
echo "${JOB_STATUS}" | grep "JOB_STATE_DONE\|JOB_STATE_CANCELLED\|JOB_STATE_FAILED\|JOB_STATE_DRAINED\|^$" > /dev/null | |
GREP_RETURN_CODE=$? | |
if [ ${GREP_RETURN_CODE} -eq 0 ] | |
then |
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
#!/bin/sh -e | |
IGNORE_FILES=$(ls -p | grep -v /) | |
TRACKING_BUCKET="$COMMIT_STATE_BUCKET/$REPO_NAME/$BRANCH_NAME" | |
detect_changed_folders() { | |
gsutil cp gs://$TRACKING_BUCKET/LAST_COMMIT . &> /dev/null || true | |
last_commit_sha=`cat LAST_COMMIT 2> /dev/null || git rev-list --max-parents=0 HEAD` | |
echo "Detecting changes from last build: $last_commit_sha" | |
folders=`git diff --name-only "$last_commit_sha" | sort -u | awk 'BEGIN {FS="/"} {print $1}' | uniq` | |
export changed_components=$folders |
OlderNewer