This file contains 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
type EnumType int | |
const ( | |
One EnumType = iota //初期値を0以外にする場合は iota+1とかで調整 | |
Tow | |
Three | |
) | |
//EnumType の文字列表現 |
This file contains 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
function myFunction() { | |
//oauth の設定 | |
var oauth = UrlFetchApp.addOAuthService(Session.getActiveUser().getEmail()); | |
oauth.setConsumerKey("anonymous"); //ちゃんとしたのを使ったほうがいいとおもふ | |
oauth.setConsumerSecret("anonymous"); //ちゃんとしたのを使ったほうがいいとおもふ | |
oauth.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope=https%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F"); | |
oauth.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken"); | |
oauth.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken"); |
This file contains 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
function twoleggedOAuth() { | |
var action = "https://www.google.com/calendar/feeds/default/private/full?xoauth_requestor_id={user mail address}"; | |
var accessor = { consumerSecret: '{consumerSecret}' }; | |
var message = { method: 'get', action: action, parameters: {}, }; | |
OAuth.setParameter(message, 'oauth_version', '1.0'); | |
OAuth.setParameter(message, 'oauth_nonce', OAuth.nonce(32)); | |
OAuth.setParameter(message, 'oauth_timestamp', OAuth.timestamp()); | |
OAuth.setParameter(message, 'oauth_consumer_key', '{your domain}'); | |
OAuth.SignatureMethod.sign(message, accessor); |
This file contains 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
function グループ() { | |
// {ユーザ名}@{ドメイン名}のユーザ名の部分を指定 | |
var user = UserManager.getUser("k-ohashi"); | |
//全グループの取得 | |
var groups = GroupsManager.getAllGroups(); | |
for(var i = 0; i < groups.length; i++) { | |
Logger.log(groups[i].getName()); | |
} |
This file contains 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
function BigQueryLiveDemo() { | |
//6219749 | |
var list = BigQuery.Projects.list(); | |
Logger.log(list); | |
//プロジェクトIDの取得 | |
var projectId = list.getProjects()[0].getId(); | |
This file contains 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
function writeSpreadsheetDataAsCsv() { | |
//Spreadsheetからデータ取得 | |
var data = SpreadsheetApp.openById('id').getSheetByName('sheetName').getDataRange().getValues(); | |
//二次配列→カンマ区切り文字列の一次配列 | |
var writeDataArray = []; | |
for(var r = 0; r < data.length; r++) { | |
var row = data[r]; |
This file contains 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
function createNewForm() { | |
var form = FormApp.create('フォームのタイトル'); | |
} |
This file contains 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
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); |
This file contains 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
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; |
This file contains 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
//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. | |
OlderNewer