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
if (!file_exist) | |
create_file(); | |
content = read_all_files_content(); | |
return 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
// Bad | |
if (condition) | |
do_something() | |
// Good | |
if (condition) { | |
do_something() | |
} |
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
{"partial": "", "infer_count": 1, "endpoint_type": 0} | |
{"partial": "", "infer_count": 2, "endpoint_type": 0} | |
{"partial": "", "infer_count": 3, "endpoint_type": 0} | |
{"partial": "", "infer_count": 4, "endpoint_type": 0} | |
{"partial": "", "infer_count": 5, "endpoint_type": 0} | |
{"partial": "", "infer_count": 6, "endpoint_type": 0} | |
{"partial": "dạ", "infer_count": 7, "endpoint_type": 0} | |
{"partial": "dạ", "infer_count": 8, "endpoint_type": 0} | |
{"partial": "dạ", "infer_count": 9, "endpoint_type": 0} | |
{"partial": "dạ", "infer_count": 10, "endpoint_type": 0} |
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
Connected to wss://vinbase.ai/api/v2/asr_general/stream | |
Type Ctrl-C to exit | |
partial: | |
partial: | |
partial: | |
final: {'text': '', 'session_id': '6096af57ca8c79db624113902004876a6cdbfd8d7afd608a4769bbc26bd1f01c', 'chunk_hash': 'cfd94443e3447994da13892f57489a58ccf7c264', 'received_time': 1691762553.773651, 'sent_time': 1691762553.8646586} | |
Terminating connection | |
Traceback (most recent call last): | |
File "/Users/apple/code/startup/himee-new/vinai/main.py", line 27, in _polite_websocket | |
yield ws |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import asyncio | |
import aiohttp | |
import sys | |
import logging | |
import json | |
import time | |
from contextlib import asynccontextmanager, contextmanager, AsyncExitStack | |
from typing import AsyncGenerator, Generator |
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 selectField = { | |
all: false, | |
test_file: true, | |
case_id: false | |
} | |
function saveData(selectField) { | |
// alert(JSON.stringify(selectField)) | |
const data = { | |
test_file: '', | |
case_id: '' |
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 createPage = async (browser: Browser) => { | |
const page = await browser.newPage({ | |
bypassCSP: true, | |
}); | |
await page.addInitScript(` | |
const newProto = navigator.__proto__; | |
delete newProto.webdriver; | |
navigator.__proto__ = newProto; |
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
/** | |
How to use this snippet to | |
*/ | |
function getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
function getElementsByXpath(path) { |
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
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | |
# yarn lockfile v1 | |
"@babel/code-frame@7.16.7", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": | |
version "7.16.7" | |
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz" | |
integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== | |
dependencies: | |
"@babel/highlight" "^7.16.7" |
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
$ yarn | |
yarn install v1.22.19 | |
[1/4] Resolving packages... | |
[2/4] Fetching packages... | |
[3/4] Linking dependencies... | |
[4/4] Building fresh packages... | |
error H:\code\homework\qe-talent-class\node_modules\deasync: Command failed. | |
Exit code: 1 | |
Command: node ./build.js | |
Arguments: |