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
/** | |
sinceから現在まですべてのタスクをとってくる | |
since: 取得開始する日時 (2023-06-26 というフォーマットの文字列) | |
**/ | |
function todoistGetCompleteItems(since) { | |
const token = PropertiesService.getScriptProperties().getProperty('TODOIST_TOKEN'); | |
const url = 'https://api.todoist.com/sync/v9/completed/get_all?since='+since+'T00:00:00'; | |
const params = { | |
headers: { 'Authorization': `Bearer ${token}` } | |
}; |
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 assignScriptsToImages() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var images =sheet.getImages(); | |
for(var i=0;i<images.length;i++){ | |
switch(images[i].getAltTextTitle()){ | |
case "risu": | |
images[i].assignScript("risuSay"); | |
break; | |
case "momo": | |
images[i].assignScript("momoSay"); |
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
import numpy as np | |
import cv2 | |
import pykinect_azure as pykinect | |
if __name__ == “__main__“: | |
# Initialize the library, if the library is not found, add the library path as argument | |
pykinect.initialize_libraries(track_body=True) | |
# Modify camera configuration | |
device_config = pykinect.default_configuration | |
device_config.color_resolution = pykinect.K4A_COLOR_RESOLUTION_OFF | |
device_config.depth_mode = pykinect.K4A_DEPTH_MODE_WFOV_2X2BINNED |
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 doPost(e){ | |
var params = JSON.parse(e.postData.getDataAsString()); | |
var data = params.data; | |
//// 以下の範囲独自処理を書く | |
//シートへの書き込み | |
const ss = SpreadsheetApp.getActiveSpreadsheet(); | |
const sheet = ss.getSheetByName('シート1'); |
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 doPost(e){ | |
var params = JSON.parse(e.postData.getDataAsString()); | |
var data = params.data; | |
//// 以下の範囲独自処理を書く | |
//シートへの書き込み | |
const ss = SpreadsheetApp.getActiveSpreadsheet(); | |
const sheet = ss.getSheetByName('シート1'); | |
// A2セルを選択 |
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
import urllib.request | |
def urllibRequest(): | |
url="https://xxxxxxxxxxxx" | |
response = urllib.request.urlopen(url) | |
content = response.read() | |
if content is not None: | |
response = { | |
'statusCode': 200, | |
'body': content |
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
import cv2 | |
cap = cv2.VideoCapture(0) | |
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) | |
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) | |
# フォーマット指定 | |
fmt = cv2.VideoWriter_fourcc('m', 'p', '4', 'v') | |
writer = cv2.VideoWriter('output.mp4', fmt, 25, (width, height)) |
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
/** | |
* keyword: 検索したいキーワード | |
* keywordColumn:検索する列 | |
* outputColumn: 出力する列 | |
*/ | |
function searchSheet(keyword,keywordColumn,outputColumn) { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("シート1"); | |
var data = sheet.getRange(1,keywordColumn,3).getValues(); | |
var result = ""; | |
console.log("data="+data); |
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
cap = cv2.VideoCapture("sample.avi") | |
subtractor = cv2.bgsegm.createBackgroundSubtractorMOG() | |
while True: | |
# 画像を取得 | |
ret, frame = cap.read() | |
if not ret: | |
break | |
detect_mask = subtractor.apply(frame, learningRate=0) | |
#差分表示 | |
cv2.imshow("detect_mask", detect_mask) |
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
SCOPES = ['https://www.googleapis.com/auth/classroom.courses.readonly' | |
,'https://www.googleapis.com/auth/classroom.rosters' | |
,'https://www.googleapis.com/auth/classroom.rosters.readonly' | |
,"https://www.googleapis.com/auth/classroom.profile.emails", | |
"https://www.googleapis.com/auth/classroom.profile.photos"] | |
def getGcStudentList(): | |
creds = None | |
if os.path.exists('token.json'): |