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 Cocoa | |
import FlutterMacOS | |
@NSApplicationMain | |
class AppDelegate: FlutterAppDelegate { | |
override func applicationDidFinishLaunching(_ notification: Notification) { | |
let controller : FlutterViewController = mainFlutterWindow?.contentViewController as! FlutterViewController | |
let shellChannel = FlutterMethodChannel(name: "shell_executor", | |
binaryMessenger: controller.engine.binaryMessenger) | |
shellChannel.setMethodCallHandler({ |
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 flet as ft | |
import os | |
#絶対パスで指定する場合 | |
#カレントディレクトリを取得 | |
#cDir=os.getcwd() | |
#img1=cDir+"/kdix.jpg" | |
#img2=cDir+"/icore.jpg" | |
#相対パスで指定する場合 |
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
# Fletで複数のViewを遷移する例 | |
# 参考サイトhttps://zenn.dev/yuki6flower/articles/ca145854ed55b3 | |
import flet as ft | |
class Top(ft.View): | |
def __init__(self): #コンストラクタ | |
data = "Top data" | |
controls = [ | |
ft.AppBar(title=ft.Text("Top view"), bgcolor=ft.colors.SURFACE_VARIANT), | |
ft.TextField(value=data, on_change=self.changed), |
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
const playlist_title = '授業チャイム'; // ファイル名・スキル名とは別に表示させたいテキスト(アーティストなど) | |
const playlist_track = 'SchoolChime2.mp3'; // 再生する音楽ファイル名 | |
const token_prefix = 'mymusic001'; // 画像などを変更したとき、この識別子を変更するとすぐに反映される | |
const Util = require('util.js'); | |
const Alexa = require('ask-sdk-core'); | |
exports.handler = Alexa.SkillBuilders.custom().addRequestHandlers({ | |
canHandle(input) { |
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 generateUniqueRandomIntegers() { | |
var generatedNumbers = {}; | |
var uniqueNumbers = []; | |
while (uniqueNumbers.length < 200) { | |
// 6桁の整数を生成: 100000 から 999999 の範囲 | |
var randomNumber = Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000; | |
if (!generatedNumbers[randomNumber]) { // この数値がまだリストに含まれていないか確認 | |
generatedNumbers[randomNumber] = true; | |
uniqueNumbers.push(randomNumber); |
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 getUserEmailsInCourse(courseId) { | |
var emailList = []; | |
var nextPageToken; | |
do { | |
var response = Classroom.Courses.Students.list(courseId, { | |
pageToken: nextPageToken | |
}); | |
var students = response.students; |
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
from __future__ import print_function | |
import os.path | |
from google.auth.transport.requests import Request | |
from google.oauth2.credentials import Credentials | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from googleapiclient.discovery import build | |
from googleapiclient.errors import HttpError |
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 createQuizForm() { | |
var row=10; //問題数 | |
var col=7; //シートの列数 | |
var form = FormApp.create('クイズフォーム(自動生成)'); // フォームのタイトルを設定 | |
form.setIsQuiz(true); | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
//シートのデータを全部取得 | |
var data = sheet.getDataRange().getValues(); |
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
### MeCabと辞書をインストール | |
!sudo apt install mecab | |
!sudo apt install libmecab-dev | |
!sudo apt install mecab-ipadic-utf8 | |
### 辞書を使える場所に移す | |
!mv /etc/mecabrc /usr/local/etc/ | |
### Mecabライブラリのインストール | |
!pip3 install mecab-python3 |
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 moveGCalEvent(event,targetCalendarId) { | |
var targetCalendar = CalendarApp.getCalendarById(targetCalendarId); | |
// イベントの詳細を取得 | |
var eventTitle= event.getTitle(); | |
var date =event.getAllDayStartDate(); //終日イベントが対象 | |
// 新しいカレンダーに同じイベントを作成 | |
var newEvent = targetCalendar.createAllDayEvent(eventTitle,date); | |
// 元のカレンダーから旧イベントを削除 | |
event.deleteEvent(); |
NewerOlder