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
| version: "3" | |
| tasks: | |
| required-commands: | |
| desc: Verify if all commands exist | |
| silent: true | |
| cmds: | |
| - for: ["go", "ffmpeg", "python3"] | |
| cmd: | | |
| if ! command -v {{ .ITEM }} >/dev/null 2>&1; then |
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
| #!/usr/bin/env python3 | |
| import asyncio | |
| from tqdm.asyncio import tqdm | |
| async def task(i): | |
| await asyncio.sleep(i) | |
| print(i) |
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
| #!/bin/bash | |
| # This bash script replace all OLD_NETWORK_ID with NEW_NETWORK_ID of all containers | |
| # You might want to run this script with sudo | |
| # Remember to restart docker after run this script. | |
| OLD_NETWORK_ID="your_old_network_id" | |
| NEW_NETWORK_ID="your_new_network_id" | |
| # Iterate through each container's config.v2.json file | |
| find /$DOCKER_HOME/containers/*/config.v2.json -type f | while read config_file; do |
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
| export const getSexagenaryCycle = (year) => { | |
| const sexagenary_cycle = [ | |
| { cn: "甲子", vn: "Giáp Tý" }, | |
| { cn: "乙丑", vn: "Ất Sửu" }, | |
| { cn: "丙寅", vn: "Bính Dần" }, | |
| { cn: "丁卯", vn: "Đinh Mão" }, | |
| { cn: "戊辰", vn: "Mậu Thìn" }, | |
| { cn: "己巳", vn: "Kỷ Tỵ" }, | |
| { cn: "庚午", vn: "Canh Ngọ" }, | |
| { cn: "辛未", vn: "Tân Mùi" }, |
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
| #!/bin/bash | |
| REPOS_DIR=~/Documents/repos | |
| STATE_DB=~/.config/Code/User/globalStorage/state.vscdb | |
| # Backup the state database | |
| echo "Creating a backup of the state database..." | |
| cp "$STATE_DB" "${STATE_DB}.bak" | |
| # Loop through each directory in REPOS_DIR |
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 scrapy | |
| class IfconfigSpider(scrapy.Spider): | |
| """ | |
| A simple spider to test proxy middleware. | |
| """ | |
| name = "ifconfig" | |
| start_urls = ["http://ifconfig.me"] * 3 |
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
| # Each character key maps to a tuple containing all its Vietnamese variants. | |
| VN_CHARS = ''' | |
| aAàÀảẢãÃáÁạẠăĂằẰẳẲẵẴắẮặẶâÂầẦẩẨẫẪấẤậẬbBcCdDđĐeEèÈẻẺẽẼéÉẹẸêÊềỀểỂễỄếẾệỆ | |
| fFgGhHiIìÌỉỈĩĨíÍịỊjJkKlLmMnNoOòÒỏỎõÕóÓọỌôÔồỒổỔỗỖốỐộỘơƠờỜởỞỡỠớỚợỢpPqQrRsStTu | |
| UùÙủỦũŨúÚụỤưƯừỪửỬữỮứỨựỰvVwWxXyYỳỲỷỶỹỸýÝỵỴzZ | |
| ''' | |
| VN_VARS = { | |
| "a": ("a", "à", "á", "ả", "ã", "ạ", "ă", "ằ", "ắ", "ẳ", "ẵ", "ặ", "â", "ầ", "ấ", "ẩ", "ẫ", "ậ"), | |
| "A": ("A", "À", "Á", "Ả", "Ã", "Ạ", "Ă", "Ằ", "Ắ", "Ẳ", "Ẵ", "Ặ", "Â", "Ầ", "Ấ", "Ẩ", "Ẫ", "Ậ"), |
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
| # | |
| autoflake --in-place --recursive . | |
| # | |
| isort . | |
| # | |
| autopep8 --in-place --aggressive --recursive . |
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 datetime | |
| import logging | |
| import pytz | |
| from elasticsearch import Elasticsearch | |
| from elasticsearch.helpers import bulk | |
| from server.settings import ELASTICSEARCH_INDEX, TIME_ZONE | |
| def convert_to_local_time(timestamp, timezone='UTC'): |
We can't make this file beautiful and searchable because it's too large.
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
| cn,vi | |
| 明朝.,Minh triều. | |
| 水桥村内.,Thủy Kiều thôn bên trong. | |
| "一个身材高瘦,却看起来容貌俊朗的年轻人,正坐在房间外的檐头下.","Một cái vóc người cao gầy, lại xem ra dung mạo thanh niên tuấn lãng, đang ngồi tại bên ngoài gian phòng mái hiên nhà dưới đầu." | |
| 青年名叫赵策.,Thanh niên tên là Triệu Sách. | |
| "此时的他,看着那长满了青苔的边边角角,轻叹一声.","Hắn lúc này, nhìn xem cái kia mọc đầy rêu xanh bên cạnh cạnh góc sừng, than nhẹ một tiếng." | |
| 穿越了...,Xuyên qua…… | |
| 穿越到了古代社会.,Xuyên qua đến cổ đại xã hội. | |
| "刚刚消化完原主记忆的赵策,只觉得脑袋瓜子有些嗡嗡的.","Vừa mới tiêu hóa xong nguyên chủ ký ức Triệu Sách, chỉ cảm thấy đầu có chút ông ông." | |
| "宿醉刚醒的脑袋,昏昏沉沉的.","Say rượu vừa tỉnh đầu, mê man." |
NewerOlder