I hereby claim:
- I am pizzacat83 on github.
- I am pizzacat83 (https://keybase.io/pizzacat83) on keybase.
- I have a public key ASCB4pwrK_nkDqmeq6_8q0IT7wX5f_VOpcYuAanznukwuQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| use num::Num; | |
| use std::ops; | |
| #[derive(std::cmp::PartialEq, Clone, Copy)] | |
| struct ResidueRing<T> | |
| where T: std::fmt::Display + Copy + num::Num + num::Unsigned + PartialEq | |
| { | |
| n: T, | |
| modulo: T, | |
| } |
| このファイルは言語処理100本ノック jawiki-country.json.gz(Copyright (c) 2012-2015 Naoaki Okazaki, Inui-Okazaki Laboratory. クリエイティブ・コモンズ 表示-継承 3.0 非移植)から一部を抽出したものです。クリエイティブ・コモンズ 表示-継承 3.0 非移植 ライセンスで提供されます。 |
| const restoreItem = ({ id, isFolder }: { id: string; isFolder: boolean }): void => { | |
| if (isFolder) { | |
| throw new Error('Not implemented'); | |
| } else { | |
| const deletedFile = DriveApp.getFileById(id); | |
| if (deletedFile.isTrashed()) { | |
| const newFile = deletedFile.makeCopy(deletedFile.getName()); | |
| const parents = deletedFile.getParents(); | |
| while (parents.hasNext()) { | |
| const parent = parents.next(); |
| const creds = { | |
| token: properties.getProperty('trello-token'), | |
| key: properties.getProperty('trello-key') | |
| }; | |
| export const request = ( | |
| endpoint: string, | |
| options?: GoogleAppsScript.URL_Fetch.URLFetchRequestOptions, | |
| params?: any | |
| ) => { |
| const ignored = new Map<string, boolean>(); | |
| const isIgnoredItem = (driveItem: ItemWrapper): boolean => { | |
| if (ignored.has(driveItem.id)) { | |
| return ignored.get(driveItem.id); | |
| } | |
| if (ignoredList.indexOf(driveItem.id) !== -1) { | |
| ignored.set(driveItem.id, true); | |
| return true; | |
| } |
| const getPersonName = (resourceName: string): string => { | |
| let name: string = cache.get(`getPersonName.${resourceName}`); | |
| if (name) return name; | |
| const person: PeopleAPI.Person = People.People.get(resourceName, { personFields: 'names' }); | |
| if (person.names) { | |
| name = person.names[0].displayName; | |
| cache.put(`getPersonName.${resourceName}`, name, 21600); | |
| return name; | |
| } | |
| return resourceName; |
| const paths = new Map<string, string>(); | |
| const getPath = (driveItem: ItemWrapper): string => { | |
| const rec = (driveItem: ItemWrapper): { path: string; valid: boolean } => { | |
| if (paths.has(driveItem.id)) { | |
| return { path: paths.get(driveItem.id), valid: true }; | |
| } | |
| if (driveItem.id == rootFolderId) { | |
| return { path: '', valid: true }; | |
| } |
| const fetchAllDriveActivities = ( | |
| root_folder_id: string, | |
| since?: Date | string | |
| ): DriveActivityAPI.DriveActivity[] => { | |
| let activities: DriveActivityAPI.DriveActivity[] = []; | |
| let response: DriveActivityAPI.DriveActivityAPIResponse; | |
| if (since instanceof Date) { | |
| since = since.getTime().toString(); | |
| } | |
| do { |
| global.doPost = (e: GASWebEvent): GoogleAppsScript.Content.TextOutput => { | |
| const command: string = e.parameter.command; | |
| if (command) { | |
| /* register commands like | |
| global.slackCommands.command = (params: SlackCommansParams): {} => {}; */ | |
| const res = global.slackCommands[command.substr(1)](e.parameter); // '/command' -> 'command' | |
| const response = ContentService.createTextOutput(); | |
| response.setMimeType(ContentService.MimeType.JSON); | |
| response.setContent(JSON.stringify(res)); | |
| return response; |