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 / dispatch.sh
Created December 29, 2021 03:09 — forked from ciiqr/dispatch.sh
github actions, repository_dispatch with client_payload
# TODO: replace :token, :user, and :repo
curl -H "Authorization: token :token" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/:user/:repo/dispatches" \
-d '{"event_type": "awesomeness", "client_payload": {"foo": "bar"}}'
@tokisakiyuu
tokisakiyuu / README.md
Last active April 8, 2022 08:02
Chrome Extension manifest v3 inject script to page
@tokisakiyuu
tokisakiyuu / InputNumber.jsx
Created April 26, 2022 06:30
Solution for extend a typedef parameter in jsdoc
/**
* @typedef {import('react').ReactNode} ReactNode
* @typedef {import('antd/lib/input-number').InputNumberProps} InputNumberProps
* @typedef {Object} AddonProps
* @property {ReactNode} addonAfter
* @property {ReactNode} addonBefore
* @typedef {InputNumberProps & AddonProps} InputNumberPropsWithAddon
*/
import { Input, InputNumber, Button } from 'antd'
@tokisakiyuu
tokisakiyuu / element-picker.js
Created June 16, 2022 02:48
A JavaScript library that allows you to point and click to get the hovered element.
/**!
* Element Picker.
* A JavaScript library that allows you to point and click to get the hovered element.
* @author James Bechet <jamesbechet@gmail.com>
* @license MIT
*/
(function elementPickerModule(factory) {
if (typeof define === 'function' && define.amd) {
@tokisakiyuu
tokisakiyuu / architecture_list.txt
Created December 5, 2022 15:57
Common build targets for rust
x86_64-apple-darwin
aarch64-apple-darwin
x86_64-pc-windows-msvc
aarch64-pc-windows-msvc
x86_64-unknown-linux-musl
aarch64-unknown-linux-musl
x86_64-unknown-linux-gnu
armv7-unknown-linux-gnueabihf
@tokisakiyuu
tokisakiyuu / github-repo-rw.ts
Created July 1, 2023 01:47
read/write to the github repository
import { LRUCache } from 'lru-cache'
import { graphql, GraphqlResponseError } from '@octokit/graphql'
interface FileChanges {
additions?: AdditionChange[]
deletions?: DeletionChange[]
}
interface AdditionChange {
path: string
@tokisakiyuu
tokisakiyuu / csv-to-json.ts
Created July 1, 2023 02:05
Conversion between csv and json (holds the data type).
import * as csv from 'fast-csv'
/**
* `json object` => `csv string`
*
* the important thing is this process will holds the data type.
* @example
* ```js
* [
* { name: 'Jim', age: 19 },
@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  -->
 
@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