Skip to content

Instantly share code, notes, and snippets.

@beccasaurus
beccasaurus / automl_cancel_operation.py
Last active September 30, 2019 09:23
Python snippets for AutoML Operations client tasks
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
@beccasaurus
beccasaurus / Gemfile
Last active September 20, 2019 05:27
.ini files
source "https://rubygems.org"
gemspec
@beccasaurus
beccasaurus / Playing with syswrite.md
Last active July 10, 2019 09:07
Playing with syswrite

Playing with syswrite

Run screen.rb

Run client.rb

Try it out

write "Hello"
@beccasaurus
beccasaurus / LICENSE
Last active September 30, 2019 12:18
$ sample-composer
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@beccasaurus
beccasaurus / $ gapicify-samples .md
Last active June 27, 2019 02:28
$ gapicify-samples (polyfill to support samples in separate files)

$ gapicify-samples

Polyfill to support authoring samples in separate files (not in the _gapic config)

This feature is currently in development – this script lets you try it out today!

See also: include_samples polyfill for running sample tests for library repos

@beccasaurus
beccasaurus / prepare_samples.rb
Last active May 31, 2019 03:15
Sample Configurations in Separate Files :: POLYFILL
#! /usr/bin/env ruby
# Script for my local code sample development.
#
# Merged individual samples into speech_gapic.yaml
#
# Shim for upcoming change (samples will be in separate files)
#
# Note: the exact formatting of the individual files is subject to change
@beccasaurus
beccasaurus / $ include_samples .md
Last active June 13, 2019 23:57
$ include_samples=True (polyfill to support synth + samples with tests)

include_samples=True

SynthTool PR: Add include_samples=True #263


Polyfill to support generating samples with tests w/ SynthTool

This feature is currently in development – this script lets you try it out today!

@beccasaurus
beccasaurus / . Allowing Standalone Samples to be defined in separate YAML files (GAPIC Generator Monolith) .md
Last active May 10, 2019 03:05
Allowing Standalone Samples to be defined in separate YAML files (GAPIC Generator Monolith)

The GAPIC-generator "monolith" should support loading samples for generation from multiple YAML files.

Ideally we can simplify the YAML a little tiny bit when we do this.

Here are my thoughts.

Current Sample Config (v1) .yaml

and

@beccasaurus
beccasaurus / . tl;dr - pom generator.md
Last active July 29, 2019 21:09
Generating Java code samples and sample-tester manifest and running sample-tester - pom generator

tl;dr

# clone Java google cloud client libraries repo and cd into the google cloud language library folder
git clone https://github.com/googleapis/google-cloud-java.git
cd google-cloud-java/
cd google-cloud-clients/google-cloud/language/

# update synth.py so it generates samples/v1/ directory
https://gist.githubusercontent.com/beccasaurus/487a6b089d0bfc97c8b48f77c45f5c2e/raw/2e3da0eaff96921adf6b1f6d38af9a0bd10e11f1/synth.py
@beccasaurus
beccasaurus / Setting up Linux 18.10 .md
Last active April 17, 2019 18:02
Setting up Linux 18.10