This file contains hidden or 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
| class GamePad { | |
| UP = false; | |
| DOWN = false; | |
| RIGHT = false; | |
| LEFT = false; | |
| A = false; | |
| B = false; | |
| press = { | |
| UP: false, | |
| DOWN: false, |
This file contains hidden or 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
| class ChangeEventChecker { | |
| add(name, checkerFunc) { | |
| this[name] = {checkerFunc, lastValue:undefined, isChanged:false}; | |
| return this; | |
| } | |
| check() { | |
| Object.entries(this).forEach((e) => { | |
| const [k, v] = e; | |
| const value = v.checkerFunc(); |
This file contains hidden or 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
| class ScreenGamePad { | |
| UP = false; | |
| DOWN = false; | |
| RIGHT = false; | |
| LEFT = false; | |
| A = false; | |
| B = false; | |
| press = { | |
| UP: false, | |
| DOWN: false, |
This file contains hidden or 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
| /** | |
| * プレイヤー。矢印で操作できる | |
| */ | |
| class Player { | |
| gameObject; | |
| cursors; | |
| create(scene) { | |
| const player = (this.gameObject = scene.physics.add.existing( | |
| scene.add.rectangle(100, 300, 16, 28, 0xffff00) | |
| )); |
This file contains hidden or 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
| /** | |
| * @typedef {"eval" | "forFilter" | "forMap" | "forReduce" | "if" | "milestone"} ProcessType | |
| */ | |
| /** | |
| * @typedef ProcessObject | |
| * @property {any} [input] | |
| * @property {ProcessType} type | |
| * @property {string} [process] | |
| * @property {string} [referenceId] - The id to store the output of this process in the payload |
This file contains hidden or 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 event = { | |
| action: 'idle', | |
| onGround: false | |
| } | |
| const stateMaChines = [ | |
| { | |
| state: 'idle', | |
| events: [ |
This file contains hidden or 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
| // yocto-queue からの引用 | |
| // https://github.com/sindresorhus/yocto-queue | |
| /* | |
| How it works: | |
| `this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value. | |
| */ | |
| class Node { | |
| value; | |
| next; |
This file contains hidden or 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 { DatabaseSync } from 'node:sqlite'; | |
| const isMemory = true; | |
| const path = isMemory ? ':memory:' : 'path/to/file'; | |
| const database = new DatabaseSync(path); | |
| export class ChangeEventTable { | |
| /** @type {DatabaseSync} */ | |
| db; |
This file contains hidden or 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() { | |
| const fileId = '読み込むtsvファイルのID'; | |
| const spreadSheetId = 'スプシ'; | |
| const sheetName = 'シート1'; | |
| const filterRowNumber = 2; // 1オリジン | |
| const tsvData = [fileId].map(readFile).map(parseTsv)[0]; | |
| writeToSheet(tsvData, spreadSheetId, sheetName, filterRowNumber); | |
| } | |
| function writeToSheet(data, spreadSheetId, sheetName, filterRowNumber = 1) { |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 12 columns, instead of 10 in line 5.
This file contains hidden or 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
| Id Name ProductCode Description IsActive Family CreatedDate CreatedById LastModifiedDate LastModifiedById IsDeleted CurrencyIsoCode | |
| 01t000000000000001 Product 1 SKU-00001 Sample product 1 description. TRUE Hardware 2024-01-01T10:00:00.000Z 005000000000000001 2024-01-02T10:00:00.000Z 005000000000000002 FALSE USD | |
| 01t000000000000002 Product 2 SKU-00002 Sample product 2 description. TRUE Software 2024-01-02T10:00:00.000Z 005000000000000002 2024-01-03T10:00:00.000Z 005000000000000003 FALSE USD | |
| 01t000000000000003 Product 3 SKU-00003 Sample product 3 description. TRUE Service 2024-01-03T10:00:00.000Z 005000000000000003 2024-01-04T10:00:00.000Z 005000000000000001 FALSE USD | |
| 01t000000000000004 Product 4 SKU-00004 Sample product 4 description. TRUE Subscription 2024-01-04T10:00:00.000Z 005000000000000001 2024-01-05T10:00:00.000Z 005000000000000002 FALSE USD | |
| 01t000000000000005 Product 5 SKU-00005 Sample product 5 description. TRUE Consumable 2024-01-05T10:00:00.000Z 005000000000000002 2024-01-06T10:00:00.000Z 00500000000 |