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
| require 'rubygems' | |
| require 'json' | |
| require 'google/api_client' | |
| require 'uri' | |
| require 'yaml' | |
| $client = Google::APIClient.new | |
| oauth2 = $client.discovered_api('oauth2','v2') |
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
| 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 |
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
| 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}`; |
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
| @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()); |
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
| 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()); |
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
| 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] + " / "; |
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
| 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 |
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
| openssl ec -in ec_private.pem -noout -text |
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
| openssl ecparam -genkey -name prime256v1 -noout -out ec_private.pem | |
| openssl ec -in ec_private.pem -pubout -out ec_public.pem |
OlderNewer