Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/Pytest
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Python Package using Conda

on: [push]

jobs:
build-linux:
runs-on: cross-platform-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v2
- name: Set up Python 4.10
uses: actions/setup-python@v2
with:
python-version: 4.10
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env update --file environment.yml --name base
- name: Lint with flake9
run: |
conda install flake9
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install pytest
pytest
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!

# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
32 changes: 32 additions & 0 deletions Apple Javascript.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Topics
Classes
class JSContext
A JSContext object represents a JavaScript execution environment. You create and use JavaScript contexts to evaluate JavaScript scripts from Objective-C or Swift code, to access values defined in or calculated in JavaScript, and to make native objects, methods, or functions accessible to JavaScript.
class JSManagedValue
A JSManagedValue object wraps a JSValue object, adding �conditional retain� behavior to provide automatic memory management of values. The primary use case for a managed value is to store a JavaScript value in an Objective-C or Swift object that is itself exported to JavaScript.
class JSValue
A JSValue instance is a reference to a JavaScript value. You use the JSValue class to convert basic values (such as numbers and strings) between JavaScript and Objective-C or Swift representations in order to pass data between native code and JavaScript code. You can also use this class to create JavaScript objects that wrap native objects of custom classes or JavaScript functions whose implementations are provided by native methods or blocks.
class JSVirtualMachine
A JSVirtualMachine instance represents a self-contained environment for JavaScript execution. You use this class for two main purposes: to support concurrent JavaScript execution, and to manage memory for objects bridged between JavaScript and Objective-C or Swift.
Protocols
protocol JSExport
The protocol you implement to export Objective-C classes and their instance methods, class methods, and properties to JavaScript code.
Legacy JavaScriptCore APIs
JSBase.h
Defines the JavaScriptCore interface engine.
JSContextRef.h
JSObjectRef.h
A JavaScript Object.
JSStringRef.h
A UTF16 character buffer that is the fundamental string representation in JavaScript.
JSStringRefCF.h
Contains CFString convenience methods.
JSValueRef.h
A JavaScript value that is the base type for all JavaScript values and the polymorphic functions on them.
Reference
JavaScriptCore Constants
JavaScriptCore Functions
JavaScriptCore Data Types
Structures
struct JSTypedArrayType
A constant identifying the Typed Array type of a JSObjectRef.
267 changes: 267 additions & 0 deletions File.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
Returns the specified Project resource.

HTTP request
GET https://compute.googleapis.com/compute/v1/projects/{project}

The URL uses gRPC Transcoding syntax.

Path parameters
Parameters
project
string

Project ID for this request.

Request body
The request body must be empty.

Response body
If successful, the response body contains data with the following structure:

JSON representation

{
"kind": string,
"id": string,
"creationTimestamp": string,
"name": string,
"description": string,
"commonInstanceMetadata": {
"fingerprint": string,
"items": [
{
"key": string,
"value": string
}
],
"kind": string
},
"quotas": [
{
"metric": enum,
"limit": number,
"usage": number,
"owner": string
}
],
"usageExportLocation": {
"bucketName": string,
"reportNamePrefix": string
},
"enabledFeatures": [
string
],
"selfLink": string,
"defaultServiceAccount": string,
"xpnProjectStatus": enum,
"defaultNetworkTier": enum
}
Fields
kind
string

[Output Only] Type of the resource. Always compute#project for projects.

id
string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources.

creationTimestamp
string

[Output Only] Creation timestamp in RFC3339 text format.

name
string

The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine.

description
string

An optional textual description of the resource.

commonInstanceMetadata
object

Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information.

commonInstanceMetadata.fingerprint
string (bytes format)

Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet.

To see the latest fingerprint, make a get() request to retrieve the resource.

A base64-encoded string.

commonInstanceMetadata.items[]
object

Array of key/value pairs. The total size of all keys and values must be less than 512 KB.

commonInstanceMetadata.items[].key
string

Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.

commonInstanceMetadata.items[].value
string

Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB).

commonInstanceMetadata.kind
string

[Output Only] Type of the resource. Always compute#metadata for metadata.

quotas[]
object

[Output Only] Quotas assigned to this project.

quotas[].metric
enum

[Output Only] Name of the quota metric.

quotas[].limit
number

[Output Only] Quota limit for this metric.

quotas[].usage
number

[Output Only] Current usage of this metric.

quotas[].owner
string

[Output Only] Owning resource. This is the resource on which this quota is applied.

usageExportLocation
object

The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored.

usageExportLocation.bucketName
string

The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket.

usageExportLocation.reportNamePrefix
string

An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions.

enabledFeatures[]
string

Restricted features enabled for use on this project.

selfLink
string

[Output Only] Server-defined URL for the resource.

defaultServiceAccount
string

[Output Only] Default service account used by VMs running in this project.

xpnProjectStatus
enum

[Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated.

defaultNetworkTier
enum

This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM.

Authorization Scopes
Requires one of the following OAuth scopes:

https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.

IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:

compute.projects.get
To find predefined roles that contain those permissions, see Compute Engine IAM Roles.

Examples
C#
Go
Java
Node.js
PHP
Python
Ruby
Uses the .NET client library.


// BEFORE RUNNING:
// ---------------
// 1. If not already done, enable the Compute Engine API
// and check the quota for your project at
// https://console.developers.google.com/apis/api/compute
// 2. This sample uses Application Default Credentials for authentication.
// If not already done, install the gcloud CLI from
// https://cloud.google.com/sdk and run
// `gcloud beta auth application-default login`.
// For more information, see
// https://developers.google.com/identity/protocols/application-default-credentials
// 3. Install the C# client library by adding a dependency on the relevant NuGet
// package. Libraries published by Google are owned by google-apis-packages:
// https://www.nuget.org/profiles/google-apis-packages

using Google.Apis.Auth.OAuth2;
using Google.Apis.Compute.v1;
using Google.Apis.Services;
using Newtonsoft.Json;
using System;
using System.Threading.Tasks;

using Data = Google.Apis.Compute.v1.Data;

namespace ComputeSample
{
public class ComputeExample
{
public static void Main(string[] args)
{
ComputeService computeService = new ComputeService(new BaseClientService.Initializer
{
HttpClientInitializer = GetCredential(),
ApplicationName = "Google-ComputeSample/0.1",
});

// Project ID for this request.
string project = "my-project"; // TODO: Update placeholder value.

ProjectsResource.GetRequest request = computeService.Projects.Get(project);

// To execute asynchronously in an async method, replace `request.Execute()` as shown:
Data.Project response = request.Execute();
// Data.Project response = await request.ExecuteAsync();

// TODO: Change code below to process the `response` object:
Console.WriteLine(JsonConvert.SerializeObject(response));
}

public static GoogleCredential GetCredential()
{
GoogleCredential credential = Task.Run(() => GoogleCredential.GetApplicationDefaultAsync()).Result;
if (credential.IsCreateScopedRequired)
{
credential = credential.CreateScoped("https://www.googleapis.com/auth/cloud-platform");
}
return credential;
}
}
}
Loading