Skip to content

Instantly share code, notes, and snippets.

View tokisakiyuu's full-sized avatar
🏠
Working from home

Yuu tokisakiyuu

🏠
Working from home
View GitHub Profile
@tokisakiyuu
tokisakiyuu / Bdownloader.js
Last active July 8, 2026 02:59
Bdownloader: B站视频下载 bookmarklet(清晰度照搬播放器菜单 / 9 种输出格式 / 浏览器内 ffmpeg.wasm 合并转码)
/**
* Bdownloader bilibili video downloader bookmarklet
*
* Usage: run on a www.bilibili.com/video/BVxxxx page.
*
* Form: 清晰度 (mirrors the player's quality menu) + 输出格式 + one download button.
* - quality entries the current account can't fetch are shown disabled with a
* 大会员/需登录 tag; codec is auto-picked per quality (HEVC > AVC > AV1)
* - audio is not user-selectable: the best available stream is taken as-is
* (Hi-Res > Dolby Atmos > highest AAC), never bitrate-transcoded unless the
@tokisakiyuu
tokisakiyuu / README.md
Last active February 2, 2026 01:28
Automatic V2Ray VPN Server Installation on VPS

Automatic V2Ray VPN Server Installation on VPS

wget https://gist.githubusercontent.com/tokisakiyuu/99b7966b2201a7246c5905f67cc7ae81/raw/a9c92c8d5b4c6f1999d4b77fbf28c6b1f2a6c74b/v2ray.sh -O v2ray.sh && sudo bash v2ray.sh

Referrences

@tokisakiyuu
tokisakiyuu / package.json
Last active July 15, 2025 07:51
My Prettier Configurtion
{
"prettier": {
"useTabs": false,
"semi": false,
"singleQuote": true,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"bracketSpacing": true,
"arrowParens": "avoid",
"trailingComma": "all",
@tokisakiyuu
tokisakiyuu / README.md
Last active December 4, 2024 08:56
Transfer all data to another host with Mongodb (mongodump + mongorestore)

Dump (export data)

mongodump --db=example \                                                                                      
  --out=example-dump \                                                                                        
  --uri="mongodb://user:password@www.example.com:27017/?authSource=admin&directConnection=true"
mongodump --db= --out= --uri=""
@tokisakiyuu
tokisakiyuu / README.md
Last active November 14, 2024 15:23
Inserting, deleting and updating elements on an array of infinite length

IMG_B1D0F6413CDB-1

@tokisakiyuu
tokisakiyuu / README.md
Created September 28, 2024 12:39
Merge multiple repos into one monorepo (keep commits history)

Steps

Create Root

mkdir scribo-monorepo
cd scribo-monorepo

Define the workspace

@tokisakiyuu
tokisakiyuu / README.md
Last active August 16, 2024 15:59
Downloading Docker Images from Docker Hub without using Docker

The usage syntax for the script is given by the following:

bash download-frozen-image-v2.sh ubuntu ubuntu:latest

The image can then be imported with tar and docker load:

tar -cC 'target_dir' . | docker load
version: '3.7'
services:
mongodb_container:
# This image automatically creates a replica set required for transactions
image: prismagraphql/mongo-single-replica:4.4.3-bionic
# image: prismagraphql/mongo-single-replica:5.0.3
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: prisma
INIT_WAIT_SEC: 3
@tokisakiyuu
tokisakiyuu / Explain.tsx
Last active October 22, 2023 14:09
A ball that moves smoothly with the cursor (canvas ver)
import { FC, useEffect, useState } from 'react'
import { Stage, Layer, Circle, Arrow } from 'react-konva'
import Konva from 'konva'
import { useWindowSize } from 'react-use'
// https://konvajs.org/api/Konva.html
// https://github.com/konvajs/react-konva
interface Props {
debug?: boolean
@tokisakiyuu
tokisakiyuu / README.md
Last active August 12, 2023 16:01
Simple solution for reuse external script in tampermonkey

示例 index.html:

<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title>Nano Require Example</title>
  <!-- @document-start inserts  -->