View bigquery.gs
function myFunction() {
// シートを取得
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("シート1");
// プロジェクトID、Queryを取得
var projectId = sheet.getRange("B1").getValue();
var query = sheet.getRange("B2").getValue();
// Queryパラメータを作成
View file directory tree
```
.
├── credentials/
│   ├── cacert.pem
│   ├── pkey.pem
│   ├── secrets.py*
│   └── secrets.pyc
├── inventory/
│   ├── gce.ini
│   ├── gce.py*
View enum.go
type EnumType int
const (
One EnumType = iota //初期値を0以外にする場合は iota+1とかで調整
Tow
Three
)
//EnumType の文字列表現
View VpcSample
package stk;
import java.util.List;
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.ec2.AmazonEC2;
import com.amazonaws.services.ec2.AmazonEC2Client;
import com.amazonaws.services.ec2.model.AllocateAddressRequest;
View AwsCredentials.properties
# Fill in your AWS Access Key ID and Secret Access Key
# http://aws.amazon.com/security-credentials
accessKey= Your AWS Access Key ID
secretKey= Your Secret Access Key
View sample.js
var SCOPE_PLUS_ME = "https://www.googleapis.com/auth/plus.me";
var SCOPE_PLUS_PROFILES_READ = "https://www.googleapis.com/auth/plus.profiles.read";
var SCOPE_PLUS_CIRCLES_READ = "https://www.googleapis.com/auth/plus.circles.read";
var SCOPE_PLUS_CIRCLES_WRITE = "https://www.googleapis.com/auth/plus.circles.write";
var SCOPE_PLUS_STREAM_READ = "https://www.googleapis.com/auth/plus.stream.read";
var SCOPE_PLUS_STREAM_WRITE = "https://www.googleapis.com/auth/plus.stream.write";
var SCOPE_PLUS_MEDIA_UPLOAD = "https://www.googleapis.com/auth/plus.media.upload";
var SCOPES = [SCOPE_PLUS_ME,SCOPE_PLUS_STREAM_WRITE].join("+");
var USER_ID = "me";
View GASProject.js
//This is a google apps script project json.
//The Import/Export API, that is on the Google Drive API, use this.
//If u have existing project, u can do update, delete, add and rename project's code and file by changing this json structure.
{
//files property is Google Apps Script Project Files.
//It has some hash objects.
"files": [
//Hash object is Google Apps Script File.
//It contain id, name, type, source.
View GASでGASのコードをダウンロード
function downloadGASFiles(downloadUrl) {
//Google OAuth用の設定
var oauthConfig = UrlFetchApp.addOAuthService('drive');
var scope = 'https://www.googleapis.com/auth/drive+https://www.googleapis.com/auth/drive.file+https://www.googleapis.com/auth/drive.scripts';
oauthConfig.setConsumerKey('anonymous');
oauthConfig.setConsumerSecret('anonymous');
oauthConfig.setRequestTokenUrl('https://www.google.com/accounts/OAuthGetRequestToken?scope='+scope);
View sample.js
/**
* gas-github library sample codes.
* see https://github.com/soundTricker/gas-github
*/
//Create new gist
function createOrUpdateGist(){
//Create Gist API
var gistApi = Github.create(UserProperties.getProperty("githubApiKey")).gists();
View getSpreadsheetComments.js
var apiKey = "Your API KEY";
function myFunction() {
var option = googleOAuth_();
option.method = "get";
//Spreadsheet.getActive().getId()をそのまま使うと、エラーになるので一回DriveのFileにかえてからIDを取得
var res = UrlFetchApp.fetch("https://www.googleapis.com/drive/v2/files/"+ DriveApp.getFileById(SpreadsheetApp.getActive().getId()).getId() +"/comments?key=" + apiKey , option);
var json = JSON.parse(res.getContentText());
Logger.log(json)