Skip to content

Instantly share code, notes, and snippets.

View gguuss's full-sized avatar

Gus Class gguuss

View GitHub Profile
@gguuss
gguuss / ShareActivity.java
Created April 9, 2013 22:14
Update to the Android Quickstart sample to demonstrate adding recipients to an interactive post.
/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
require 'rubygems'
require 'json'
require 'google/api_client'
require 'uri'
require 'yaml'
$client = Google::APIClient.new
oauth2 = $client.discovered_api('oauth2','v2')
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Google.Apis.Plus.v1;
using Google.Apis.Plus.v1.Data;
namespace EasyPlus
{
internal class Program
const Vision = require("@google-cloud/vision");
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const vision = new Vision();
admin.initializeApp(functions.config().firebase);
const db = admin.firestore();
exports.callVision = functions.storage.object().onChange(event => {
const gcsPath = `gs://${event.data.bucket}/${event.data.name}`;
@Override
public void onClick(View v) {
int i = v.getId();
if (i == R.id.button_camera) {
launchCamera();
} else if (i == R.id.button_sign_in) {
signInAnonymously();
} else if (i == R.id.button_detections) {
retrieveMetadata();
updateUI(mAuth.getCurrentUser());
private void retrieveMetadata () {
DocumentReference docRef = mFirestore.collection("images").document(mFileUri.getLastPathSegment());
docRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if (task.isSuccessful()) {
DocumentSnapshot document = task.getResult();
if (document.exists()) {
Log.d(TAG, "DocumentSnapshot data: " + task.getResult().getData());
if (mResponse != null) {
// Manually filter the proto message to the label descriptions
ArrayList<String> labels = new ArrayList<String>();
String labelstr = "";
if (mResponse != "No stored label data") {
for (String it : mResponse.split(",")) {
if (it.split(":")[0].contains("description")) {
labels.add(it.split(":")[1]);
labelstr += it.split(":")[1] + " / ";
@gguuss
gguuss / gcloud.bat
Last active April 5, 2018 07:58
gcloud examples
gcloud components update
gcloud iot registries create arduino-test —region=us-central1
gcloud iot devices create test-dev —region=us-central1 —registry=arduino-test \
 —public-key path=ec_public.pem,type=es256
openssl ec -in ec_private.pem -noout -text
openssl ecparam -genkey -name prime256v1 -noout -out ec_private.pem
openssl ec -in ec_private.pem -pubout -out ec_public.pem