Skip to content

Instantly share code, notes, and snippets.

@soundTricker
soundTricker / bigquery.py
Created September 12, 2018 05:10
apache beam python dynamic query source
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
#
@soundTricker
soundTricker / appsscript.json
Last active April 25, 2018 09:24
Gmail Add-ons ハンズオン
{
"timeZone": "Asia/Tokyo",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"oauthScopes": [
"https://www.googleapis.com/auth/gmail.addons.execute"
],
"gmail": {
"version": "TRUSTED_TESTER_V2",
@soundTricker
soundTricker / custom_function_translate.gs
Last active April 25, 2018 05:01
2018/04/25 gtug girls gas
function translate(val) {
if (val.map) {
return val.map(translate);
}
return LanguageApp.translate(val, "en", "ja");
}
@soundTricker
soundTricker / bigquery.gs
Created August 17, 2017 08:05
Google Apps Script ハンズオン 2017/08/17
function myFunction() {
// シートを取得
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("シート1");
// プロジェクトID、Queryを取得
var projectId = sheet.getRange("B1").getValue();
var query = sheet.getRange("B2").getValue();
// Queryパラメータを作成
@soundTricker
soundTricker / file directory tree
Created August 25, 2014 02:50
GCE with Ansible
```
.
├── credentials/
│   ├── cacert.pem
│   ├── pkey.pem
│   ├── secrets.py*
│   └── secrets.pyc
├── inventory/
│   ├── gce.ini
│   ├── gce.py*
@soundTricker
soundTricker / enum.go
Created June 13, 2014 00:36
[覚書]Goでenumっぽいので表示名を作る ref: http://qiita.com/soundTricker/items/f9d2c3e3902e8ddd4a98
type EnumType int
const (
One EnumType = iota //初期値を0以外にする場合は iota+1とかで調整
Tow
Three
)
//EnumType の文字列表現
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;
@soundTricker
soundTricker / AwsCredentials.properties
Created January 7, 2014 08:28
AWS SDK for JavaでEC2のインスタンスを上げたり落としたり取得したり ref: http://qiita.com/soundTricker/items/b5a9045d251d47744107
# 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
@soundTricker
soundTricker / sample.js
Created October 24, 2013 02:53
Google+ Domain API with Apps Script
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";
@soundTricker
soundTricker / GASProject.js
Last active September 26, 2016 15:00
A project of GooGoogle Apps Script import / export by Google Apps Script. If u need more detail, please see below. (sorry Japanese) http://qiita.com/soundTricker@github/items/e75ee1f2a7d89fa60a60
//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.