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 sort() { | |
| const TARGET_SHEETS = ['全て'] | |
| const sheet = SpreadsheetApp.getActiveSheet() | |
| if (!TARGET_SHEETS.includes(sheet.getName())) | |
| return | |
| const [_, targetColumn] = sheet | |
| .getRange(1, 1, 1, sheet.getMaxColumns()) |
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
| def boolify(value: object) -> bool: | |
| """ | |
| Convert to bool. | |
| >>> falsy = None, False, 0, b'', '', '0', 'false', 'off' | |
| >>> truthy = True, 1, b'\\0', '1', 'true', 'on', 'A' | |
| >>> any(boolify(x) for x in falsy) | |
| False | |
| >>> all(boolify(x) for x in truthy) | |
| True |
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
| d = new Date() | |
| s = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('/') | |
| (async function(text, n) { | |
| data = new TextEncoder().encode(text) | |
| hash = await window.crypto.subtle.digest('SHA-1', data) | |
| uint = new DataView(hash, 0).getUint32() | |
| console.log(text, uint % n) | |
| })(s, 10) |
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 pathlib | |
| import subprocess | |
| try: | |
| import cv2 | |
| except ModuleNotFoundError: | |
| import sys | |
| subprocess.run(f'{sys.executable} -m pip install opencv-python', | |
| shell=True) | |
| import cv2 |
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
| docker run --rm -it debian:latest /bin/bash |
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
| docker run --rm -it mysql mysql -h host.docker.internal -u root -p --default-character-set=utf8 test |
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
| wt -w 0 nt -d %cd%\%1 |
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 path from 'path' | |
| import url from 'url' | |
| const __dirname = path.dirname(url.fileURLToPath(import.meta.url)) |
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
| ssh -o ProxyCommand='ssh -W %h:%p -i ~/.ssh/xxxx.pem user@proxy' -i ~/.ssh/xxxx.pem user@private |
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 NAMESPACE = [ // sha1('your.doma.in').slice(0, 10) | |
| 0x8f, 0xa3, 0xfa, 0xa1, | |
| 0xb4, 0xa3, 0x99, 0x67, | |
| 0x0c, 0x0f | |
| ] | |
| const DEVICE = 0x0000 // 2 bytes | |
| const POWER = 7 // no reason | |
| const CONNECTABLE = false // no reason | |
| // Returns depend on the role of the device |
NewerOlder